mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:31:09 -05:00
good stuff
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user