From f37c067e942f22ca9067bf591f48b619e797c553 Mon Sep 17 00:00:00 2001 From: Evgenii Kucheriavyi Date: Sat, 21 Oct 2023 16:10:11 +0300 Subject: [PATCH] feat: dark-theme + replaced margin-right with gap --- src/index.html | 14 ++++++++++---- src/index.js | 8 ++++++++ src/ui/menu.js | 28 +++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/index.html b/src/index.html index 80cdaf6..744c935 100644 --- a/src/index.html +++ b/src/index.html @@ -16,7 +16,9 @@ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 16px; color: rgb(73, 80, 87); - outline: none; + outline: none; + background-color: #fff; + transition: 250ms; } a { @@ -27,7 +29,11 @@ @media only screen and (max-width: 700px) { .links { display: none; - } + } + } + + .dark-theme #diagram { + background-color: #222; } Dgrm @@ -52,7 +58,7 @@ GitHub | LinkedIn - + - \ No newline at end of file + diff --git a/src/index.js b/src/index.js index b7f08f5..832fdac 100644 --- a/src/index.js +++ b/src/index.js @@ -42,3 +42,11 @@ if (url.searchParams.get('k')) { url = null; }); } else { url = null; } + + +// dark theme +const theme = localStorage.getItem('--theme'); + +if (theme === 'dark') { + document.body.className = 'dark-theme'; +} diff --git a/src/ui/menu.js b/src/ui/menu.js index 42ba15c..3e0c513 100644 --- a/src/ui/menu.js +++ b/src/ui/menu.js @@ -36,8 +36,14 @@ export class Menu extends HTMLElement { align-items: center; line-height: 25px; text-decoration: none; + gap: 10px; + } + .theme-toggler-cirlce { + width: 24px; + height: 24px; + border-radius: 50%; + background-color: #333; } - #options div svg, #options a svg { margin-right: 10px; }