From 6b03475f136d0bf88da541fc5414662f11a094c2 Mon Sep 17 00:00:00 2001 From: David Mosbach Date: Sat, 3 Jun 2023 02:56:36 +0200 Subject: [PATCH] added dark mode --- editor.css | 131 ++++++++++++++++++++++++++++++++++++----- editor.html | 164 ++++++++++++++++++++++++++++++++++------------------ editor.js | 67 +++++++++++++++++++-- 3 files changed, 285 insertions(+), 77 deletions(-) diff --git a/editor.css b/editor.css index 7449092..5f2e969 100644 --- a/editor.css +++ b/editor.css @@ -18,13 +18,11 @@ body { top: 0px; width: 100%; position: fixed; - /* padding: 8 8 8 8; */ padding-left: 10px; - background-color: rgba(230, 230, 230, 0.8); - /* opacity: 0.95; */ + /* background-color: rgba(230, 230, 230, 0.8); */ + /* transition: all 100ms ease-out 50ms; */ z-index: 5; float: left; - /* overflow: auto; */ backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } @@ -47,6 +45,7 @@ body { border-right: none; transition: all 200ms ease-out 0ms; cursor: pointer; + color: inherit; } .menuitem:hover button { @@ -82,7 +81,7 @@ body { font-size: 1em; font-family: 'Inter'; font-weight: normal; - color: rgba(120, 120, 120, 0.668); + /* color: rgba(120, 120, 120, 0.6); */ background-color: transparent; border-top: 4px solid transparent; border-bottom: 4px solid transparent; @@ -91,9 +90,9 @@ body { .submenu, #sidepanel, #filepanel { position:fixed; - background-color: rgba(230, 230, 230, 0.8); + /* background-color: rgba(230, 230, 230, 0.8); */ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); - /* opacity: 0.95; */ + /* transition: all 100ms ease-out 50ms; */ padding: 20px; border-radius: 15px; backdrop-filter: blur(10px); @@ -125,7 +124,7 @@ body { position: absolute; top: 10px; left: 20px; - color: rgba(120, 120, 120, 0.538); + /* color: rgba(120, 120, 120, 0.538); */ } #sidecontentedge, #sidecontentnode { @@ -181,8 +180,11 @@ body { } .contextmenu div, #filemenu div { - padding: 5px; - background-color: rgba(230, 230, 230, 0.8); + padding-top: 5px; + padding-bottom: 5px; + padding-left: 10px; + padding-right: 10px; + /* background-color: rgba(230, 230, 230, 0.8); */ /* opacity: 0.95; */ transition: all 100ms ease-out 50ms; -webkit-user-select: none; @@ -201,14 +203,22 @@ body { border-bottom-right-radius: 5px; } -.contextmenu div:hover, #filemenu div:hover { +.contextmenu .menu-lightmode:hover, #filemenu .menu-lightmode:hover { background-color: rgb(240, 240, 240, 0.8); } -.contextmenu div:active, #filemenu div:active { +.contextmenu .menu-lightmode:active, #filemenu .menu-lightmode:active { background-color: rgb(250, 250, 250, 0.8); } +.contextmenu .menu-darkmode:hover, #filemenu .menu-darkmode:hover { + background-color: rgba(35, 35, 35, 0.8); +} + +.contextmenu .menu-darkmode:active, #filemenu .menu-darkmode:active { + background-color: rgba(45, 45, 45, 0.8); +} + #filemenu .menutop { border-top-left-radius: 15px; border-top-right-radius: 15px; @@ -233,6 +243,7 @@ body { ::-webkit-scrollbar { width: 5px; + height: 5px; } ::-webkit-scrollbar-track { @@ -388,9 +399,67 @@ label { z-index: 3; } +#settings-table { + line-height: 2; + color: inherit; + text-align: left; +} + +#settings-table tr td:first-child { + padding-right: 10px; +} + +.toggle { + position: relative; + display: inline-block; + width: 30px; + height: 20px; +} + +.toggle input { + opacity: 0; + width: 0; + height: 0; +} + +.toggle-slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(120, 120, 120, 0.5); + border-radius: 15px; + -webkit-transition: 200ms; + transition: 200ms; +} + +.toggle-slider:before { + position: absolute; + content: ""; + height: 14px; + width: 14px; + left: 3px; + bottom: 3px; + background-color: white; + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); + border-radius: 15px; + -webkit-transition: 200ms; + transition: 200ms; +} + +input:checked + .toggle-slider { + background-color: rgb(75, 151, 151); +} + +input:checked + .toggle-slider:before { + -webkit-transform: translateX(10px); + -ms-transform: translateX(10px); + transform: translateX(10px); +} + .force-graph-container .graph-tooltip { - color: black; - background-color: rgba(230, 230, 230, 0.8); box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); /* opacity: 0.95; */ backdrop-filter: blur(10px); @@ -400,4 +469,38 @@ label { border-radius: 5px; padding-left: 5px; padding-right: 5px; +} + +.menu-lightmode, .force-graph-container .menu-lightmode { + color: black; + background-color: rgba(230, 230, 230, 0.8); +} + +.menu-darkmode, .force-graph-container .menu-darkmode { + color: white; + background-color: rgba(25, 25, 25, 0.8); +} + +.menu-lightmode svg { + stroke: rgb(63, 63, 63); +} + +.menu-darkmode svg { + stroke: rgb(192, 192, 192); +} + +.contenttype-lightmode, .menuitem .contenttype-lightmode { + color: rgba(120, 120, 120, 0.6); +} + +.contenttype-darkmode, .menuitem .contenttype-darkmode { + color: rgba(135, 135, 135, 0.6); +} + +.contenttype-lightmode svg { + stroke: rgba(120, 120, 120, 0.6); +} + +.contenttype-darkmode svg { + stroke: rgba(135, 135, 135, 0.6); } \ No newline at end of file diff --git a/editor.html b/editor.html index 19ae6c2..0730568 100644 --- a/editor.html +++ b/editor.html @@ -12,21 +12,21 @@
-