UNPKG

@hellouxpavel/cssanimation

Version:

A Powerful CSS Animation Library for Advanced Motion Design.

142 lines (113 loc) 2.71 kB
.cssanimation { animation-duration: var(--cssanimation-duration, 1s); animation-fill-mode: var(--cssanimation-fill-mode, both); } .cssanimation span { display: var(--cssanimation-display, inline-block); } .infinite { animation-iteration-count: var(--cssanimation-infinite, infinite) !important; } @media (prefers-reduced-motion: reduce) { .cssanimation, .cssanimation span { animation: none !important; transition: none !important; } } :root { --cssanimation-duration: 1s; --cssanimation-fill-mode: both; --cssanimation-infinite: infinite; --cssanimation-backface-visibility: hidden; --cssanimation-transform-style: preserve-3d; --cssanimation-will-change: transform, opacity; --cssanimation-display: inline-block; --move-distance: -800px; } /** * Module: Rotation * Filename: ca__Rotation.ca__fx-css */ .ca__fx-rotate { animation-name: rotate; animation-timing-function: ease-in-out; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .ca__fx-rotateX { animation-name: rotateX; } @keyframes rotateX { from { transform: perspective(600px) rotateX(0deg); } to { transform: perspective(600px) rotateX(90deg); } } .ca__fx-rotateXIn { animation-name: rotateXIn; } @keyframes rotateXIn { 0% { transform: perspective(600px) translate3d(0, -60px, -2000px) rotateX(75deg); opacity: 0; } 5% { transform: perspective(600px) translate3d(0, -60px, -1500px) rotateX(75deg); } } .ca__fx-rotateXOut { animation-name: rotateXOut; } @keyframes rotateXOut { 95% { transform: perspective(600px) translate3d(0, -60px, -1500px) rotateX(75deg); } 100% { transform: perspective(600px) translate3d(0, -60px, -2000px) rotateX(75deg); opacity: 0; } } .ca__fx-rotateY { animation-name: rotateY; } @keyframes rotateY { from { transform: perspective(600px) rotateY(0deg); } to { transform: perspective(600px) rotateY(90deg); } } .ca__fx-rotateYIn { animation-name: rotateYIn; } @keyframes rotateYIn { 0% { transform: perspective(600px) translate3d(0, -60px, -2000px) rotateY(75deg); opacity: 0; } 5% { transform: perspective(600px) translate3d(0, -60px, -1500px) rotateY(75deg); } } .ca__fx-rotateYOut { animation-name: rotateYOut; } @keyframes rotateYOut { 95% { transform: perspective(600px) translate3d(0, -60px, -1500px) rotateY(75deg); } 100% { transform: perspective(600px) translate3d(0, -60px, -2000px) rotateY(75deg); opacity: 0; } }