Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Created November 11, 2021 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriskowal/8d6362e901a76eb20157c181b69a4337 to your computer and use it in GitHub Desktop.
Save kriskowal/8d6362e901a76eb20157c181b69a4337 to your computer and use it in GitHub Desktop.
<!doctype html>
<head>
<style>
* {
font-family: Helvetica;
font-size: 180px;
}
body {
padding: 50px;
}
hr {
border: solid 10px black;
margin: 100px 0;
}
</style>
<script>
let scrolling = false;
const scroll = () => {
if (scrolling) {
window.document.documentElement.scrollTop += 5;
}
requestAnimationFrame(scroll);
};
scroll();
window.onkeypress = event => {
if (event.key === ' ') {
event.preventDefault();
event.stopPropagation();
scrolling = !scrolling
}
};
</script>
</head>
<body>
Hi.
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment