added details and pop-up to event calendar
All checks were successful
publish / publish (push) Successful in 26s
All checks were successful
publish / publish (push) Successful in 26s
This commit is contained in:
parent
e905c11f70
commit
2264cd53b5
7 changed files with 234 additions and 146 deletions
38
layouts/_partials/scripts.html
Normal file
38
layouts/_partials/scripts.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!-- Darkmode JS -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const isDark = stored ? stored === "dark" : systemPrefersDark;
|
||||
if (isDark) {
|
||||
document.documentElement.classList.add("dark");
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore errors
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!-- Localization Auto Redirect -->
|
||||
{{ if .IsHome }}
|
||||
<script>
|
||||
const cachedLang = localStorage.getItem("language");
|
||||
const path = window.location.pathname;
|
||||
|
||||
if (cachedLang) {
|
||||
if (cachedLang === "de" && path !== "/") {
|
||||
window.location.href = "/";
|
||||
} else if (cachedLang === "en" && path !== "/en/") {
|
||||
window.location.href = "/en/";
|
||||
}
|
||||
} else {
|
||||
const lang = navigator.language;
|
||||
|
||||
if (lang.startsWith("de")) {
|
||||
localStorage.setItem("language", "de");
|
||||
} else {
|
||||
localStorage.setItem("language", "en");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue