diff options
author | Andrew Dolgov <[email protected]> | 2020-01-23 13:14:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-01-23 13:14:47 +0300 |
commit | a6d314b753d7e79da06c733efd5a96caf9b5f562 (patch) | |
tree | fb23038afc729a21c83369dd83a75dd7a7799db1 | |
parent | 3b29e865b0b0718dde8f1a1cab3f7c8406ec424c (diff) |
support dark mode for login form
-rwxr-xr-x | include/login_form.php | 19 | ||||
-rw-r--r-- | js/utility.js | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/include/login_form.php b/include/login_form.php index 941321fc0..cf7f3e124 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -3,26 +3,39 @@ <html> <head> <title>Tiny Tiny RSS : Login</title> - <?php echo stylesheet_tag("css/default.css") ?> <link rel="shortcut icon" type="image/png" href="images/favicon.png"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <?php foreach (array("lib/prototype.js", "lib/dojo/dojo.js", "lib/dojo/tt-rss-layer.js", - "js/common.js", + "lib/prototype.js", + "js/common.js", + "js/utility.js", "errors.php?mode=js") as $jsfile) { echo javascript_tag($jsfile); } ?> + <style type="text/css"> + @media (prefers-color-scheme: dark) { + body { + background : #303030; + } + } + + body.css_loading * { + display : none; + } + </style> + <script type="text/javascript"> require({cache:{}}); </script> </head> -<body class="flat ttrss_utility ttrss_login"> +<body class="flat ttrss_utility ttrss_login css_loading"> <script type="text/javascript"> require(['dojo/parser', "dojo/ready", 'dijit/form/Button','dijit/form/CheckBox', 'dijit/form/Form', diff --git a/js/utility.js b/js/utility.js index 899dbeb02..16d4b8b95 100644 --- a/js/utility.js +++ b/js/utility.js @@ -1,3 +1,5 @@ +/* TODO: this should probably be something like night_mode.js since it does nothing specific to utility scripts */2 + Event.observe(window, "load", function() { const UtilityJS = { apply_night_mode: function (is_night, link) { |