|
4 | 4 | <div class="relative flex h-16 items-center justify-between"> |
5 | 5 | <div class="flex justify-center sm:items-stretch sm:justify-start"> |
6 | 6 | <a href="{{ site.baseurl }}/" class="flex shrink-0 items-center"> |
7 | | - <img |
8 | | - class="h-8 w-auto" |
9 | | - src="{{ site.baseurl }}/assets/img/logo.png" |
10 | | - /> |
| 7 | + <img class="h-8 w-auto" src="{{ site.baseurl }}/assets/img/logo.png" /> |
11 | 8 | <p class="ml-4 dark:text-gray-100 font-bold">Beaver Blog</p> |
12 | 9 | </a> |
13 | 10 | <div class="hidden sm:ml-6 sm:block"> |
14 | 11 | <div class="flex space-x-4"> |
15 | | - <a |
16 | | - href="https://bsky.app/profile/beavernotes.com" |
17 | | - class="rounded-md dark:text-neutral-100 dark:text-neutral-100 hover:bg-blue-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" |
18 | | - aria-current="page" |
19 | | - > |
| 12 | + <a href="https://bsky.app/profile/beavernotes.com" class="rounded-md dark:text-neutral-100 dark:text-neutral-100 hover:bg-blue-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
20 | 13 | <i class="fa-brands fa-bluesky hover:text-blue-400 fa-xl"></i> |
21 | 14 | </a> |
22 | | - <a |
23 | | - href="https://mastodon.social/@Beavernotes" |
24 | | - class="rounded-md dark:text-neutral-100 hover:bg-[#6364FF] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" |
25 | | - aria-current="page" |
26 | | - > |
| 15 | + <a href="https://mastodon.social/@Beavernotes" class="rounded-md dark:text-neutral-100 hover:bg-[#6364FF] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
27 | 16 | <i class="fa-brands fa-mastodon hover:text-[#6364FF] fa-xl"></i> |
28 | 17 | </a> |
29 | | - <a |
30 | | - href="https://www.reddit.com/r/BeaverNotes" |
31 | | - class="rounded-md dark:text-neutral-100 hover:bg-[#FF4500] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" |
32 | | - aria-current="page" |
33 | | - > |
| 18 | + <a href="https://www.reddit.com/r/BeaverNotes" class="rounded-md dark:text-neutral-100 hover:bg-[#FF4500] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
34 | 19 | <i class="fa-brands fa-reddit hover:text-[#FF4500] fa-xl"></i> |
35 | 20 | </a> |
36 | | - <a |
37 | | - href="https://beaver-notes.github.io/Beaver-Docs" |
38 | | - class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" |
39 | | - aria-current="page" |
40 | | - > |
| 21 | + <a href="https://beaver-notes.github.io/Beaver-Docs" class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
41 | 22 | <i class="fa-solid fa-book hover:text-amber-400 fa-xl"></i> |
42 | 23 | </a> |
43 | | - <a |
44 | | - href="{{site.url}}/feed.xml" |
45 | | - class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" |
46 | | - aria-current="page" |
47 | | - > |
| 24 | + <a href="{{site.url}}/feed.xml" class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
48 | 25 | <i class="fa-solid fa-rss hover:text-amber-400 fa-xl"></i> |
49 | 26 | </a> |
50 | 27 | </div> |
51 | 28 | </div> |
52 | 29 | </div> |
53 | 30 | <!-- Search Icon Button --> |
54 | | - <button |
55 | | - onclick="openSearch()" |
56 | | - class="text-neutral-100 p-2 rounded-lg hover:bg-amber-400 hover:bg-opacity-10 flex items-center justify-center ml-auto" |
57 | | - > |
58 | | - <i |
59 | | - class="fa-solid fa-magnifying-glass text-gray-600 dark:text-neutral-100 hover:text-amber-400" |
60 | | - ></i> |
| 31 | + <button onclick="openSearch()" class="text-neutral-100 p-2 rounded-lg hover:bg-amber-400 hover:bg-opacity-10 flex items-center justify-center ml-auto"> |
| 32 | + <i class="fa-solid fa-magnifying-glass text-gray-600 dark:text-neutral-100 hover:text-amber-400"></i> |
61 | 33 | </button> |
62 | 34 |
|
63 | 35 | <!-- Dark Mode Toggle Button --> |
64 | | - <button |
65 | | - id="dark-mode-toggle" |
66 | | - class="text-neutral-100 p-2 rounded-lg hover:bg-amber-400 hover:bg-opacity-10 flex items-center justify-center ml-4" |
67 | | - onclick="toggleDarkMode()" |
68 | | - > |
69 | | - <i |
70 | | - id="dark-mode-icon" |
71 | | - class="fa-solid fa-moon text-gray-600 dark:text-neutral-100" |
72 | | - ></i> |
| 36 | + <button id="dark-mode-toggle" class="text-neutral-100 p-2 rounded-lg hover:bg-amber-400 hover:bg-opacity-10 flex items-center justify-center ml-4" onclick="toggleDarkMode()"> |
| 37 | + <i id="dark-mode-icon" class="fa-solid fa-moon text-gray-600 dark:text-neutral-100"></i> |
73 | 38 | </button> |
74 | 39 | </div> |
75 | 40 |
|
76 | | - <ul |
77 | | - id="results-container" |
78 | | - class="fixed right-0 z-40 w-80 bg-neutral-100 dark:bg-neutral-700 dark:text-neutral-100 rounded-xl overflow-auto" |
79 | | - > |
| 41 | + <!-- Share Buttons Container --> |
| 42 | + <div class="sm:hidden"> |
| 43 | + <div class="flex justify-center"> |
| 44 | + <a href="https://bsky.app/profile/beavernotes.com" class="rounded-md dark:text-neutral-100 dark:text-neutral-100 hover:bg-blue-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
| 45 | + <i class="fa-brands fa-bluesky hover:text-blue-400 fa-xl"></i> |
| 46 | + </a> |
| 47 | + <a href="https://mastodon.social/@Beavernotes" class="rounded-md dark:text-neutral-100 hover:bg-[#6364FF] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
| 48 | + <i class="fa-brands fa-mastodon hover:text-[#6364FF] fa-xl"></i> |
| 49 | + </a> |
| 50 | + <a href="https://www.reddit.com/r/BeaverNotes" class="rounded-md dark:text-neutral-100 hover:bg-[#FF4500] hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
| 51 | + <i class="fa-brands fa-reddit hover:text-[#FF4500] fa-xl"></i> |
| 52 | + </a> |
| 53 | + <a href="https://beaver-notes.github.io/Beaver-Docs" class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
| 54 | + <i class="fa-solid fa-book hover:text-amber-400 fa-xl"></i> |
| 55 | + </a> |
| 56 | + <a href="{{site.url}}/feed.xml" class="rounded-md dark:text-neutral-100 hover:bg-amber-400 hover:bg-opacity-20 p-2 text-sm font-medium dark:text-white" aria-current="page"> |
| 57 | + <i class="fa-solid fa-rss hover:text-amber-400 fa-xl"></i> |
| 58 | + </a> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + |
| 62 | + <ul id="results-container" class="fixed right-0 z-40 w-80 bg-neutral-100 dark:bg-neutral-700 dark:text-neutral-100 rounded-xl overflow-auto"> |
80 | 63 | <li></li> |
81 | 64 | </ul> |
82 | 65 | </div> |
|
104 | 87 | const html = document.documentElement; |
105 | 88 | const icon = document.getElementById("dark-mode-icon"); |
106 | 89 | const savedTheme = localStorage.getItem("theme"); |
107 | | - const systemPrefersDark = window.matchMedia( |
108 | | - "(prefers-color-scheme: dark)" |
109 | | - ).matches; |
| 90 | + const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; |
110 | 91 |
|
111 | 92 | if (savedTheme) { |
112 | 93 | // Apply saved theme |
|
133 | 114 | } |
134 | 115 |
|
135 | 116 | // Update theme dynamically if the system preference changes |
136 | | - window |
137 | | - .matchMedia("(prefers-color-scheme: dark)") |
138 | | - .addEventListener("change", (e) => { |
139 | | - if (!localStorage.getItem("theme")) { |
140 | | - if (e.matches) { |
141 | | - html.classList.add("dark"); |
142 | | - icon.classList.add("fa-sun"); |
143 | | - icon.classList.remove("fa-moon"); |
144 | | - } else { |
145 | | - html.classList.remove("dark"); |
146 | | - icon.classList.add("fa-moon"); |
147 | | - icon.classList.remove("fa-sun"); |
148 | | - } |
| 117 | + window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => { |
| 118 | + if (!localStorage.getItem("theme")) { |
| 119 | + if (e.matches) { |
| 120 | + html.classList.add("dark"); |
| 121 | + icon.classList.add("fa-sun"); |
| 122 | + icon.classList.remove("fa-moon"); |
| 123 | + } else { |
| 124 | + html.classList.remove("dark"); |
| 125 | + icon.classList.add("fa-moon"); |
| 126 | + icon.classList.remove("fa-sun"); |
149 | 127 | } |
150 | | - }); |
| 128 | + } |
| 129 | + }); |
151 | 130 | }); |
152 | 131 |
|
153 | 132 | function openSearch() { |
|
0 commit comments