Skip to content

Instantly share code, notes, and snippets.

@nextab
Created March 29, 2022 16:04
Show Gist options
  • Save nextab/fd931d1eea163d67ca3d13506118ec91 to your computer and use it in GitHub Desktop.
Save nextab/fd931d1eea163d67ca3d13506118ec91 to your computer and use it in GitHub Desktop.
Dieser CSS Code erlaubt es, ein Hintergrundbild per "Ken Burns Effekt" näher kommen zu lassen.
/* #region KenBurns Effect */
.et_pb_section.ken-burns .et_parallax_bg {
animation: kenburns-with-pause 60s alternate infinite;
}
@keyframes kenburns {
0% {
-ms-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
-webkit-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
animation-timing-function: linear;
}
100% {
-ms-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
-webkit-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
}
}
@keyframes kenburns-with-pause {
0% {
-ms-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
-webkit-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
animation-timing-function: linear;
}
5% {
-ms-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
-webkit-transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
transform: scale3d(1.45, 1.45, 1.45) translate3d(-25px, -55px, 0px);
animation-timing-function: linear;
}
95% {
-ms-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
-webkit-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
}
100% {
-ms-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
-webkit-transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
transform: scale3d(1.05, 1.05, 1.05) translate3d(-15px, 0px, 0px);
}
}
/* #endregion */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment