>_htmlhub
library/particles & systems/digital-dust-motes

Digital Dust

Live previewPerformance varies by device
digital-dust-motes.html

No account needed to copy or download. Check dependencies and thelicense status before publishing.

<!DOCTYPE html>
<html>
<head>
<title>Digital Dust Motes</title>
<style>
    body, html {
        margin: 0;
        padding: 0;
        height: 100%;
        width: 100%;
        overflow: hidden;
        background-color: #222222;
    }
    .scene {
        position: relative;
        width: 100%;
        height: 100%;
        perspective: 300px;
        font-family: 'Courier New', Courier, monospace;
        color: #666;
    }
    .binary-char {
        position: absolute;
        text-shadow: 0 0 6px rgba(190, 210, 255, 0.9), 0 0 14px rgba(150, 180, 255, 0.55);
        will-change: transform, opacity;
        animation-name: float;
        animation-duration: 10s;
        animation-timing-function: ease-in-out;
        animation-iteration-count: infinite;
        animation-direction: alternate;
    }
    @media (prefers-reduced-motion: reduce) {
        .binary-char { animation: none; }
    }
    @keyframes float {
        0% {
            transform: translateY(15px) rotateX(0deg);
            opacity: var(--start-opacity);
        }
        100% {
            transform: translateY(-15px) rotateX(5deg);
            opacity: var(--end-opacity);
        }
    }
</style>
</head>
<body>
    <div class="scene" id="scene"></div>
    <script>
        const scene = document.getElementById('scene');
        const charCount = 150;
        for (let i = 0; i < charCount; i++) {
            const char = document.createElement('div');
            char.className = 'binary-char';
            char.textContent = Math.random() > 0.5 ? '1' : '0';
            const zPos = (Math.random() * 400) - 200; // -200px to 200px
            const scale = (400 - (zPos + 200)) / 400; // Scale based on Z for depth
            char.style.setProperty('--start-opacity', 0.4 + Math.random() * 0.5);
            char.style.setProperty('--end-opacity', 0.6 + Math.random() * 0.4);
            char.style.left = `${Math.random() * 100}%`;
            char.style.top = `${Math.random() * 100}%`;
            char.style.fontSize = `${16 + scale * 20}px`;
            char.style.transform = `translateZ(${zPos}px)`;
            char.style.animationDelay = `${Math.random() * -10}s`; // Stagger start times
            char.style.color = `rgba(205, 215, 235, ${0.5 + scale * 0.5})`;
            scene.appendChild(char);
        }
    </script>
</body>
</html>

About this animation

Fine translucent dust specks float upward through angled CSS spotlight beams.

Under the hood

CSS 3D Binary Float

JavaScript creates 150 DOM
elements showing 0 or 1, placed inside a scene with CSS perspective: 300px and depth from translateZ(). Motion is purely CSS: a @keyframes float animation alternates translateY() and rotateX() over 10 seconds while opacity shifts between custom properties, with no canvas or per-frame Brownian jitter.

Source Code
Copied to clipboard