Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Sign in to follow this  
Rss Bot

How to create a layered parallax effect on your site

Recommended Posts

Parallax motion, the concept of moving layers at different speeds, has been used for years in animation. The official website of Bear Grylls (one of our favourite parallax scrolling sites), takes the effect in new and interesting directions. The background mountains scale down into position, while fading up so that they become fully opaque, and in the background of the page, the text ‘adventure’ rises up into place behind the mountains as it fades in.

For more inspiring motion effects, check out our guide to the best CSS animations and how to code them.

The Bear Grylls site design is the work of UK creative marketing agency Outpost, and with a target audience ranging from 16 to 55 years of age, and over 7 million followers worldwide, they had a serious task on their hands. 

"The main feature of the website was the homepage; we wanted visitors to literally jump into the screen and join Bear on his adventures," explain co-founder Chris Wilcock and creative director Dan Williams. "To achieve this, we utilised some clever transitions, coupled with edited videos, dramatic imagery and the overall language on the site."

See the site in action at www.beargrylls.com. In this article, we'll explain how to recreate the effect on your own sites. Start by downloading the tutorial files

01. Create the scaling effect

The structure to allow all of the animating content to work is relatively simple. A wrapper holds everything, and hides any overflow content. Then there are essentially three layers of div tags over the top.

02. Start the CSS

To make the design, the background gradient image will be added to the body and set to fill the size of screen. The wrapper holds all of the layers, and the overflow for content is hidden so that scaling effects can be applied.

03. Position each layer

The next code ensures that each layer is positioned absolutely, one over the other, inside the wrapper. The size of this fills the viewport width and height so the images fill the screen.

04. Add the text

The text class really just adds the right image, and sets its start position before animating it into place using the moveUp keyframes that will be added in the final step.

05. Animate the first mountain

The first mountain is the one further away from the screen, and this will get a small scaling that will be animated. The opacity of all the layers is also set low so that they appear in place. 

06. Animate the foreground mountain

The mountain for the foreground is almost identical to the other mountain — it just does much more of a scale into place. Both mountains share the ‘scaler’ keyframes for their animation.

07. Add keyframe animation

The keyframes are now created that specifies that. at the end state of the movement, this end state will be held in place. The text is moved up, and the mountains are scaled down, to fit into the design.

generate CSS

Pick up a ticket to Generate CSS now for a big discount

This article was originally published in issue 289 of Web Designer on sale now. Subscribe here.

Read more:

View the full article

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×