diff --git a/html/main.ejs b/html/main.ejs index ae4d9f07..b72b6f91 100644 --- a/html/main.ejs +++ b/html/main.ejs @@ -262,18 +262,32 @@ margin-right: auto; overflow-x: auto; } .tabs { - display: table; - font-family:inter; - border-collapse: separate; - table-layout: auto; +display: table; + font-family: poketube flex; + border-collapse: separate; + table-layout: auto; + font-weight: 800; + font-stretch: extra-expanded; + border-spacing: 3px; } .tabs.tabs-center { -margin-left: 2em; - } +margin-left: auto; + background: #000; + border-radius: 1em; + margin-bottom: 7px; + margin-right: auto; +} } .tabs.tabs-justify { width: 100%; table-layout: fixed; } + + +.tab.active { + background: #1a1a1a !important; + border-radius: 1em !important; +} + .tabs a.tab { position: relative; display: table-cell; @@ -297,9 +311,7 @@ margin-left: 2em; left: 0px; right: 0px; border-radius: 3px 3px 0px 0px; - background: #9fdafd; - box-shadow: 0px 4px 10px 3px rgba(60, 180, 250, .15); - opacity: 0; + opacity: 0; transform: scale(0, 1); } .tabs a.tab.active { @@ -309,11 +321,33 @@ margin-left: 2em; opacity: 1; transform: scale(1, 1); } - + + +.tab:hover { + background: var(--not-quite-black); + text-decoration: none; + border-radius: 1em; +} -
+
@@ -382,6 +416,9 @@ border:solid; +

+Discover Popular videos on poketube! +

<% if (!tab) { %>
@@ -524,7 +561,61 @@ window.addEventListener("load", () => { progressContainer1.style.display = 'none'; }, 500); }); + + let isScrolling = false; +let startY = 0; +let currentY = 0; +let velocityY = 0; +let lastTimestamp = 0; + +const element = document.documentElement || document.body; // Use the entire page for scrolling + +element.addEventListener('mousedown', (e) => { + isScrolling = true; + startY = e.clientY; + currentY = startY; + velocityY = 0; + lastTimestamp = performance.now(); +}); + +element.addEventListener('mousemove', (e) => { + if (isScrolling) { + const deltaY = e.clientY - currentY; + currentY = e.clientY; + const timestamp = performance.now(); + const elapsed = timestamp - lastTimestamp; + lastTimestamp = timestamp; + velocityY = deltaY / elapsed; + + // Update the scroll position based on deltaY + element.scrollTop += deltaY; + } +}); + +element.addEventListener('mouseup', () => { + isScrolling = false; + // Apply the kinetic scrolling effect based on the velocityY + const animationFrame = () => { + if (Math.abs(velocityY) > 0.1) { + element.scrollTop += velocityY; + velocityY *= 0.95; // Damping factor + requestAnimationFrame(animationFrame); + } + }; + requestAnimationFrame(animationFrame); +}); + +element.addEventListener('mouseleave', () => { + isScrolling = false; +}); + +element.addEventListener('wheel', (e) => { + // You can also handle mouse wheel events for kinetic scrolling + // Adjust the scrollTop based on e.deltaY + element.scrollTop += e.deltaY; +}); // @license-end +