Element to have the panoramic background. In this case a full page wrapper. (Using it this way is very resource intensive.)
Keyframes to make the background scroll:
- Code:
#wrapper {
position:absolute;
top:0px;
height:100vh;
width:100vw;
overflow:hidden;
background-image:url('images/panorama.png');
background-repeat:repeat-x;
background-attachment:fixed;
background-position:0px 0px;
// Name of the key-frames used and the number of iterations.
animation: panorama infinite;
-webkit-animation: panorama infinite;
// Duration of the animation, used to control the speed.
animation-duration: 296.999s;
-webkit-animation-duration: 296.999s;
// Ensures the animation is seamless. (If the image is seamless that is.)
animation-timing-function: linear;
-webkit-animation-timing-function: linear;
}
Keyframes to make the background scroll:
- Code:
@keyframes panorama {
from {background-position: 0}
to {background-position: -8192px}
}
@-webkit-keyframes panorama {
from {background-position: 0}
to {background-position: -8192px}
}
Last edited by Bricyn on Thu Feb 19, 2015 12:37 am; edited 1 time in total