From 720d752748b793a2f5cf3cc14cb75ad86e8919c0 Mon Sep 17 00:00:00 2001 From: sillylaird Date: Tue, 3 Feb 2026 21:27:57 -0500 Subject: First commit --- startpage/startpage.js | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 startpage/startpage.js (limited to 'startpage/startpage.js') diff --git a/startpage/startpage.js b/startpage/startpage.js new file mode 100644 index 0000000..3fc9701 --- /dev/null +++ b/startpage/startpage.js @@ -0,0 +1,87 @@ +(function () { + function byId(id) { + return document.getElementById(id); + } + + function updateClock() { + const dateEl = byId('realtime-date'); + const timeEl = byId('realtime-clock'); + if (!dateEl || !timeEl) return; + + const now = new Date(); + const options = { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' }; + dateEl.textContent = now.toLocaleDateString(undefined, options).toUpperCase(); + timeEl.textContent = now.toLocaleTimeString(); + } + + setInterval(updateClock, 1000); + updateClock(); + + // Age Verification System + let isVerified = false; + + const content = byId('age-restricted-content'); + const modal = byId('age-verification-modal'); + const yesBtn = byId('age-verify-yes'); + const noBtn = byId('age-verify-no'); + + function unlockContent() { + if (!content) return; + content.classList.remove('locked'); + content.classList.add('unlocked'); + content.removeEventListener('click', handleContentClick); + isVerified = true; + localStorage.setItem('ageVerified', 'true'); + } + + function showAgeModal() { + if (!modal) return; + modal.classList.remove('hidden'); + } + + function hideAgeModal() { + if (!modal) return; + modal.classList.add('hidden'); + } + + function handleContentClick(e) { + if (isVerified) return; + + e.preventDefault(); + e.stopPropagation(); + showAgeModal(); + } + + function confirmAge(isOfAge) { + if (!modal) return; + + if (isOfAge) { + unlockContent(); + hideAgeModal(); + alert('Age verified. You can now access restricted content.'); + } else { + hideAgeModal(); + window.location.href = 'https://www.google.com'; + } + } + + if (content && modal) { + const storedVerification = localStorage.getItem('ageVerified'); + if (storedVerification === 'true') { + unlockContent(); + } else { + showAgeModal(); + } + + content.addEventListener('click', handleContentClick); + + if (yesBtn) yesBtn.addEventListener('click', function () { confirmAge(true); }); + if (noBtn) noBtn.addEventListener('click', function () { confirmAge(false); }); + + document.addEventListener('keydown', function (e) { + if (e.altKey && e.key === 'a') { + showAgeModal(); + } + }); + } +})(); -- cgit v1.2.3