Skip to content

Instantly share code, notes, and snippets.

@xiupos
Last active February 22, 2026 01:57
Show Gist options
  • Select an option

  • Save xiupos/a6e6523be4a7772bd43333bbe504bfd0 to your computer and use it in GitHub Desktop.

Select an option

Save xiupos/a6e6523be4a7772bd43333bbe504bfd0 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cloud Chamber in Browser</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/javascript.min.js"></script>
<script>
hljs.highlightAll();
</script>
</head>
<body>
<header>
<h1>
<a href="https://en.wikipedia.org/wiki/Cloud_chamber">Cloud Chamber</a>
in Browser
</h1>
</header>
<main>
<p>Now detecting...</p>
<pre><code class="language-javascript">const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
(async () => {
while (true) await sleep(1);
alert("Cosmic rays detected!");
})();</code></pre>
</main>
<footer>
<p>
Inspired by
<a href="https://honi.club/notes/agvmjt5vbk">@ThinaticSystem's post</a>;
Built with <a href="https://highlightjs.org/">highlight.js</a> and
<a href="https://picocss.com/">Pico.css</a>;
<a
href="https://gist.github.com/xiupos/a6e6523be4a7772bd43333bbe504bfd0"
>Source Code</a
>
</p>
</footer>
<script defer>
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
(async () => {
while (true) await sleep(1);
alert("Cosmic rays detected!");
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment