From 2efec397d78b460f06fd75fb1bb90f7358d82a9f Mon Sep 17 00:00:00 2001 From: sovetski Date: Sun, 19 Nov 2023 19:15:00 +0000 Subject: [PATCH] deploy: b95bca09933e01e37749306aa4d6689ad3b7047e --- assets/index-EMP84HoD.js | 1 + assets/index-EgTIQIyJ.css | 1 + index.html | 36 ++++++++++++++++++++++++++++++++++++ typescript.svg | 1 + 4 files changed, 39 insertions(+) create mode 100644 assets/index-EMP84HoD.js create mode 100644 assets/index-EgTIQIyJ.css create mode 100644 index.html create mode 100644 typescript.svg diff --git a/assets/index-EMP84HoD.js b/assets/index-EMP84HoD.js new file mode 100644 index 0000000..52e64f9 --- /dev/null +++ b/assets/index-EMP84HoD.js @@ -0,0 +1 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function c(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=c(n);fetch(n.href,r)}})();let o=0;const i=document.querySelectorAll(".scroll-section"),g=document.querySelectorAll(".scroll-section-menu a");let u=0,f=0;window.addEventListener("wheel",e=>{const t=e.target;d(t)||h(e)});window.addEventListener("touchstart",e=>{const t=e.target;d(t)||(u=e.touches[0].clientY)},!1);window.addEventListener("touchend",e=>{const t=e.target;d(t)||(f=e.changedTouches[0].clientY,h())},!1);window.addEventListener("resize",m);function h(e){let t=e instanceof WheelEvent?e.deltaY>0:u>f;t&&o0&&o--,a()}function a(){const e=-o*window.innerHeight;i.forEach(t=>{t.style.transform=`translateY(${e}px)`})}function d(e){return e.matches("textarea, .scrollable")||e.closest(".scrollable")!=null}function m(){const e=-o*window.innerHeight;i.forEach(t=>{t.style.transform=`translateY(${e}px)`})}g.forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();const c=t.target.getAttribute("href")||"",s=document.querySelector(c);s&&(o=Array.from(i).indexOf(s),a(),window.history.pushState(null,"",c))})});function y(){const e=window.location.hash;if(e){const t=document.querySelector(e);t&&(o=Array.from(i).indexOf(t),a())}}y(); diff --git a/assets/index-EgTIQIyJ.css b/assets/index-EgTIQIyJ.css new file mode 100644 index 0000000..d14f7b8 --- /dev/null +++ b/assets/index-EgTIQIyJ.css @@ -0,0 +1 @@ +.scroll-section{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:2em}.scroll-section textarea{width:250px;height:250px}.scroll-section-menu{position:fixed;top:0;left:0;width:100%;background:#333;box-shadow:0 2px 5px #0000004d;z-index:1000;padding:10px 0}.scroll-section-menu ul{list-style:none;margin:0;padding:0;display:flex;justify-content:center}.scroll-section-menu ul li{margin:0 15px}.scroll-section-menu ul li a{text-decoration:none;color:#fff;font-size:1.1em;padding:5px 10px;border-radius:5px;transition:background-color .3s,color .3s}.scroll-section-menu ul li a:hover{background-color:#f0f0f0;color:#333;text-decoration:none}.scroll-section-menu ul li a:focus{background-color:#f0f0f0;color:#333;text-decoration:none}#section1{background:lightblue}#section2{background:lightgreen}#section3{background:lightcoral}#section4{background:lightgoldenrodyellow}body,html,#app,#root{margin:0;padding:0;height:100%;overflow:hidden}body .scroll-section,html .scroll-section,#app .scroll-section,#root .scroll-section{height:100vh;transition:transform .5s ease} diff --git a/index.html b/index.html new file mode 100644 index 0000000..c9fe79f --- /dev/null +++ b/index.html @@ -0,0 +1,36 @@ + + + + + + + Scroll Section + + + + + + +
Welcome!
+
+

With textarea

+ +
+
Section 3
+
Section 4
+ + diff --git a/typescript.svg b/typescript.svg new file mode 100644 index 0000000..d91c910 --- /dev/null +++ b/typescript.svg @@ -0,0 +1 @@ + \ No newline at end of file