|  | 
| 1 | 1 | <!DOCTYPE html> | 
| 2 |  | -<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | 
|  | 2 | +<html | 
|  | 3 | +    lang="{{ str_replace('_', '-', app()->getLocale()) }}" | 
|  | 4 | +    x-data="{ darkMode: document.documentElement.classList.contains('dark') }" | 
|  | 5 | +    x-init="$watch('darkMode', val => localStorage.setItem('darkMode', val))" | 
|  | 6 | +    x-bind:class="{ 'dark': darkMode }" | 
|  | 7 | +> | 
| 3 | 8 | 
 | 
| 4 | 9 | <head> | 
|  | 10 | +    <script> | 
|  | 11 | +        (function() { | 
|  | 12 | +            const darkMode = localStorage.getItem('darkMode'); | 
|  | 13 | +            const windowPrefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; | 
|  | 14 | +
 | 
|  | 15 | +            if (darkMode === 'true' || (darkMode === null && windowPrefersDarkMode)) { | 
|  | 16 | +                document.documentElement.classList.add('dark'); | 
|  | 17 | +            } else { | 
|  | 18 | +                document.documentElement.classList.remove('dark'); | 
|  | 19 | +            } | 
|  | 20 | +        })(); | 
|  | 21 | +    </script> | 
|  | 22 | + | 
| 5 | 23 |     <meta charset="utf-8"> | 
| 6 | 24 |     <meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"> | 
|  | 25 | +    <meta name="apple-mobile-web-app-title" content="Many Notes"> | 
| 7 | 26 |     <title>{{ $title ?? 'Many Notes' }}</title> | 
| 8 | 27 |     <link rel="icon" type="image/png" href="/assets/icon-16x16.png" sizes="16x16"> | 
| 9 | 28 |     <link rel="icon" type="image/png" href="/assets/icon-32x32.png" sizes="32x32"> | 
| 10 | 29 |     <link rel="icon" type="image/svg+xml" href="/assets/icon.svg" sizes="any"> | 
| 11 | 30 |     <link rel="shortcut icon" href="/assets/favicon.ico"> | 
| 12 | 31 |     <link rel="apple-touch-icon" href="/assets/icon-180x180.png" sizes="180x180"> | 
| 13 |  | -    <meta name="apple-mobile-web-app-title" content="Many Notes"> | 
| 14 | 32 |     <link rel="manifest" href="/manifest.json"> | 
| 15 | 33 | 
 | 
| 16 | 34 |     @vite('resources/css/app.css') | 
|  | 
0 commit comments