Browse Source

default.css: auto switch night/day modes

Andrew Dolgov 5 months ago
parent
commit
351f32cd42
4 changed files with 9 additions and 2 deletions
  1. 1 1
      js/read.js
  2. 1 0
      read.html
  3. 6 1
      themes/default.css
  4. 1 0
      worker.js

+ 1 - 1
js/read.js

@@ -23,7 +23,7 @@ function init_loader() {
 	const res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile-events.min.js",
 		"css/transitions.css",
 		"js/reader.js", "css/reader.css", "js/dict.js",
-		"themes/default.css", "themes/mocca.css", "themes/night.css",
+		"themes/default.css", "themes/light.css", "themes/mocca.css", "themes/night.css",
 		"themes/plan9.css", "themes/gray.css", "themes/sepia.css" ];
 
 	for (let i = 0; i < res_names.length; i++) {

+ 1 - 0
read.html

@@ -66,6 +66,7 @@
 					<div class="col-sm-9">
 						<select class="theme_name form-control" onchange="change_theme(this)">
 							<option value="default">Default</option>
+						 	<option value="light">Light</option>
 						 	<option value="gray">Gray</option>
 							<option value="mocca">Mocca</option>
 						 	<option value="night">Night</option>

+ 6 - 1
themes/default.css

@@ -1 +1,6 @@
-/* placeholder */
[email protected] (prefers-color-scheme: dark) {
+	body, .loading, html:-webkit-full-screen {
+		background : black;
+		color : #ccc;
+	}
+}

+ 1 - 0
worker.js

@@ -18,6 +18,7 @@ const CACHE_URLS = [
 			'css/transitions.css',
 			'offline.html',
 			'themes/default.css',
+			'themes/light.css',
 			'themes/mocca.css',
 			'themes/night.css',
 			'themes/plan9.css',