Skip to content

Instantly share code, notes, and snippets.

@AuroraTea
Created October 11, 2025 14:31
Show Gist options
  • Select an option

  • Save AuroraTea/6679c7df902c1df29457260d727a84b2 to your computer and use it in GitHub Desktop.

Select an option

Save AuroraTea/6679c7df902c1df29457260d727a84b2 to your computer and use it in GitHub Desktop.
Process in URL
<!DOCTYPE html>
<body>
<script>
let timer, progress = 0
function refresh(percent) {
const s = Math.floor(percent / 10)
const f = (percent / 10) - s
let moon = 'πŸŒ•'.repeat(s)
if (s < 10) {
moon += f > 0.75 ? 'πŸŒ–' : f > 0.5 ? 'πŸŒ—' : f > 0.25 ? '🌘' : 'πŸŒ‘'
moon += 'πŸŒ‘'.repeat(9 - s)
}
history.replaceState(null, null, `${location.pathname}?${moon}-${percent}%`)
}
function start() {
if (timer) return;
progress = 0
timer = setInterval(() => (refresh(progress), progress += 2) > 100 ? clearInterval(timer) : null, 200)
}
function reset() {
clearInterval(timer)
history.replaceState(null, null, location.pathname)
}
document.body.innerHTML = `<button onclick=start()>Start</button><button onclick=reset()>Reset</button>`
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment