From 6fa9efcc74a9c36f9e2178ee5427eafb8d470d99 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Mon, 22 Jan 2024 01:16:42 +0000 Subject: Get scheme cookie server-side instead of client-side on page load --- resources/views/includes/head.blade.php | 7 +++++-- resources/views/layouts/default.blade.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'resources') 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 - + - + {!! (intval(date('n')) == 12) ? '' : '' !!} 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') - +