dark mode made better to look at

This commit is contained in:
Thomas G 2022-08-08 22:11:16 +10:00
parent 2d2a7beef5
commit 5982a5e7c0
4 changed files with 16 additions and 14 deletions

View File

@ -440,7 +440,7 @@ body {
.content_signup a, .content_signup a,
.content_special p a, .content_special p a,
.content_special a { .content_special a {
color: black color: black;
} }
#footer { #footer {

View File

@ -67,12 +67,12 @@ body {
} }
.content { .content {
color: white; color: rgb(167 167 167);
background: rgb(25, 25, 25); background: rgb(25, 25, 25);
} }
.content_signup { .content_signup {
color: rgb(255, 255, 255); color: rgb(167 167 167);
background: rgb(25, 25, 25); background: rgb(25, 25, 25);
} }
@ -82,7 +82,7 @@ body {
.content_signup a, .content_signup a,
.content_special p a, .content_special p a,
.content_special a { .content_special a {
color: #d1d1d1; color: #005587;
} }
#footer { #footer {
@ -97,12 +97,12 @@ body {
#footer a, #footer a,
#footer_signup p, #footer_signup p,
#footer_signup a { #footer_signup a {
color: white; color: rgb(167 167 167);
} }
a, a,
#navbarusername { #navbarusername {
color: white; color: rgb(200,200,200);
} }
.logoutframe { .logoutframe {
@ -127,8 +127,8 @@ a,
textarea, textarea,
select, select,
input { input {
background-color: black; background-color: rgb(25, 25, 25);
color: white; color: rgb(200,200,200);
} }

View File

@ -42,9 +42,10 @@
@else @else
<link href="{{ asset('css/app.css?id=' . Str::random(8)) }}" rel="stylesheet"> <link href="{{ asset('css/app.css?id=' . Str::random(8)) }}" rel="stylesheet">
<script> <script>
function getStylesheet() { function getDarkMode() {
var currentTime = new Date().getHours(); var currentTime = new Date().getHours();
if (7 >= currentTime && currentTime > 18) {} else { if (6 >= currentTime && currentTime > 18) {} else {
// it is night time for the user, let's force dark mode.
var li = document.createElement('link'); var li = document.createElement('link');
var href = "{{ asset('css/appdark.css?id='.Str::random(8)) }}"; var href = "{{ asset('css/appdark.css?id='.Str::random(8)) }}";
var rel = 'stylesheet'; var rel = 'stylesheet';
@ -54,7 +55,7 @@
s.appendChild(li, s); s.appendChild(li, s);
} }
} }
getStylesheet() getDarkMode()
</script> </script>
@endauth @endauth
@yield('extras') @yield('extras')

View File

@ -33,9 +33,10 @@
@else @else
<link href="{{ asset('css/app.css?id=' . Str::random(8)) }}" rel="stylesheet"> <link href="{{ asset('css/app.css?id=' . Str::random(8)) }}" rel="stylesheet">
<script> <script>
function getStylesheet() { function getDarkMode() {
var currentTime = new Date().getHours(); var currentTime = new Date().getHours();
if (7 >= currentTime && currentTime > 18) {} else { if (6 >= currentTime && currentTime > 18) {} else {
// it is night time for the user, let's force dark mode.
var li = document.createElement('link'); var li = document.createElement('link');
var href = "{{ asset('css/appdark.css?id='.Str::random(8)) }}"; var href = "{{ asset('css/appdark.css?id='.Str::random(8)) }}";
var rel = 'stylesheet'; var rel = 'stylesheet';
@ -45,7 +46,7 @@
s.appendChild(li, s); s.appendChild(li, s);
} }
} }
getStylesheet() getDarkMode()
</script> </script>
@endauth @endauth
@yield('extras') @yield('extras')