Star Wars in CSS

Star Wars in CSS

One of the most memorable opening credits of all time has to be the Star Wars text scrolling in a 30-45deg perspective towards the horizon. It’s a classic and it has been subject to all sorts of exercises and tutorials. I have never done anything related to this but last Friday while playing with CSS I was inspired to create the same effect for my personal site. The result is what I want to share with you today. The only thing missing is the theme music so feel free to add that to your own personal effort.

So in this little tutorial, I will walk you through the process of creating the Star Wars opening credits effect using CSS and CSS animations only. I used Javascript for other details, but the rolling text effect is just CSS.

Step 1

The first thing to do is to get the content of your HTML page. I used the content of my personal site. Basically the site contains a Header and a Section for the text. Below you an see the final HTML.

Step 2

Let’s start adding some style to the design. We need to make sure that the background is black, the font is San-Serif and that we will use 100% of the height and width. Let’s also set the perspective of our design. To do that let’s add “-webkit-perspective:300” to the “section” tag.

Step 3

Now let’s add the text. I enclosed the text in a “article” tag and used “P” tag for each paragraph. To make the text fly in that perspective we will rotate the “article” tag. Then we can move the paragraphs in the Y position via “translate”. Here’s the CSS.

Step 4

To move the text off the screen we will use “TranslateY” for the paragraphs.

Step 5

Now let’s create the animation. Below you can see the code, it’s basically moving the paragraphs in the Y axis from the bottom to the top of the screen.

Step 6

With the Keyframe animation creaed, we will have just to assign it to the element we want to animate. In our case, the “article p” or the paragraphs inside the “article” tag. The animation will last 70 seconds, and it will have a 3s delay. The timing function will be linear so it animates at the same speed from the start to end.

Conclusion

The animation is done, now you can add more elements in your composition, like stars or your logo. Below you can see the final result and you can also download the files if you want to tweak it.

Demo – Save from the browser to download it

Posted in Blog | Comments Off on Star Wars in CSS

Daily Inspiration #1451

Daily Inspiration #1451

This post is part of our daily series of posts showing the most inspiring images selected by some of the Abduzeedo’s writers and users. If you want to participate and share your graphic design inspiration, You can submit your images and inspiration to RAWZ via http://raw.abduzeedo.com and don’t forget to send your Abduzeedo username; or via Twitter sending to http://twitter.com/abduzeedo

Do you want to see all images from all Daily Inspirations? Check out http://daily.abduzeedo.com

AoiroStudio

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

DesignYouTrust

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Fabio

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Fabiano

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Send your suggestions via Twitter to http://twitter.com/abduzeedo using #abdz in the end of the tweet.

@Daniel_Nelson

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

@Let_Me_Be_Inspired

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Send your RAWZ suggestions via Raw.Abduzeedo.com

angelalejandro

Digital art selected for the Daily Inspiration #1451

artistodesignz

Digital art selected for the Daily Inspiration #1451

benderbreakfast

Digital art selected for the Daily Inspiration #1451

Big.O.tee

Digital art selected for the Daily Inspiration #1451

cjwho

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Cody Petts

Digital art selected for the Daily Inspiration #1451

cuded

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Dieter Abrahams

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Drew Schmidt

Digital art selected for the Daily Inspiration #1451

Eder Deó

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

fafranca

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

freeyorker

Digital art selected for the Daily Inspiration #1451

José Pineda

Digital art selected for the Daily Inspiration #1451

kadoen

Digital art selected for the Daily Inspiration #1451

lucabis

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

Lucas Canto

Digital art selected for the Daily Inspiration #1451

Mark Watson

Digital art selected for the Daily Inspiration #1451

nd80

Digital art selected for the Daily Inspiration #1451

Odinio

Digital art selected for the Daily Inspiration #1451

Ophand Albana

Digital art selected for the Daily Inspiration #1451

Paulo Ledesma

Digital art selected for the Daily Inspiration #1451

photohab

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

rek

Digital art selected for the Daily Inspiration #1451

Riccardo zulato

Digital art selected for the Daily Inspiration #1451

smashingshare

Digital art selected for the Daily Inspiration #1451

Stefan Asafti

Digital art selected for the Daily Inspiration #1451

sumajoo

Digital art selected for the Daily Inspiration #1451

thegadgetflowblog

Digital art selected for the Daily Inspiration #1451

Digital art selected for the Daily Inspiration #1451

timoknorr

Digital art selected for the Daily Inspiration #1451

thisistheroach

Digital art selected for the Daily Inspiration #1451

Posted in Blog | Comments Off on Daily Inspiration #1451