Skip to content

Commit a3bb500

Browse files
Merge PR #8
Update footer-links
2 parents 0a8a5d7 + 98593d9 commit a3bb500

File tree

5 files changed

+101
-3
lines changed

5 files changed

+101
-3
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div class="relative inline-block">
2+
<div class="flex items-center gap-1 rounded-full border border-gray-200 bg-white p-1 shadow-sm dark:border-gray-800 dark:bg-gray-900">
3+
<button data-theme-btn="light" onclick="__setTheme('light')" class="inline-flex size-8 items-center justify-center rounded-full text-gray-500 transition-all hover:bg-gray-100 hover:text-gray-900 focus:outline-none dark:hover:bg-gray-800 dark:hover:text-gray-100" title="Light Mode">
4+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" /></svg>
5+
</button>
6+
<button data-theme-btn="dark" onclick="__setTheme('dark')" class="inline-flex size-8 items-center justify-center rounded-full text-gray-500 transition-all hover:bg-gray-100 hover:text-gray-900 focus:outline-none dark:hover:bg-gray-800 dark:hover:text-gray-100" title="Dark Mode">
7+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5"><path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" /></svg>
8+
</button>
9+
<button data-theme-btn="system" onclick="__setTheme('system')" class="inline-flex size-8 items-center justify-center rounded-full text-gray-500 transition-all hover:bg-gray-100 hover:text-gray-900 focus:outline-none dark:hover:bg-gray-800 dark:hover:text-gray-100" title="System Preference">
10+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25" /></svg>
11+
</button>
12+
</div>
13+
<script>
14+
(function () {
15+
const applyTheme = (m) => {
16+
const root = document.documentElement;
17+
const isD = m === "dark" || (m === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
18+
root.classList.toggle("dark", isD);
19+
document.querySelectorAll("[data-theme-btn]").forEach((b) => {
20+
const act = b.dataset.themeBtn === m;
21+
b.classList.toggle("bg-gray-100", act); b.classList.toggle("dark:bg-gray-800", act);
22+
b.classList.toggle("text-primary-600", act); b.classList.toggle("dark:text-primary-400", act);
23+
});
24+
};
25+
window.__setTheme = (m) => { localStorage.setItem("theme", m); applyTheme(m); };
26+
applyTheme(localStorage.getItem("theme") || "system");
27+
})();
28+
</script>
29+
</div>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="relative inline-block">
2+
<div class="relative flex h-9 items-center rounded-full bg-slate-200 p-1 dark:bg-slate-800">
3+
<div id="theme-slider" class="absolute h-7 w-7 rounded-full bg-white transition-transform duration-200 ease-out dark:bg-slate-600 shadow-sm"></div>
4+
<button onclick="updateTheme('system', 0)" class="relative z-10 flex h-7 w-7 items-center justify-center text-slate-500 transition-colors hover:text-slate-900 dark:hover:text-white" title="System">
5+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25" /></svg>
6+
</button>
7+
<button onclick="updateTheme('light', 1)" class="relative z-10 flex h-7 w-7 items-center justify-center text-slate-500 transition-colors hover:text-slate-900 dark:hover:text-white" title="Light">
8+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18" /></svg>
9+
</button>
10+
<button onclick="updateTheme('dark', 2)" class="relative z-10 flex h-7 w-7 items-center justify-center text-slate-500 transition-colors hover:text-slate-900 dark:hover:text-white" title="Dark">
11+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"><path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" /></svg>
12+
</button>
13+
</div>
14+
<script>
15+
(function () {
16+
const s = document.getElementById("theme-slider");
17+
window.updateTheme = (m, i) => {
18+
const root = document.documentElement; localStorage.setItem("theme", m);
19+
const isD = m === "dark" || (m === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
20+
root.classList.toggle("dark", isD);
21+
if (s) s.style.transform = `translateX(${i * 28}px)`;
22+
};
23+
const cur = localStorage.getItem("theme") || "system";
24+
const idx = { system: 0, light: 1, dark: 2 }; updateTheme(cur, idx[cur]);
25+
})();
26+
</script>
27+
</div>

config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

33
return [
4-
'APP_VERSION' => '1.5.1',
4+
'APP_VERSION' => '1.5.5',
55
'BRAND_NAME' => 'mtex.dev',
66
];

data/components.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,29 @@
117117
"name": "Alternative Registration Form",
118118
"path": "components/auth/alternative-registration-form.html",
119119
"is_full": true
120+
},
121+
122+
123+
124+
{
125+
"id": "e0649c76-1d6b-466b-9938-c470860972bb",
126+
"category": "miscellaneous",
127+
"name": "Simple Theme Switcher",
128+
"path": "components/miscellaneous/simple-theme-switcher.html",
129+
"is_full": false
130+
},
131+
{
132+
"id": "75a24245-d7f8-475c-bbef-20a205acdd1a",
133+
"category": "miscellaneous",
134+
"name": "Sliding Theme Selecotr",
135+
"path": "components/miscellaneous/sliding-theme-selector.html",
136+
"is_full": false
137+
},
138+
{
139+
"id": "",
140+
"category": "miscellaneous",
141+
"name": "",
142+
"path": "components/miscellaneous/",
143+
"is_full": false
120144
}
121145
]

index.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,35 @@
178178
</div>
179179

180180
<div class="flex items-center gap-6">
181+
<a href="https://github.com/mtexdotdev/tw.mtex.dev" target="_blank" class="group flex flex-col">
182+
<span class="text-[10px] uppercase tracking-wider text-slate-400 transition-colors group-hover:text-primary-500">
183+
Source
184+
</span>
185+
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">GitHub</span>
186+
</a>
187+
<a href="https://status.mtex.dev" target="_blank" class="group flex flex-col">
188+
<span class="text-[10px] uppercase tracking-wider text-slate-400 transition-colors group-hover:text-primary-500">
189+
System
190+
</span>
191+
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">Status</span>
192+
</a>
181193
<a href="https://fabianternis.dev" target="_blank" class="group flex flex-col">
182194
<span class="text-[10px] uppercase tracking-wider text-slate-400 transition-colors group-hover:text-primary-500">
183195
Webmaster
184196
</span>
185197
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">fabianternis.dev</span>
186198
</a>
187-
<a href="https://mtex.dev" target="_blank" class="group flex flex-col">
199+
<a href="https://legal.mtex.dev" target="_blank" class="group flex flex-col">
200+
<span class="text-[10px] uppercase tracking-wider text-slate-400 transition-colors group-hover:text-primary-500">
201+
Legal
202+
</span>
203+
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">Page</span>
204+
</a>
205+
<a href="https://legal.mtex.dev/imprint" target="_blank" class="group flex flex-col">
188206
<span class="text-[10px] uppercase tracking-wider text-slate-400 transition-colors group-hover:text-primary-500">
189207
Imprint
190208
</span>
191-
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">mtex.dev</span>
209+
<span class="text-xs font-medium text-slate-600 dark:text-slate-300">legal.mtex.dev</span>
192210
</a>
193211
</div>
194212
</div>

0 commit comments

Comments
 (0)