UNPKG

@hellouxpavel/cssanimation

Version:

A Powerful CSS Animation Library for Advanced Motion Design.

126 lines (104 loc) 2.54 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: Playful * Filename: ca__Playful.ca__fx-css */ .ca__fx-snapGridEntry { animation-name: snapGridEntry; animation-timing-function: cubic-bezier(0.ca__fx-3, 1.ca__fx-5, 0.ca__fx-5, 1); transform-origin: center; will-change: transform, opacity; } @keyframes snapGridEntry { 0% { transform: scale(0.ca__fx-5) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0deg); opacity: 1; } } .ca__fx-snapGridExit { animation-name: snapGridExit; animation-timing-function: ease-in; transform-origin: center; will-change: transform, opacity; } @keyframes snapGridExit { 0% { transform: scale(1) rotate(0deg); opacity: 1; } 100% { transform: scale(0.ca__fx-3) rotate(15deg); opacity: 0; } } .ca__fx-bounceInWaddle { animation-name: bounceInWaddle; animation-timing-function: ease-out; transform-origin: bottom center; will-change: transform, opacity; } @keyframes bounceInWaddle { 0% { transform: translateY(100%) rotate(-25deg); opacity: 0; } 40% { transform: translateY(-10%) rotate(15deg); opacity: 1; } 70% { transform: translateY(3%) rotate(-8deg); } 100% { transform: translateY(0%) rotate(0deg); } } .ca__fx-bounceOutWaddle { animation-name: bounceOutWaddle; animation-timing-function: ease-in; transform-origin: bottom center; will-change: transform, opacity; } @keyframes bounceOutWaddle { 0% { transform: translateY(0%) rotate(0deg); opacity: 1; } 30% { transform: rotate(10deg); } 100% { transform: translateY(120%) rotate(-20deg); opacity: 0; } }