From f6cfaf59be34ddf4f40d627177f2fd0c42c0fe40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Galv=C3=A3o?= Date: Tue, 25 Jun 2024 14:52:32 -0300 Subject: [PATCH] refactor: reorder . --- index.html | 63 +++++++++++++++++++++++++++++++++++++++++------------- script.js | 35 +++++++++++++++--------------- style.css | 6 +++--- 3 files changed, 68 insertions(+), 36 deletions(-) diff --git a/index.html b/index.html index 00fd06a..e4b2c41 100644 --- a/index.html +++ b/index.html @@ -1,22 +1,23 @@ - + + + + + @brunoglvm + + + - - - - - @brunoglvm -
-
+

@brunoglvm

@@ -28,30 +29,62 @@ diff --git a/script.js b/script.js index 49102d1..9339210 100644 --- a/script.js +++ b/script.js @@ -1,18 +1,17 @@ -function toggleMode() { - const html = document.documentElement; - const root = document.querySelector(":root"); - - html.classList.toggle("light"); - - const img = document.querySelector("#profile img"); - - if (html.classList.contains("light")) { - img.setAttribute("src", "./assets/avatar-light.png"); - img.setAttribute("alt", "Light theme profile picture"); - root.style.setProperty("--bg-color", "rgb(239, 235, 239)"); - } else { - img.setAttribute("src", "./assets/avatar-dark.png"); - img.setAttribute("alt", "Dark theme profile picture"); - root.style.setProperty("--bg-color", "rgb(22, 22, 24)"); - } -} +function toggleMode() { + const html = document.documentElement; + const root = document.querySelector(":root"); + const img = document.querySelector("#user img"); + + html.classList.toggle("light"); + + if (html.classList.contains("light")) { + img.setAttribute("src", "./assets/avatar-light.png"); + img.setAttribute("alt", "Light theme user image"); + root.style.setProperty("--bg-color", "rgb(239, 235, 239)"); + } else { + img.setAttribute("src", "./assets/avatar-dark.png"); + img.setAttribute("alt", "Dark theme user image"); + root.style.setProperty("--bg-color", "rgb(22, 22, 24)"); + } +} diff --git a/style.css b/style.css index 534b515..464f34b 100644 --- a/style.css +++ b/style.css @@ -45,16 +45,16 @@ body * { padding: 0 24px; } -#profile { +#user { text-align: center; padding: 24px; } -#profile img { +#user img { width: 112px; } -#profile p { +#user p { font-weight: 500; line-height: 24px; margin-top: 8px;