From 596065b7c8520d67992478c0c59800e1a041cd4e Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Fri, 2 Dec 2022 21:38:05 -0500 Subject: [PATCH] early dark mode support using #dark --- wwwroot/css/site.css | 13 +++++++++---- wwwroot/js/site.js | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/wwwroot/css/site.css b/wwwroot/css/site.css index 610c570..e5db2aa 100644 --- a/wwwroot/css/site.css +++ b/wwwroot/css/site.css @@ -1,7 +1,7 @@ html { font-size: 14px; height: 100%; - font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } @media (min-width: 768px) { @@ -35,6 +35,11 @@ textarea { border-width: 0; } + textarea.dark { + background-color: #222; + color: #ddd; + } + #saved-indicator { position: fixed; bottom: -40px; @@ -47,6 +52,6 @@ textarea { transition: bottom 0.2s; } -#saved-indicator.show { - bottom: 0; -} \ No newline at end of file + #saved-indicator.show { + bottom: 0; + } diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index 03da00a..347f204 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -22,6 +22,11 @@ $(function () { + // set dark mode + if (window.location.hash == '#dark') { + $('textarea').addClass('dark'); + } + var timer = null; let ignoredKeyCodes = [17, 18, 20, 27, 37, 38, 39, 40, 91];