diff --git a/static/js/grey.js b/static/js/grey.js new file mode 100644 index 0000000000000000000000000000000000000000..4ce560253146c2665993e53991a6bd12169c129c --- /dev/null +++ b/static/js/grey.js @@ -0,0 +1,26 @@ +var global_grey = { + '-webkit-filter':'grayscale(1)', + '-moz-filter':'grayscale(1)', + '-ms-filter':'grayscale(1)', + '-o-filter':'grayscale(1)', + 'filter':'grayscale(1)', +}; + +function autoGreyByTime(){ + let now = new Date(); + let now_hours = now.getHours(); + // console.log(now_hours,typeof now_hours); + if(now_hours >= 23 || now_hours < 8){ + $('html').css(global_grey); + } +} +autoGreyByTime(); + +function darkModeHandler() { + const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); + if (mediaQuery.matches) { + let color = '#1b1b1b'; + $('body').css({"background": color }); + } +} +darkModeHandler(); \ No newline at end of file diff --git a/templates/admin.html b/templates/admin.html index 70fbbe75ebffee62b89bfc3de8aa599b72453732..267a75b528c29385efe5773574b49400859d17d7 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -8,10 +8,10 @@ - + - + + @@ -19,14 +20,6 @@
+
diff --git a/templates/layui_list.html b/templates/layui_list.html index 3844d77d29d7ae47993a77f492a8a48f2bbe28aa..425cd623237c234e5619600c880b4b8df27a9278 100644 --- a/templates/layui_list.html +++ b/templates/layui_list.html @@ -9,9 +9,10 @@ - - + + + diff --git a/templates/login.html b/templates/login.html index 371207b9dda5458afda45e13839f82c5a0dc4b1f..09c2c7716372d1d804069c363f57682161361279 100644 --- a/templates/login.html +++ b/templates/login.html @@ -43,6 +43,7 @@ + diff --git a/templates/logtail.html b/templates/logtail.html index 4d45272128d4ffc558bf16663cc6a850635e05ce..eef102cb5c9f6a469d9b2bc822dacb2843545afe 100644 --- a/templates/logtail.html +++ b/templates/logtail.html @@ -9,6 +9,7 @@ tvbox实时日志 + diff --git a/templates/rules_to_clear.html b/templates/rules_to_clear.html index d8a1e7f8e182887829619daab649b4f30c0d9589..2ebd438e8b11b5c1d633c12c9fa4bc457168c806 100644 --- a/templates/rules_to_clear.html +++ b/templates/rules_to_clear.html @@ -9,6 +9,7 @@ 删除已缓存规则列表-{{rules.count}} +