diff --git a/public/css/main.css b/public/css/main.css index 361146a..22b6cdb 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -161,7 +161,7 @@ input:focus{ } .hide{ - /*display: none;*/ + display: none; } h2#cookie_text{ diff --git a/public/js/main.js b/public/js/main.js index 30477ad..228759a 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -21,6 +21,16 @@ main.querySelector("#email").addEventListener("keyup", e => { mailValid(); }); +let observer = new IntersectionObserver(function(entries) { + if(entries[0].isIntersecting === true) + window.scrollTo({top: entries[0].target.getBoundingClientRect().top + window.scrollY, + left: 0, + behavior: 'smooth'}); +}, { rootMargin: "0px", threshold: 0.2 }); + +for (let e of [main, resultMail, passwordTest, resultPassword, passwordManage, security2AF, cookie]) + observer.observe(e); + resultMail.querySelector("a").addEventListener("click", () => { passwordTest.classList.remove("hide"); passwordTest.scrollIntoView({"behavior": "smooth"});