Animations
Ce contenu n’est pas encore disponible dans votre langue.
CSS animations allow you to create smooth and engaging visual effects on your website or web application without using JavaScript. Animations can be used to add visual interest to interactive elements like buttons and menus, or to create immersive effects like parallax scrolling and transitions between different sections of a page.
This page contains high motion elements as it demonstrates the framework animation props and classes
TL;DR
link TL;DROxyProps includes a set of premade animations that you can use to add visual interest to your website or web application. You can use these animations to add visual interest to interactive elements like buttons and menus, or to create immersive effects like parallax scrolling and transitions between different sections of a page.
Here is the list of available animations CSS variables and utility classes. If you want to learn more about CSS animations, and see samples of how to use them, read on.
Blink
link BlinkBase
Hover
Active
var(--o-animation-blink)o-blinko-blink-hovero-blink-activeBounce
link BounceBase
Hover
Active
var(--o-animation-bounce)o-bounceo-bounce-hovero-bounce-activeFade-in
link Fade-inBase
Hover
Active
var(--o-animation-fade-in)o-fade-ino-fade-in-hovero-fade-in-activeFade In Bloom
link Fade In BloomBase
Hover
Active
var(--o-animation-fade-in-bloom)o-fade-in-bloomo-fade-in-bloom-hovero-fade-in-bloom-activeFade Out
link Fade OutBase
Hover
Active
var(--o-animation-fade-out)o-fade-outo-fade-out-hovero-fade-out-activeFade Out Bloom
link Fade Out BloomBase
Hover
Active
var(--o-animation-fade-out-bloom)o-fade-out-bloomo-fade-out-bloom-hovero-fade-out-bloom-activeFloat
link FloatBase
Hover
Active
var(--o-animation-float)o-floato-float-hovero-float-activePing
link PingBase
Hover
Active
var(--o-animation-ping)o-pingo-ping-hovero-ping-activePulse
link PulseBase
Hover
Active
var(--o-animation-pulse)o-pulseo-pulse-hovero-pulse-activeScale Down
link Scale DownBase
Hover
Active
var(--o-animation-scale-down)o-scale-downo-scale-down-hovero-scale-down-activeScale Up
link Scale UpBase
Hover
Active
var(--o-animation-scale-up)o-scale-upo-scale-up-hovero-scale-up-activeShake X
link Shake XBase
Hover
Active
var(--o-animation-shake-x)o-shake-xo-shake-x-hovero-shake-x-activeShake Y
link Shake YBase
Hover
Active
var(--o-animation-shake-y)o-shake-yo-shake-y-hovero-shake-y-activeSlide In Down
link Slide In DownBase
Hover
Active
var(--o-animation-slide-in-down)o-slide-in-downo-slide-in-down-hovero-slide-in-down-activeSlide In Left
link Slide In LeftBase
Hover
Active
var(--o-animation-slide-in-left)o-slide-in-lefto-slide-in-left-hovero-slide-in-left-activeSlide In Right
link Slide In RightBase
Hover
Active
var(--o-animation-slide-in-right)o-slide-in-righto-slide-in-right-hovero-slide-in-right-activeSlide In Up
link Slide In UpBase
Hover
Active
var(--o-animation-slide-in-up)o-slide-in-upo-slide-in-up-hovero-slide-in-up-activeSlide Out Down
link Slide Out DownBase
Hover
Active
var(--o-animation-slide-out-down)o-slide-out-downo-slide-out-down-hovero-slide-out-down-activeSlide Out Left
link Slide Out LeftBase
Hover
Active
var(--o-animation-slide-out-left)o-slide-out-lefto-slide-out-left-hovero-slide-out-left-activeSlide Out Right
link Slide Out RightBase
Hover
Active
var(--o-animation-slide-out-right)o-slide-out-righto-slide-out-right-hovero-slide-out-right-activeSpin
link SpinBase
Hover
Active
var(--o-animation-spin)o-spino-spin-hovero-spin-activeIntroduction to CSS Animations
link Introduction to CSS AnimationsTo create a CSS animation, we need to use the @keyframes rule to define the animation’s keyframes (or stages) and the animation property to specify the animation’s duration, timing, and other settings.
Defining Keyframes
link Defining KeyframesThe @keyframes rule allows you to define a series of keyframes that specify how the animation should change over time. Each keyframe represents a specific point in the animation, and can include properties that define the element’s style at that point.
Here’s an example of a @keyframes rule that defines a simple animation that changes an element’s opacity from 0 to 1 over a duration of 2 seconds:
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; }}In this example, we’ve named the animation fade-in and defined two keyframes: 0% and 100%. The 0% keyframe sets the element’s opacity to 0 at the beginning of the animation, while the 100% keyframe sets the opacity to 1 at the end of the animation.
Applying Animations
link Applying AnimationsOnce you’ve defined your @keyframes rule, you can apply the animation to an element using the animation property. Here’s an example of how to apply the fade-in animation we defined earlier to a <div> element:
div { animation: fade-in 2s;}In this example, we’ve set the animation property to fade-in 2s, which applies the fade-in animation we defined earlier and specifies a duration of 2 seconds.
Animation Properties
link Animation PropertiesIn addition to the @keyframes rule and the animation property, there are a number of other CSS properties that can be used to customize the behavior and appearance of CSS animations. Here are a few examples:
animation-delay: specifies a delay before the animation beginsanimation-direction: specifies whether the animation should play forwards, backwards, or alternate between forwards and backwardsanimation-timing-function: specifies the timing function used for the animation (e.g. linear, ease-in, ease-out, ease-in-out)animation-iteration-count: specifies the number of times the animation should repeat (e.g. infinite, 3)animation-fill-mode: specifies what styles should be applied to the element before and after the animation plays (e.g. forwards, backwards, both)
Conclusion
link ConclusionCSS animations are a powerful tool for adding visual interest and interactivity to your website or web application. With the @keyframes rule and the animation property, you can create smooth, engaging effects without the need for JavaScript. So why not give it a try and see what you can create!