Utvikling · verktøy

CSS-animasjonsgenerator

Velg en bevegelse, juster timingen og forhåndsvis animasjonen før du kopierer CSS-koden.

Kjøres i nettleseren. Ingen opplasting.
Preview

Om verktøyet

CSS-animasjonsgenerator sem complicação.

Forhåndsvisningen bruker CSS på denne siden. Den kjører ikke skript og laster ikke opp koden din. Ta hensyn til innstillinger for redusert bevegelse før du bruker animasjonen på et aktivt nettsted.

Veiledning

Slik bruker du CSS-animasjonsgenerator

CSS Animation Generator writes a small @keyframes block and an animation rule for a preset motion. You pick one of five effects, set the duration, delay, number of repeats and easing, watch a box play the motion, and copy the CSS. It does not make custom keyframes, run any script of yours or add support for people who prefer less motion.

Slik gjør du

  1. Choose an effect: Fade in, Slide from left, Bounce, Rotate or Pulse. The preview box plays it right away.
  2. Set the duration from 0.2 to 5 seconds, the delay from 0 to 3 seconds, the number of repetitions (1, 2, 3 or infinite) and the timing: ease, ease in, ease out, ease in-out or linear.
  3. Press Replay preview to watch it again. The CSS box shows the keyframes under the name usefulverse-motion and a rule for the class .my-element.
  4. Press Copy CSS and paste it into your stylesheet. Rename the keyframes or the class if you like, and read the notes below about delay and reduced motion.

Eksempler

The default fade

Du skriver inn
Effekt
Fade in
Varighet
0.8
Forsinkelse
0
Gjentakelser
1
Tidsfunksjon
ease
Du får
CSS
@keyframes usefulverse-motion { from { opacity:0; } to { opacity:1; } } .my-element { animation: usefulverse-motion 0.8s ease 0s 1; }

The fade moves opacity from 0 to 1. The shorthand reads name, duration, timing, delay and repeat count in that order, so the 0.8s is the duration and the 0s is the delay.

Kjørt med verktøyets egen kode.

An endless bounce with a delay

Du skriver inn
Effekt
Bounce
Varighet
1.5
Forsinkelse
0.5
Gjentakelser
Infinite
Tidsfunksjon
ease-out
Du får
CSS
@keyframes usefulverse-motion { 0% { transform:translateY(-18px); } 65% { transform:translateY(5px); } 100% { transform:translateY(0); } } .my-element { animation: usefulverse-motion 1.5s ease-out 0.5s infinite; }

The element starts 18 pixels up, dips 5 pixels below its place at 65% of the time and settles at 0. Because the repeat count is infinite, the whole 1.5 s run loops forever after the half-second wait.

Kjørt med verktøyets egen kode.

The slowest, longest setting

Du skriver inn
Effekt
Rotate
Varighet
5
Forsinkelse
3
Gjentakelser
3
Tidsfunksjon
linear
Du får
CSS
@keyframes usefulverse-motion { from { transform:rotate(-12deg); } to { transform:rotate(0deg); } } .my-element { animation: usefulverse-motion 5s linear 3s 3; }

Five seconds and a three-second delay are the top of the allowed ranges. Three repeats of a five-second run take 15 seconds, and the first starts after 3 seconds.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Add a gentle entrance to a card, banner or button on a web page.
  • Draw attention to a small badge with a short pulse.
  • Learn how duration, delay, repeat count and easing change a CSS animation.
  • Get a clean starting rule and keyframes to adapt in your own stylesheet.

Begrensninger

  • There are five fixed motions. You cannot edit keyframe steps, add colours or combine two effects.
  • Duration runs from 0.2 to 5 seconds and delay from 0 to 3 seconds. Repeats are 1, 2, 3 or infinite.
  • The copied CSS has no animation-fill-mode. The preview box holds its first and last frame, so with a delay the live element may look different from the preview until the animation starts or after it ends.
  • The CSS includes no prefers-reduced-motion rule. You must add your own for people who ask their device for less motion.
  • The class name .my-element and the keyframes name usefulverse-motion are fixed in the output.

Tips

  • Add animation-fill-mode: both to your rule if you want the first frame shown during the delay and the last frame kept after the end.
  • Wrap your animation in a prefers-reduced-motion check, or switch it off for visitors who ask for it.
  • Avoid infinite motion on large areas of a page, since it can distract and tire some readers.

Kilder

Vanlige spørsmål

Sobre CSS-animasjonsgenerator.

What does the animation shorthand contain?

The generated rule gives, in order, the keyframes name, the duration, the timing function, the delay and the iteration count. All are standard values of the CSS animation property, which you can also write as separate properties if you like.

Why does my live element behave differently from the preview?

The preview box uses a fill mode that keeps the first and last frames. The copied rule does not add one. With a delay, the real element shows its normal look until the animation begins, and after the end it returns to its normal look.

How do I respect people who want less motion?

Add a prefers-reduced-motion media query that turns the animation off or shortens it. The generator does not write one. Moving or flashing content that starts on its own and lasts over five seconds should also be easy to pause or hide.

Can I change the class or keyframes name?

Yes, after you copy it. Rename .my-element to your own class and rename usefulverse-motion in both places, the @keyframes line and the animation rule. The names in the output are only placeholders.

What do the timing options mean?

They set how speed changes. Ease starts slow, speeds up and slows down. Ease in starts slowly, ease out ends slowly, ease in-out does both, and linear keeps a steady speed throughout the run.

Does the tool run my CSS or upload it?

The preview uses CSS that is already on the page, and the tool does not take your own code. Nothing you choose is sent anywhere. The Copy button uses your browser's clipboard, and if that is blocked you can select the text yourself.

Which browsers support this CSS?

CSS animations and the @keyframes rule are supported in current major browsers. Check the compatibility tables on MDN for the exact properties if you must support very old browsers.

Hvordan bruker du CSS-animasjonsgenerator?

Velg en bevegelse, juster timingen og forhåndsvis animasjonen før du kopierer CSS-koden.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.