From 07564bbde34ba60abda291dd39f4cacae6ea97a0 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 15 Jun 2023 17:35:51 +0100 Subject: [PATCH] captcha: recaptcha respects dark mode also removed the ugly border around it. --- css/base.css | 13 +++++++++++++ html/form-base.html | 3 ++- html/form.html | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/css/base.css b/css/base.css index f912d3e..5358312 100644 --- a/css/base.css +++ b/css/base.css @@ -560,3 +560,16 @@ div.card:contains(section.banner.footer) { input[type="checkbox" i], [class^="ri-"], [class*=" ri-"], .ri-refresh-line:before, .modal-close { cursor: pointer; } + + +.g-recaptcha { + overflow: hidden; + width: 296px; + height: 72px; + transform: scale(1.1); + transform-origin: top left; +} + +.g-recaptcha iframe { + margin: -2px 0px 0px -4px; +} diff --git a/html/form-base.html b/html/form-base.html index 9b9e667..b5f2e2a 100644 --- a/html/form-base.html +++ b/html/form-base.html @@ -39,7 +39,8 @@ var reCAPTCHACallback = () => { const el = document.getElementsByClassName("g-recaptcha")[0]; grecaptcha.render(el, { - "sitekey": window.reCAPTCHASiteKey + "sitekey": window.reCAPTCHASiteKey, + "theme": document.documentElement.classList.contains("dark") ? "dark" : "light" }); } diff --git a/html/form.html b/html/form.html index c88721f..48d8992 100644 --- a/html/form.html +++ b/html/form.html @@ -167,7 +167,7 @@ -
+
{{ .strings.passwordRequirementsHeader }}
    @@ -180,7 +180,7 @@
{{ if .captcha }}
- CAPTCHA {{ if not .reCAPTCHA }}{{ end }} + CAPTCHA {{ if not .reCAPTCHA }}{{ end }}
{{ if not .reCAPTCHA }}