aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2024-01-22 01:16:42 +0000
committerFrankie B <git@diskfloppy.me>2024-01-22 01:19:23 +0000
commit6fa9efcc74a9c36f9e2178ee5427eafb8d470d99 (patch)
tree9bbcf3d82d3c3b49ec34b89d7a2ec625ea6cb400 /resources
parent75fed3cbc11691ca9f50780cad187e5693354c49 (diff)
Get scheme cookie server-side instead of client-side on page load
Diffstat (limited to 'resources')
-rw-r--r--resources/views/includes/head.blade.php7
-rw-r--r--resources/views/layouts/default.blade.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/resources/views/includes/head.blade.php b/resources/views/includes/head.blade.php
index 3d51672..d6d1280 100644
--- a/resources/views/includes/head.blade.php
+++ b/resources/views/includes/head.blade.php
@@ -1,13 +1,16 @@
+@php // Get colorscheme from cookie and apply immediately
+ $colorscheme = request()->cookie('colorscheme', 'catppuccin-macchiato');
+@endphp
<!-- Global -->
<meta charset="utf-8">
<meta property="og:type" content="website">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#333333">
- <link rel="stylesheet" href="/css/colorschemes/catppuccin-macchiato.css" id="css-colorscheme"/>
+ <link rel="stylesheet" href="{{ asset("/css/colorschemes/{$colorscheme}.css") }}" id="css-colorscheme"/>
<link rel="stylesheet" href="/css/master.css"/>
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"/>
- <script src="/js/themeSwap.js"></script>
+ <script src="/js/schemeSwap.js"></script>
{!! (intval(date('n')) == 12) ? '<script src="/js/christmas/snow.js"></script>' : '' !!}
<!-- Page-specific -->
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php
index 144c32b..996d895 100644
--- a/resources/views/layouts/default.blade.php
+++ b/resources/views/layouts/default.blade.php
@@ -4,7 +4,7 @@
@include('includes.head')
</head>
-<body onload="setDefaultScheme()">
+<body>
<div class="page">
<div id="header" class="header">
@include('includes.header')