CSS animácia

Príklady kódu

17
0

CSS animácia

CSS animation properties template:
{
   animation-name: anima-name;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-delay: 2s;
    animation-direction: reverse | normal | alternate | alternate-reverse ; 
  animation-timing-function: ease | ease-out | ease-in | ease-in-out | linear | cubic-bezier(x1, y1, x2, y2) (e.g. cubic-bezier(0.5, 0.2, 0.3, 1.0)); 
  animation-fill-mode:forwards | backwards | both | none;
}
@keyframes anima-name {
  from {
   background-position:right;
  }
  to {
    background-position:left;
  }
}
@keyframes anima-name {
  0% {
    background-color: red;
  }
  50% {
    background-color: green;
  }
  100% {
    background-color: red;
  }
}
5
0

CSS animácia

<style>
@keyframes animatename{
  0%{
    transform: translateY(3px);
  }
  100%{
    transform: translateY(-3px);
  }
}
.my-div{
  animation: animatename 1s linear infinite;
  /* animation shorthand */
  animation: animation-name animation-duration animation-direction animation-iteration-count
}
</style>
3
0

CSS animácia

div{
	animation: name duration timing-function delay iteration-count 
  		direction fill-mode;
}

/* 
name: name of the animation
duration: amount of time it takes ex: 2s
timing-function: ex: linear, ease, etc.
delay: amount of time to delay from it starting
iteration-count: how many times to play the animation, ex: initial
direction: ex: forwards, backwards, alternate, alternate-reverse
fill-mode: ex: none, forwards, backwards, both
*/

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................