-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathscripts.blade.php
27 lines (23 loc) · 1.18 KB
/
scripts.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{{-- The compiled Laravel Mix scripts --}}
@if(Asset::hasMediaFile('app.js'))
<script defer src="{{ Asset::mediaLink('app.js') }}"></script>
@endif
{{-- Alpine.js --}}
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.10.3/dist/cdn.min.js" integrity="sha256-gOkV4d9/FmMNEkjOzVlyM2eNAWSUXisT+1RbMTTIgXI=" crossorigin="anonymous"></script>
<script>
function toggleTheme() {
if (localStorage.getItem('color-theme') === 'dark' || !('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.remove("dark");
localStorage.setItem('color-theme', 'light');
document.getElementById('meta-color-scheme').setAttribute('content', 'light');
} else {
document.documentElement.classList.add("dark");
localStorage.setItem('color-theme', 'dark');
document.getElementById('meta-color-scheme').setAttribute('content', 'dark');
}
}
</script>
{{-- Add any extra scripts to include before the closing <body> tag --}}
@stack('scripts')
{{-- If the user has defined any custom scripts, render them here --}}
{!! config('hyde.scripts') !!}