good stuff

This commit is contained in:
pacnpal
2024-10-29 21:29:16 -04:00
parent 4e970400ef
commit 6880f36b99
42 changed files with 2835 additions and 262 deletions

View File

@@ -8,15 +8,17 @@
id="turnstile-widget"
class="cf-turnstile"
data-sitekey="{{ site_key }}"
data-theme="dark"
></div>
</div>
<script>
// Apply theme to the Turnstile widget based on the retrieved theme
// Apply theme to the Turnstile widget based on system preference
document.addEventListener("DOMContentLoaded", function () {
const turnstileWidget = document.getElementById("turnstile-widget");
if (turnstileWidget) {
turnstileWidget.setAttribute("data-theme", theme);
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
turnstileWidget.setAttribute("data-theme", prefersDark ? "dark" : "light");
}
});
</script>