-
-
Save Fastidious/d0db9772ee24c2f5c9e328e3ec7e981e to your computer and use it in GitHub Desktop.
rewrite usenothing.com in plain html+js+css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Timer Page</title> | |
<style> | |
body { | |
background-color: black; | |
color: white; | |
font-family: Georgia, 'Times New Roman', Times, serif; | |
font-size: 30px; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
margin: 0; | |
} | |
#timer { | |
font-family: Georgia, 'Times New Roman', Times, monospace; | |
font-size: 48px; | |
color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<div> | |
<img width="30" height="30" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMjAwIDIwMCI+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IndoaXRlIi8+CiAgPGNpcmNsZSBjeD0iMTAwIiBjeT0iMTAwIiByPSI4MCIgZmlsbD0iYmxhY2siLz4KPC9zdmc+" alt="Black rectangle with white circle"> | |
<p style="color: gray;"> | |
Greetings, Wanderer. | |
</p> | |
<p> | |
Calm your thoughts.<br/> | |
Sink into silence.<br/> | |
And simply do nothing. | |
</p> | |
<p style="color: gray;"> | |
You've been idle for <span id="timer" >000</span> seconds. | |
</p> | |
</div> | |
<script> | |
let start = new Date(); | |
function updateTimer() { | |
const now = new Date(); | |
const elapsed = now - start; | |
const seconds = String(Math.floor(elapsed / 1000)).padStart(3, '0'); | |
document.getElementById('timer').textContent = `${seconds}`; | |
} | |
function resetTimer() { | |
start = new Date(); | |
} | |
updateTimer(); | |
setInterval(updateTimer, 1000); | |
document.addEventListener('mousemove', resetTimer); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment