Created
October 11, 2025 14:31
-
-
Save AuroraTea/6679c7df902c1df29457260d727a84b2 to your computer and use it in GitHub Desktop.
Process in URL
This file contains hidden or 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> | |
| <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