Skip to content
The Chat Archive
claude-opus-4-20250514-thinking-16k· Anthropic LMArena Human Preference 140K

Code a website (html, css, js all in one) that teaches you about all the planets in the…

  1. User

    Code a website (html, css, js all in one) that teaches you about all the planets in the solar system that are 3d. I want the user to be able to scroll from left to right, first to last. You may include the Sun at the very left if you want. Make it have a nice black and white, concise UI.

  2. Assistant

    I'll create an interactive 3D solar system website with horizontal scrolling. Here's the complete code:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>3D Solar System Explorer</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }
    
            body {
                background: #000;
                color: #fff;
                font-family: 'Arial', sans-serif;
                overflow-x: hidden;
                overflow-y: hidden;
                cursor: grab;
            }
    
            body:active {
                cursor: grabbing;
            }
    
            .container {
                display: flex;
                height: 100vh;
                transition: transform 0.3s ease;
                will-change: transform;
            }
    
            .celestial-body {
                flex: 0 0 100vw;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                position: relative;
                perspective: 1000px;
            }
    
            .planet-container {
                width: 300px;
                height: 300px;
                position: relative;
                transform-style: preserve-3d;
                animation: rotate 20s linear infinite;
                margin-bottom: 50px;
            }
    
            @keyframes rotate {
                from { transform: rotateY(0deg); }
                to { transform: rotateY(360deg); }
            }
    
            .planet {
                width: 100%;
                height: 100%;
                position: absolute;
                border-radius: 50%;
                background: radial-gradient(circle at 30% 30%, #fff, #666, #111);
                box-shadow: 
                    inset -20px -20px 40px rgba(0,0,0,0.8),
                    0 0 50px rgba(255,255,255,0.2);
            }
    
            .sun .planet {
                background: radial-gradient(circle at 30% 30%, #fff, #ccc, #888);
                box-shadow: 
                    0 0 100px rgba(255,255,255,0.8),
                    0 0 200px rgba(255,255,255,0.4);
                animation: pulse 3s ease-in-out infinite;
            }
    
            @keyframes pulse {
                0%, 100% { transform: scale(1); }
                50% { transform: scale(1.05); }
            }
    
            .info {
                text-align: center;
                max-width: 600px;
                padding: 0 20px;
            }
    
            h1 {
                font-size: 3em;
                margin-bottom: 20px;
                font-weight: 300;
                letter-spacing: 2px;
            }
    
            .stats {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
                margin: 30px 0;
                padding: 20px;
                border: 1px solid #333;
                border-radius: 10px;
            }
    
            .stat {
                text-align: left;
            }
    
            .stat-label {
                font-size: 0.8em;
                color: #888;
                text-transform: uppercase;
                letter-spacing: 1px;
            }
    
            .stat-value {
                font-size: 1.2em;
                margin-top: 5px;
            }
    
            .description {
                line-height: 1.6;
                color: #ccc;
                margin-top: 20px;
            }
    
            .nav {
                position: fixed;
                bottom: 30px;
                left: 50%;
                transform: translateX(-50%);
                display: flex;
                gap: 10px;
                z-index: 100;
            }
    
            .nav-dot {
                width: 10px;
                height: 10px;
                border-radius: 50%;
                border: 1px solid #fff;
                background: transparent;
                cursor: pointer;
                transition: all 0.3s;
            }
    
            .nav-dot.active {
                background: #fff;
                transform: scale(1.5);
            }
    
            .instructions {
                position: fixed;
                top: 20px;
                left: 50%;
                transform: translateX(-50%);
                font-size: 0.9em;
                color: #666;
                text-align: center;
            }
    
            .rings {
                position: absolute;
                width: 140%;
                height: 30px;
                border: 2px solid #666;
                border-radius: 50%;
                transform: rotateX(80deg);
                opacity: 0.6;
            }
    
            .saturn .rings {
                display: block;
            }
    
            .rings {
                display: none;
            }
    
            /* Planet-specific styles */
            .mercury .planet { transform: scale(0.4); }
            .venus .planet { transform: scale(0.8); }
            .earth .planet { transform: scale(0.8); }
            .mars .planet { transform: scale(0.5); }
            .jupiter .planet { transform: scale(1.2); }
            .saturn .planet { transform: scale(1.1); }
            .uranus .planet { transform: scale(0.9); }
            .neptune .planet { transform: scale(0.9); }
        </style>
    </head>
    <body>
        <div class="instructions">Drag or use arrow keys to explore • Click dots to navigate</div>
        
        <div class="container" id="container">
            <!-- Sun -->
            <div class="celestial-body sun">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>THE SUN</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Type</div>
                            <div class="stat-value">G-type Star</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Diameter</div>
                            <div class="stat-value">1.39 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Temperature</div>
                            <div class="stat-value">5,500°C surface</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Age</div>
                            <div class="stat-value">4.6 billion years</div>
                        </div>
                    </div>
                    <p class="description">
                        The Sun is the heart of our solar system, a massive ball of hot plasma held together by gravity. It contains 99.86% of the system's mass and provides the energy that sustains life on Earth.
                    </p>
                </div>
            </div>
    
            <!-- Mercury -->
            <div class="celestial-body mercury">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>MERCURY</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">57.9 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">59 Earth days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">88 Earth days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Moons</div>
                            <div class="stat-value">0</div>
                        </div>
                    </div>
                    <p class="description">
                        Mercury is the smallest planet in our solar system and the closest to the Sun. Its surface is covered with craters and experiences extreme temperature variations between day and night.
                    </p>
                </div>
            </div>
    
            <!-- Venus -->
            <div class="celestial-body venus">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>VENUS</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">108.2 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">243 Earth days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">225 Earth days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Atmosphere</div>
                            <div class="stat-value">96% CO₂</div>
                        </div>
                    </div>
                    <p class="description">
                        Venus is Earth's "twin" in size but with a toxic atmosphere and surface hot enough to melt lead. It rotates backwards and has the longest day of any planet.
                    </p>
                </div>
            </div>
    
            <!-- Earth -->
            <div class="celestial-body earth">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>EARTH</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">149.6 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">24 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">365.25 days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Moons</div>
                            <div class="stat-value">1 (The Moon)</div>
                        </div>
                    </div>
                    <p class="description">
                        Earth is the only known planet with life. Its unique position in the habitable zone, liquid water, and protective atmosphere make it a cosmic oasis.
                    </p>
                </div>
            </div>
    
            <!-- Mars -->
            <div class="celestial-body mars">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>MARS</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">227.9 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">24.6 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">687 Earth days</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Moons</div>
                            <div class="stat-value">2 (Phobos, Deimos)</div>
                        </div>
                    </div>
                    <p class="description">
                        Mars, the "Red Planet," features the largest volcano and canyon in the solar system. Evidence suggests it once had liquid water and may still harbor life underground.
                    </p>
                </div>
            </div>
    
            <!-- Jupiter -->
            <div class="celestial-body jupiter">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>JUPITER</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">778.5 million km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">9.9 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">12 Earth years</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Known Moons</div>
                            <div class="stat-value">95</div>
                        </div>
                    </div>
                    <p class="description">
                        Jupiter is the largest planet in our solar system. Its Great Red Spot is a storm larger than Earth that has raged for centuries. It acts as a "vacuum cleaner," protecting inner planets from asteroids.
                    </p>
                </div>
            </div>
    
            <!-- Saturn -->
            <div class="celestial-body saturn">
                <div class="planet-container">
                    <div class="planet"></div>
                    <div class="rings"></div>
                </div>
                <div class="info">
                    <h1>SATURN</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">1.4 billion km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">10.7 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">29 Earth years</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Known Moons</div>
                            <div class="stat-value">146</div>
                        </div>
                    </div>
                    <p class="description">
                        Saturn's spectacular ring system consists of ice and rock particles. It's less dense than water and would float in a large enough ocean. Titan, its largest moon, has lakes of liquid methane.
                    </p>
                </div>
            </div>
    
            <!-- Uranus -->
            <div class="celestial-body uranus">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>URANUS</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">2.9 billion km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">17 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">84 Earth years</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Known Moons</div>
                            <div class="stat-value">28</div>
                        </div>
                    </div>
                    <p class="description">
                        Uranus rotates on its side, likely due to a massive collision. Its blue-green color comes from methane in its atmosphere. It has faint rings and experiences extreme seasons lasting 21 years each.
                    </p>
                </div>
            </div>
    
            <!-- Neptune -->
            <div class="celestial-body neptune">
                <div class="planet-container">
                    <div class="planet"></div>
                </div>
                <div class="info">
                    <h1>NEPTUNE</h1>
                    <div class="stats">
                        <div class="stat">
                            <div class="stat-label">Distance from Sun</div>
                            <div class="stat-value">4.5 billion km</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Day Length</div>
                            <div class="stat-value">16 hours</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Year Length</div>
                            <div class="stat-value">165 Earth years</div>
                        </div>
                        <div class="stat">
                            <div class="stat-label">Known Moons</div>
                            <div class="stat-value">16</div>
                        </div>
                    </div>
                    <p class="description">
                        Neptune is the windiest planet with speeds reaching 2,100 km/h. This ice giant was discovered through mathematical predictions. Its moon Triton orbits backwards and may be a captured dwarf planet.
                    </p>
                </div>
            </div>
        </div>
    
        <div class="nav" id="nav"></div>
    
        <script>
            const container = document.getElementById('container');
            const bodies = document.querySelectorAll('.celestial-body');
            const nav = document.getElementById('nav');
            let currentIndex = 0;
            let isMouseDown = false;
            let startX = 0;
            let scrollLeft = 0;
    
            // Create navigation dots
            bodies.forEach((body, index) => {
                const dot = document.createElement('div');
                dot.className = 'nav-dot';
                if (index === 0) dot.classList.add('active');
                dot.addEventListener('click', () => goToSlide(index));
                nav.appendChild(dot);
            });
    
            const dots = document.querySelectorAll('.nav-dot');
    
            function updateSlide() {
                container.style.transform = `translateX(-${currentIndex * 100}vw)`;
                dots.forEach((dot, index) => {
                    dot.classList.toggle('active', index === currentIndex);
                });
            }
    
            function goToSlide(index) {
                currentIndex = index;
                updateSlide();
            }
    
            // Mouse drag functionality
            container.addEventListener('mousedown', (e) => {
                isMouseDown = true;
                startX = e.pageX;
                scrollLeft = currentIndex * window.innerWidth;
            });
    
            container.addEventListener('mouseleave', () => {
                isMouseDown = false;
            });
    
            container.addEventListener('mouseup', () => {
                isMouseDown = false;
            });
    
            container.addEventListener('mousemove', (e) => {
                if (!isMouseDown) return;
                e.preventDefault();
                const x = e.pageX;
                const walk = (startX - x) * 2;
                
                if (Math.abs(walk) > window.innerWidth / 4) {
                    if (walk > 0 && currentIndex < bodies.length - 1) {
                        currentIndex++;
                        updateSlide();
                        isMouseDown = false;
                    } else if (walk < 0 && currentIndex > 0) {
                        currentIndex--;
                        updateSlide();
                        isMouseDown = false;
                    }
                }
            });
    
            // Touch support
            let touchStartX = 0;
            container.addEventListener('touchstart', (e) => {
                touchStartX = e.touches[0].clientX;
            });
    
            container.addEventListener('touchend', (e) => {
                const touchEndX = e.changedTouches[0].clientX;
                const diff = touchStartX - touchEndX;
                
                if (Math.abs(diff) > 50) {
                    if (diff > 0 && currentIndex < bodies.length - 1) {
                        currentIndex++;
                        updateSlide();
                    } else if (diff < 0 && currentIndex > 0) {
                        currentIndex--;
                        updateSlide();
                    }
                }
            });
    
            // Keyboard navigation
            document.addEventListener('keydown', (e) => {
                if (e.key === 'ArrowRight' && currentIndex < bodies.length - 1) {
                    currentIndex++;
                    updateSlide();
                } else if (e.key === 'ArrowLeft' && currentIndex > 0) {
                    currentIndex--;
                    updateSlide();
                }
            });
    
            // Mouse wheel horizontal scroll
            container.addEventListener('wheel', (e) => {
                e.preventDefault();
                if (e.deltaY > 0 && currentIndex < bodies.length - 1) {
                    currentIndex++;
                    updateSlide();
                } else if (e.deltaY < 0 && currentIndex > 0) {
                    currentIndex--;
                    updateSlide();
                }
            });
        </script>
    </body>
    </html>
    

    This website features:

    1. 3D rotating planets - Each planet rotates continuously with a 3D effect
    2. Horizontal scrolling - Navigate using:
      • Mouse drag
      • Arrow keys
      • Touch swipe (mobile)
      • Mouse wheel
      • Navigation dots at the bottom
    3. Black and white minimalist design - Clean UI with subtle gradients
    4. Educational content - Key facts and descriptions for each celestial body
    5. Responsive layout - Works on different screen sizes
    6. Special effects:
      • Sun has a pulsing glow effect
      • Saturn includes its iconic rings
      • Planets are sized relatively (though not to actual scale)

    The interface provides an engaging way to learn about our solar system while maintaining the requested concise, monochromatic aesthetic.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.