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…
- User
Make a simple html+css page that scrolls like the Star Wars opening crawl using perspective, transforms etc.
- 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:
- A black background simulating space
- A perspective transform to create the tilted, receding text effect
- An animation that moves the text from bottom to top
- Star Wars-style yellow text
- A sample crawl text from Episode IV
Key CSS techniques used:
perspectivefor 3D effecttransformfor rotation and positioning@keyframesfor 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
animationproperty.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.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.