Files
firefly-iii/resources/views/v2/partials/layout/head.blade.php

75 lines
2.7 KiB
PHP
Raw Normal View History

2023-07-11 14:42:57 +02:00
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base href="{{ route('index') }}/">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="robots" content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="color-scheme" content="light dark">
2023-08-13 07:30:19 +02:00
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
2023-07-24 18:58:35 +02:00
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
// todo store just happens to store in localStorage but if not, this would break.
const getStoredTheme = () => JSON.parse(localStorage.getItem('darkMode'))
const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = theme => {
if (theme === 'browser' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
2023-08-27 07:45:09 +02:00
window.theme = 'dark';
2023-07-24 18:58:35 +02:00
return;
}
if (theme === 'browser' && window.matchMedia('(prefers-color-scheme: light)').matches) {
2023-08-27 07:45:09 +02:00
window.theme = 'light';
2023-07-24 18:58:35 +02:00
document.documentElement.setAttribute('data-bs-theme', 'light')
return;
}
document.documentElement.setAttribute('data-bs-theme', theme)
2023-08-27 07:45:09 +02:00
window.theme = theme;
2023-07-24 18:58:35 +02:00
}
setTheme(getPreferredTheme())
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
})()
</script>
2023-07-11 14:42:57 +02:00
<title>
@if($subTitle)
{{ $subTitle }} »
@endif
@if($title !== 'Firefly III')
{{ $title }} »
@endif
Firefly III
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2024-03-09 12:21:45 +01:00
@yield('styles')
@vite(['resources/assets/v2/sass/app.scss'])
2023-07-11 14:42:57 +02:00
</head>