added scrolling completely
This commit is contained in:
parent
724f824a8f
commit
4753b0b421
@ -16,5 +16,28 @@
|
|||||||
</div>
|
</div>
|
||||||
<input name="q" type="text" class="grid-item" class="search" placeholder="Search DuckDuckGo :3 :3 :3" />
|
<input name="q" type="text" class="grid-item" class="search" placeholder="Search DuckDuckGo :3 :3 :3" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const marqueeElement = document.body;
|
||||||
|
let position = 0;
|
||||||
|
const speed = 1; // Adjust speed here (lower is slower)
|
||||||
|
|
||||||
|
function animateMarquee() {
|
||||||
|
position -= speed;
|
||||||
|
|
||||||
|
// Reset position when the image has scrolled completely
|
||||||
|
if (Math.abs(position) >= marqueeElement.offsetWidth) {
|
||||||
|
position = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
marqueeElement.style.backgroundPosition = `${position}px 0`;
|
||||||
|
requestAnimationFrame(animateMarquee);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the animation
|
||||||
|
animateMarquee();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user