diff --git a/script.js b/script.js index e938511..1684dfe 100644 --- a/script.js +++ b/script.js @@ -1,3 +1,17 @@ +//menu +const checkbox = document.getElementById('op'); + const mainContent = document.getElementById('content'); + + checkbox.addEventListener('change', function () { + if (checkbox.checked) { + // Checkbox is checked, apply z-index: -1000 + mainContent.style.zIndex = '-1000'; + } else { + // Checkbox is unchecked, remove the z-index property + mainContent.style.removeProperty('z-index'); + } + }); + //gif const gif = document.getElementById('autoplayGif'); @@ -20,3 +34,4 @@ const handleIntersection = (entries, observer) => { const observer = new IntersectionObserver(handleIntersection, options); observer.observe(gif); + diff --git a/style.css b/style.css index 872bf5c..e81d062 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,6 @@ main { display: flex; flex-flow: column wrap; - z-index: -1000; } body {