UNPKG

@hellouxpavel/cssanimation

Version:

A Powerful CSS Animation Library for Advanced Motion Design.

127 lines (105 loc) 2.6 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: Nature * Filename: ca__Nature.ca__fx-css */ .ca__fx-petalDrop { animation-name: petalDrop; animation-timing-function: ease-out; transform-origin: top center; will-change: transform, opacity; } @keyframes petalDrop { 0% { transform: translateY(-100%) rotateZ(15deg); opacity: 0; } 40% { transform: translateY(30%) rotateZ(-10deg); opacity: 1; } 70% { transform: translateY(90%) rotateZ(5deg); } 100% { transform: translateY(120%) rotateZ(0deg); opacity: 0; } } .ca__fx-petalLiftOut { animation-name: petalLiftOut; animation-timing-function: ease-in; transform-origin: bottom center; will-change: transform, opacity; } @keyframes petalLiftOut { 0% { transform: translateY(0%) rotateZ(0deg); opacity: 1; } 100% { transform: translateY(-100%) rotateZ(-20deg); opacity: 0; } } .ca__fx-leafFloatIn { animation-name: leafFloatIn; animation-timing-function: ease-out; transform-origin: top left; will-change: transform, opacity; } @keyframes leafFloatIn { 0% { transform: translateX(-60%) rotate(-45deg) scale(0.ca__fx-8); opacity: 0; } 50% { transform: translateX(10%) rotate(20deg) scale(1.ca__fx-05); opacity: 1; } 100% { transform: translateX(0%) rotate(0deg) scale(1); } } .ca__fx-leafFloatAway { animation-name: leafFloatAway; animation-timing-function: ease-in-out; transform-origin: center; will-change: transform, opacity; } @keyframes leafFloatAway { 0% { transform: translateX(0%) rotate(0deg) scale(1); opacity: 1; } 100% { transform: translateX(80%) rotate(45deg) scale(0.ca__fx-6); opacity: 0; } }