Jump to content

CSS Parallax

Recommended Posts

Site URL: https://www.kevinwalton.ca

Need help coding this to my website. 

 

I have been trying for 6 hours but I cannot figure this out. Trying to add this to photos with the class:

 .sqs-block-image

https://codepen.io/fusco/pen/IfsAa

 

@import url(https://fonts.googleapis.com/css?family=Montserrat:700);
body{
  text-align:center;
  padding:0;
  margin:0;
  font-family: 'Montserrat', sans-serif;
  background-color:#111;
}
.parallax {
  padding:0px;
  perspective: 1px;
  height: 100vh;
  font-size:40px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-perspective: 1px;
  perspective: 1px;
}

.content{
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  opacity:.7;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 100vh 0;
}

.base {
  transform: translateZ(-2px) scale(3);
  color:#FFF;
}

.closer {
  transform: translateZ(-1px) scale(2);
  font-size:300%;
  color:#BF55EC;
}

.closest {
  transform: translateZ(0);
  color:#19B5FE;
  font-size:700%;
}

 

Edited by KevinWalton
Link to comment
  • Replies 0
  • Views 757
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.