mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 09:58:30 +02:00
Toggling form legel disclamers (#1717)
* test another legal disclaimer approach * swapped disclaimers * revert contact form id
This commit is contained in:
@@ -49,6 +49,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
|
.input .hs-input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
&.form-columns-1:has(> .legal-consent-container) {
|
&.form-columns-1:has(> .legal-consent-container) {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -96,4 +100,17 @@
|
|||||||
@include media-breakpoint-up(xl) {
|
@include media-breakpoint-up(xl) {
|
||||||
padding: $spacer * 3 $spacer * 2.5;
|
padding: $spacer * 3 $spacer * 2.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input ul {
|
||||||
|
padding-left: 0;
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Legit-interest-text-legal-disclaimer,
|
||||||
|
#explicit-text-legal-disclaimer {
|
||||||
|
font-size: pxToRem(12);
|
||||||
|
line-height: pxToRem(18);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ form.hs-form {
|
|||||||
|
|
||||||
// todo: this may be removed once the form is updated
|
// todo: this may be removed once the form is updated
|
||||||
// this hides an original HubSpot form header
|
// this hides an original HubSpot form header
|
||||||
&.form-columns-0 {
|
&.form-columns-0:first-child {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
.hs-richtext {
|
.hs-richtext {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
@@ -157,48 +157,49 @@ form.hs-form {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hs-form-booleancheckbox-display,
|
||||||
|
.hs-form-checkbox-display {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
input[type='checkbox'] {
|
||||||
|
width: 1.2rem;
|
||||||
|
height: 1rem;
|
||||||
|
aspect-ratio: 1/1;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 1px solid $neutral-40;
|
||||||
|
border-radius: 4px;
|
||||||
|
outline: none;
|
||||||
|
appearance: none;
|
||||||
|
padding: 0;
|
||||||
|
margin-right: pxToRem(8);
|
||||||
|
|
||||||
|
&:checked {
|
||||||
|
border-color: $neutral-100;
|
||||||
|
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZmlsbD0iI2YwZjJmOSIgZD0iTTQzOC42IDEwNS40YzEyLjUgMTIuNSAxMi41IDMyLjggMCA0NS4zbC0yNTYgMjU2Yy0xMi41IDEyLjUtMzIuOCAxMi41LTQ1LjMgMGwtMTI4LTEyOGMtMTIuNS0xMi41LTEyLjUtMzIuOCAwLTQ1LjNzMzIuOC0xMi41IDQ1LjMgMEwxNjAgMzM4LjcgMzkzLjQgMTA1LjRjMTIuNS0xMi41IDMyLjgtMTIuNSA0NS4zIDB6Ii8+PC9zdmc+');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border: 1px solid $neutral-100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.legal-consent-container {
|
.legal-consent-container {
|
||||||
p, & div {
|
p,
|
||||||
|
div,
|
||||||
|
span,
|
||||||
|
.hs-form-booleancheckbox-display {
|
||||||
font-size: pxToRem(12);
|
font-size: pxToRem(12);
|
||||||
line-height: pxToRem(18);
|
line-height: pxToRem(18);
|
||||||
color: $neutral-60;
|
color: $neutral-60;
|
||||||
margin-bottom: pxToRem(8);
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: $neutral-80;
|
color: $neutral-80;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.hs-form-booleancheckbox-display {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
input[type='checkbox'] {
|
|
||||||
width: 1.2rem;
|
|
||||||
height: 1rem;
|
|
||||||
aspect-ratio: 1/1;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 1px solid $neutral-40;
|
|
||||||
border-radius: 4px;
|
|
||||||
outline: none;
|
|
||||||
appearance: none;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
&:checked {
|
|
||||||
border-color: $neutral-100;
|
|
||||||
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZmlsbD0iI2YwZjJmOSIgZD0iTTQzOC42IDEwNS40YzEyLjUgMTIuNSAxMi41IDMyLjggMCA0NS4zbC0yNTYgMjU2Yy0xMi41IDEyLjUtMzIuOCAxMi41LTQ1LjMgMGwtMTI4LTEyOGMtMTIuNS0xMi41LTEyLjUtMzIuOCAwLTQ1LjNzMzIuOC0xMi41IDQ1LjMgMEwxNjAgMzM4LjcgMzkzLjQgMTA1LjRjMTIuNS0xMi41IDMyLjgtMTIuNSA0NS4zIDB6Ii8+PC9zdmc+');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border: 1px solid $neutral-100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: pxToRem(20);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,8 +229,7 @@ form.hs-form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hs_recaptcha.hs-recaptcha {
|
.hs_recaptcha.hs-recaptcha {
|
||||||
|
|
||||||
.grecaptcha-badge {
|
.grecaptcha-badge {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,37 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// List of countries that require explicit consent for data processing
|
||||||
|
const restrictedCountries = [
|
||||||
|
"Argentina", "Belgium", "Canada", "Czech Republic", "Cyprus", "Denmark", "Germany",
|
||||||
|
"Hungary", "Latvia", "Liechtenstein", "Luxembourg", "Netherlands", "Norway", "France",
|
||||||
|
"Finland", "Croatia", "Bulgaria", "Belarus", "Bosnia and Herzegovina", "Austria", "Estonia",
|
||||||
|
"Georgia", "Greenland", "Hong Kong", "Israel", "Italy", "Maldives", "Moldova", "Monaco",
|
||||||
|
"Portugal", "Russia", "Serbia", "Slovakia", "Slovenia", "Sweden", "Switzerland", "Türkiye",
|
||||||
|
"Ukraine", "Macedonia (FYROM)", "United Kingdom"
|
||||||
|
];
|
||||||
|
|
||||||
|
// consent block should show additional checkbox for restricted countries
|
||||||
|
function updateConsentBlocks(form) {
|
||||||
|
const countryField = form.querySelector('select[name="country"]');
|
||||||
|
const legitDisclaimerText = form.querySelector('#Legit-interest-text-legal-disclaimer');
|
||||||
|
const explicitDisclaimerText = form.querySelector('#explicit-text-legal-disclaimer');
|
||||||
|
|
||||||
|
if (!countryField || !legitDisclaimerText || !explicitDisclaimerText) {
|
||||||
|
// If there is no country field or related disclaimers, exit early
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const selected = countryField.value;
|
||||||
|
const isRestricted = restrictedCountries.includes(selected);
|
||||||
|
const showOptIn = selected && isRestricted;
|
||||||
|
|
||||||
|
if (legitDisclaimerText) legitDisclaimerText.style.display = showOptIn ? "none" : "block";
|
||||||
|
if (explicitDisclaimerText) explicitDisclaimerText.style.display = showOptIn ? "block" : "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hbspt.forms.create({
|
hbspt.forms.create({
|
||||||
...options,
|
...options,
|
||||||
@@ -34,12 +65,24 @@
|
|||||||
pageId: "{{- .context.Permalink -}}",
|
pageId: "{{- .context.Permalink -}}",
|
||||||
target: "#{{- .id -}}",
|
target: "#{{- .id -}}",
|
||||||
onFormReady: function($form) {
|
onFormReady: function($form) {
|
||||||
|
if (!$form) {
|
||||||
|
console.warn("Form not found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initHoneypot($form);
|
initHoneypot($form);
|
||||||
|
|
||||||
|
updateConsentBlocks($form)
|
||||||
|
const countryField = $form.querySelector('select[name="country"]');
|
||||||
|
if (countryField) {
|
||||||
|
countryField.addEventListener("change", () => updateConsentBlocks($form));
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
document.getElementById("{{- .id -}}").innerHTML = '<p class="text-white">Here should be a form but looks like it was blocked on your side. Please, check your trackers blocking policy.</p>';
|
document.getElementById("{{- .id -}}").innerHTML = '<p class="text-white">Here should be a form but looks like it was blocked on your side. Please, check your trackers blocking policy.</p>';
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user