Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Felaviol authored Oct 30, 2024
1 parent b9fda34 commit 3470981
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
}

.scrollable-container {
height: 500px;
height: 75vh;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
width: 100%;
}

.scrollable {
height: 500px;
height: 75vh;
background: linear-gradient(180deg,
rgba(255,0,0,1) 0%, rgba(255,154,0,1) 16.6%, rgba(208,222,33,1) 33.3%,
rgba(79,220,74,1) 50%, rgba(63,218,216,1) 66.6%, rgba(47,201,226,1) 83.3%,
Expand Down Expand Up @@ -50,7 +50,7 @@
<div class="scrollable"></div>
</div>

<div id="rollingNumber">0 m</div>
<div id="rollingNumber">0 px</div>

<div id="controls">
<label for="timeLimit">Enter time limit (seconds): </label>
Expand Down Expand Up @@ -90,7 +90,7 @@
setTimeout(() => {
container.style.overflowY = 'hidden';
isRaceStarted = false;
result.textContent = `Scrolled Distance: ${(totalScrolledDistance / 100).toFixed(2)} m`;
result.textContent = `Scrolled Distance: ${totalScrolledDistance} px`;
}, timeLimit * 1000);
}
}, 1000);
Expand All @@ -106,7 +106,7 @@
}

previousScrollTop = currentScroll;
rollingNumber.textContent = `${(totalScrolledDistance / 100).toFixed(2)} m`;
rollingNumber.textContent = `${totalScrolledDistance} px`;

if (currentScroll >= maxScroll) {
container.scrollTop = 0;
Expand Down

0 comments on commit 3470981

Please sign in to comment.