Age Verification Squarespace !!top!! Here
const lastCheck = localStorage.getItem('ageVerifiedDate'); const today = new Date().toDateString(); if(lastCheck !== today) // show modal
document.getElementById('deny-age').onclick = function() window.location.href = 'https://www.google.com'; // Redirect away ; </script> The above remembers verification via browser localStorage . To reset daily, replace the if condition with: age verification squarespace
document.getElementById('confirm-age').onclick = function() localStorage.setItem('ageVerified', 'true'); document.getElementById('age-verification-modal').style.display = 'none'; ; const lastCheck = localStorage
Paste this (customize the age threshold and link): const lastCheck = localStorage.getItem('ageVerifiedDate')