Skip to content
The Chat Archive
claude-3-5-haiku-20241022· Anthropic LMArena Human Preference 140K

Make a simple html+css page that scrolls like the Star Wars opening crawl using…

  1. User

    Make a simple html+css page that scrolls like the Star Wars opening crawl using perspective, transforms etc.

  2. Assistant

    I'll provide you with an HTML and CSS implementation of the Star Wars opening crawl effect. Here's a complete example:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Star Wars Opening Crawl</title>
        <style>
            body {
                background-color: black;
                height: 100vh;
                overflow: hidden;
                margin: 0;
                perspective: 400px;
                color: #feda4a;
                font-family: 'Star Wars', sans-serif;
            }
    
            .crawl-container {
                position: relative;
                height: 100vh;
                overflow: hidden;
            }
    
            .crawl {
                position: absolute;
                top: 100%;
                transform-origin: 50% 100%;
                transform: 
                    perspective(300px)
                    rotateX(45deg)
                    translateZ(0)
                    translateY(-100%);
                animation: crawl 60s linear;
            }
    
            .crawl-content {
                text-align: center;
                max-width: 600px;
                margin: 0 auto;
                padding: 2rem;
            }
    
            @keyframes crawl {
                0% {
                    top: 100%;
                    transform: 
                        perspective(300px)
                        rotateX(45deg)
                        translateZ(0)
                        translateY(-100%);
                }
                100% {
                    top: -300%;
                    transform: 
                        perspective(300px)
                        rotateX(45deg)
                        translateZ(0)
                        translateY(0);
                }
            }
    
            .logo {
                font-size: 3rem;
                margin-bottom: 2rem;
            }
        </style>
    </head>
    <body>
        <div class="crawl-container">
            <div class="crawl">
                <div class="crawl-content">
                    <div class="logo">STAR WARS</div>
                    <p>
                        Episode IV: A New Hope
                    </p>
                    <p>
                        It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.
    
                        During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station with enough power to destroy an entire planet.
    
                        Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy....
                    </p>
                </div>
            </div>
        </div>
    </body>
    </html>
    

    This implementation includes:

    1. A black background simulating space
    2. A perspective transform to create the tilted, receding text effect
    3. An animation that moves the text from bottom to top
    4. Star Wars-style yellow text
    5. A sample crawl text from Episode IV

    Key CSS techniques used:

    • perspective for 3D effect
    • transform for rotation and positioning
    • @keyframes for the scrolling animation
    • Absolute positioning to control text movement

    You can customize the text, timing, and styling as needed. The animation takes 60 seconds by default, but you can adjust the duration in the animation property.

    Note: For a more authentic feel, you might want to add the Star Wars font, which would require either downloading the font or using a web font service.

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