Animasi css mengubah konten teks codepen

Properti animation-direction_ menentukan apakah animasi harus diputar maju, mundur, atau dalam siklus bergantian

Nilai default. normalDiwariskan. noAnimatable. Tidak. Baca tentang animatableVersion. Sintaks CSS3JavaScript. obyek. gaya. animationDirection="reverse" Cobalah


Dukungan Peramban

Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti

Angka diikuti dengan -webkit-, -moz-, atau -o- tentukan versi pertama yang berfungsi dengan awalan

Propertyanimation-direction43. 0
4. 0 -webkit-10. 016. 0
5. 0 -moz-9. 0
4. 0 -webkit-30. 0
15. 0 -webkit-
12. 0 -o-



Sintaks CSS

animasi-arah. normal. membalik. bergantian. alternatif-mundur. awal. mewarisi;

Nilai properti

ValueDescriptionDemonormalNilai default. Animasi diputar seperti biasa (maju)Mainkan »mundurAnimasi diputar mundur (mundur)Mainkan »bergantianAnimasi diputar maju dulu, lalu mundurMainkan »bergantian-mundurAnimasi diputar mundur dulu, lalu majuMainkan »set awal . Baca tentang initialinheritInherits properti ini dari elemen induknya. Baca tentang mewarisi

Properti CSS singkatan

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0 menerapkan animasi di antara gaya. Ini adalah singkatan untuk
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

1,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

2,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

3,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

4,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

5,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

6,
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

7, dan
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

8

Deskripsi tentang properti mana yang dapat dianimasikan tersedia;

Properti ini adalah singkatan dari properti CSS berikut

  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _4
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _6
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _2
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _7
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    5
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _1
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _8
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _3

/* @keyframes duration | easing-function | delay |
iteration-count | direction | fill-mode | play-state | name */
animation: 3s ease-in 1s 2 reverse both paused slidein;

/* @keyframes duration | easing-function | delay | name */
animation: 3s linear 1s slidein;

/* two animations */
animation: 3s linear slidein, 3s ease-out 5s slideout;

Properti

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0 ditetapkan sebagai satu atau beberapa animasi tunggal, dipisahkan dengan koma

Setiap animasi individu ditentukan sebagai

  • nol, satu, atau dua kemunculan nilai ________19______8
  • nol atau satu kejadian dari nilai-nilai berikut
  • nama opsional untuk animasi, yang mungkin
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
    4,
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
    5, atau
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
    6

<div class="sun"></div>
_9

Menentukan jenis transisi. Nilai harus salah satu yang tersedia di ________20______8

:root {
  overflow: hidden; /* hides any part of the sun below the horizon */
  background-color: lightblue;
  display: flex;
  justify-content: center; /* centers the sun in the background */
}

.sun {
  background-color: yellow;
  border-radius: 50%; /* creates a circular background */
  height: 100vh; /* makes the sun the size of the viewport */
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate sun-rise;
}

@keyframes sun-rise {
  from {
    /* pushes the sun down past the viewport */
    transform: translateY(110vh);
  }
  to {
    /* returns the sun to its default position */
    transform: translateY(0);
  }
}
0

Frekuensi animasi diputar. Nilai harus salah satu yang tersedia di

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

5

:root {
  overflow: hidden; /* hides any part of the sun below the horizon */
  background-color: lightblue;
  display: flex;
  justify-content: center; /* centers the sun in the background */
}

.sun {
  background-color: yellow;
  border-radius: 50%; /* creates a circular background */
  height: 100vh; /* makes the sun the size of the viewport */
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate sun-rise;
}

@keyframes sun-rise {
  from {
    /* pushes the sun down past the viewport */
    transform: translateY(110vh);
  }
  to {
    /* returns the sun to its default position */
    transform: translateY(0);
  }
}
1

Arah di mana animasi dimainkan. Nilai harus salah satu yang tersedia di

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

6

:root {
  overflow: hidden; /* hides any part of the sun below the horizon */
  background-color: lightblue;
  display: flex;
  justify-content: center; /* centers the sun in the background */
}

.sun {
  background-color: yellow;
  border-radius: 50%; /* creates a circular background */
  height: 100vh; /* makes the sun the size of the viewport */
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate sun-rise;
}

@keyframes sun-rise {
  from {
    /* pushes the sun down past the viewport */
    transform: translateY(110vh);
  }
  to {
    /* returns the sun to its default position */
    transform: translateY(0);
  }
}
2

Menentukan bagaimana gaya harus diterapkan pada target animasi sebelum dan sesudah eksekusi. Nilai harus salah satu yang tersedia di

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

7

:root {
  overflow: hidden; /* hides any part of the sun below the horizon */
  background-color: lightblue;
  display: flex;
  justify-content: center; /* centers the sun in the background */
}

.sun {
  background-color: yellow;
  border-radius: 50%; /* creates a circular background */
  height: 100vh; /* makes the sun the size of the viewport */
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate sun-rise;
}

@keyframes sun-rise {
  from {
    /* pushes the sun down past the viewport */
    transform: translateY(110vh);
  }
  to {
    /* returns the sun to its default position */
    transform: translateY(0);
  }
}
3

Menentukan apakah animasi diputar atau tidak. Nilai harus salah satu yang tersedia di

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

8

Urutan nilai waktu dalam setiap definisi animasi adalah penting. nilai pertama yang dapat diuraikan sebagai

<div class="sun"></div>
8 ditugaskan ke
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

2, dan yang kedua ditugaskan ke
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

4

Urutan nilai lain dalam setiap definisi animasi juga penting untuk membedakan nilai

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

1 dari nilai lainnya. Jika nilai dalam steno
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0 dapat diuraikan sebagai nilai untuk properti animasi selain
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

1, maka nilai tersebut akan diterapkan ke properti tersebut terlebih dahulu dan bukan ke
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

1. Untuk alasan ini, praktik yang disarankan adalah menetapkan nilai untuk
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

1 sebagai nilai terakhir dalam daftar nilai saat menggunakan singkatan
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0;

Nilai

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

_1 tidak perlu dinyatakan dalam properti steno
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0. Jika tidak ada nama, tidak ada animasi untuk diterapkan pada salah satu properti

Ketika nilai

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

_2 dihilangkan dari properti steno
animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

0, nilai untuk properti ini default ke
<div class="sun"></div>
1. Dalam hal ini, animasi akan tetap terjadi (peristiwa
<div class="sun"></div>
2 dan
<div class="sun"></div>
3 akan diaktifkan) tetapi tidak ada animasi yang akan terlihat

Animasi berkedip dan berkedip dapat menimbulkan masalah bagi orang dengan masalah kognitif seperti Attention Deficit Hyperactivity Disorder (ADHD). Selain itu, jenis gerakan tertentu dapat menjadi pemicu gangguan Vestibular, epilepsi, serta migrain dan sensitivitas Scotopic

Pertimbangkan untuk menyediakan mekanisme untuk menjeda atau menonaktifkan animasi serta menggunakan Kueri Media Gerakan yang Dikurangi untuk membuat pengalaman tambahan bagi pengguna yang telah menyatakan preferensi untuk pengalaman animasi yang diperkecil

  • Merancang Animasi Web Yang Lebih Aman Untuk Sensitivitas Gerak · Sebuah Daftar Artikel Terpisah
  • Pengantar Kueri Media Gerakan yang Dikurangi. CSS-Trik
  • Desain Responsif untuk Gerakan. WebKit
  • Memahami Kriteria Sukses 2. 2. 2. W3C Memahami WCAG 2. 0

Nilai awalsebagai masing-masing properti steno

  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _1.
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
    4
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _2.
    <div class="sun"></div>
    
    _1
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _3.
    <div class="sun"></div>
    
    _9
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _4.
    <div class="sun"></div>
    
    _1
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    5.
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      /* multiple animations are separated by commas */
      animation:
        4s linear 0s infinite alternate rise,
        /* animation parameters are set independently */
        24s linear 0s infinite psychedelic;
    }
    
    @keyframes rise {
      from {
        transform: translateY(110vh);
      }
      to {
        transform: translateY(0);
      }
    }
    
    @keyframes psychedelic {
      from {
        filter: hue-rotate(0deg);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }
    
    3
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _6.
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      /* multiple animations are separated by commas */
      animation:
        4s linear 0s infinite alternate rise,
        /* animation parameters are set independently */
        24s linear 0s infinite psychedelic;
    }
    
    @keyframes rise {
      from {
        transform: translateY(110vh);
      }
      to {
        transform: translateY(0);
      }
    }
    
    @keyframes psychedelic {
      from {
        filter: hue-rotate(0deg);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }
    
    5
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _7.
    :root {
      overflow: hidden; /* hides any part of the sun below the horizon */
      background-color: lightblue;
      display: flex;
      justify-content: center; /* centers the sun in the background */
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%; /* creates a circular background */
      height: 100vh; /* makes the sun the size of the viewport */
      aspect-ratio: 1 / 1;
      animation: 4s linear 0s infinite alternate sun-rise;
    }
    
    @keyframes sun-rise {
      from {
        /* pushes the sun down past the viewport */
        transform: translateY(110vh);
      }
      to {
        /* returns the sun to its default position */
        transform: translateY(0);
      }
    }
    
    4
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _8.
    :root {
      overflow: hidden;
      background-color: lightblue;
      display: flex;
      justify-content: center;
    }
    
    .sun {
      background-color: yellow;
      border-radius: 50%;
      height: 100vh;
      aspect-ratio: 1 / 1;
      /* multiple animations are separated by commas */
      animation:
        4s linear 0s infinite alternate rise,
        /* animation parameters are set independently */
        24s linear 0s infinite psychedelic;
    }
    
    @keyframes rise {
      from {
        transform: translateY(110vh);
      }
      to {
        transform: translateY(0);
      }
    }
    
    @keyframes psychedelic {
      from {
        filter: hue-rotate(0deg);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }
    
    _9
  • <div class="sun"></div>
    
    _0.
    <div class="sun"></div>
    
    _1
Berlaku untuk semua elemen,
<div class="sun"></div>
_2 dan
<div class="sun"></div>
3 pseudo-elements Inherited noComputed nilai setiap properti steno
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _1. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _2. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _3. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _4. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _6. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    5. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _7. seperti yang ditentukan
  • animation = 
    <single-animation>#

    <single-animation> =
    <time> ||
    <easing-function> ||
    <time> ||
    <single-animation-iteration-count> ||
    <single-animation-direction> ||
    <single-animation-fill-mode> ||
    <single-animation-play-state> ||
    [ none | <keyframes-name> ]

    <easing-function> =
    linear |
    <linear-easing-function> |
    <cubic-bezier-easing-function> |
    <step-easing-function>

    <single-animation-iteration-count> =
    infinite |
    <number [0,∞]>

    <single-animation-direction> =
    normal |
    reverse |
    alternate |
    alternate-reverse

    <single-animation-fill-mode> =
    none |
    forwards |
    backwards |
    both

    <single-animation-play-state> =
    running |
    paused

    <keyframes-name> =
    <custom-ident> |
    <string>

    <linear-easing-function> =
    linear( <linear-stop-list> )

    <cubic-bezier-easing-function> =
    ease |
    ease-in |
    ease-out |
    ease-in-out |
    cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

    <step-easing-function> =
    step-start |
    step-end |
    steps( <integer> [, <step-position> ]? )

    <linear-stop-list> =
    [ <linear-stop> ]#

    <step-position> =
    jump-start |
    jump-end |
    jump-none |
    jump-both |
    start |
    end

    <linear-stop> =
    <number> &&
    <linear-stop-length>?

    <linear-stop-length> =
    <percentage>{1,2}

    _8. seperti yang ditentukan
  • <div class="sun"></div>
    
    _0. listEachItemIdentifyerOrNoneAuto
Jenis animasiTidak dapat dianimasikan

animation = 
<single-animation>#

<single-animation> =
<time> ||
<easing-function> ||
<time> ||
<single-animation-iteration-count> ||
<single-animation-direction> ||
<single-animation-fill-mode> ||
<single-animation-play-state> ||
[ none | <keyframes-name> ]

<easing-function> =
linear |
<linear-easing-function> |
<cubic-bezier-easing-function> |
<step-easing-function>

<single-animation-iteration-count> =
infinite |
<number [0,∞]>

<single-animation-direction> =
normal |
reverse |
alternate |
alternate-reverse

<single-animation-fill-mode> =
none |
forwards |
backwards |
both

<single-animation-play-state> =
running |
paused

<keyframes-name> =
<custom-ident> |
<string>

<linear-easing-function> =
linear( <linear-stop-list> )

<cubic-bezier-easing-function> =
ease |
ease-in |
ease-out |
ease-in-out |
cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )

<step-easing-function> =
step-start |
step-end |
steps( <integer> [, <step-position> ]? )

<linear-stop-list> =
[ <linear-stop> ]#

<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end

<linear-stop> =
<number> &&
<linear-stop-length>?

<linear-stop-length> =
<percentage>{1,2}

Catatan. Menganimasikan properti Model Kotak CSS tidak disarankan. Menganimasikan properti model kotak apa pun secara inheren membutuhkan banyak CPU;

Di sini kita menganimasikan matahari kuning melintasi langit biru muda. Matahari terbit ke tengah viewport dan kemudian menghilang dari pandangan

<div class="sun"></div>

:root {
  overflow: hidden; /* hides any part of the sun below the horizon */
  background-color: lightblue;
  display: flex;
  justify-content: center; /* centers the sun in the background */
}

.sun {
  background-color: yellow;
  border-radius: 50%; /* creates a circular background */
  height: 100vh; /* makes the sun the size of the viewport */
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate sun-rise;
}

@keyframes sun-rise {
  from {
    /* pushes the sun down past the viewport */
    transform: translateY(110vh);
  }
  to {
    /* returns the sun to its default position */
    transform: translateY(0);
  }
}

Menambahkan animasi matahari pada contoh sebelumnya, kita menambahkan animasi kedua yang mengubah warna matahari saat terbit dan terbenam. Matahari mulai berwarna merah tua saat berada di bawah cakrawala dan berubah menjadi oranye terang saat mencapai puncak

<div class="sun"></div>

:root {
  overflow: hidden;
  background-color: lightblue;
  display: flex;
  justify-content: center;
}

.sun {
  background-color: yellow;
  border-radius: 50%;
  height: 100vh;
  aspect-ratio: 1 / 1;
  animation: 4s linear 0s infinite alternate animating-multiple-properties;
}

/* it is possible to animate multiple properties in a single animation */
@keyframes animating-multiple-properties {
  from {
    transform: translateY(110vh);
    background-color: red;
    filter: brightness(75%);
  }
  to {
    transform: translateY(0);
    background-color: orange;
    /* unset properties i.e. 'filter' will revert to default values */
  }
}

Inilah matahari yang terbit dan terbenam dengan latar belakang biru muda. Matahari secara bertahap berputar melalui pelangi warna. Waktu posisi dan warna matahari bersifat independen

<div class="sun"></div>

:root {
  overflow: hidden;
  background-color: lightblue;
  display: flex;
  justify-content: center;
}

.sun {
  background-color: yellow;
  border-radius: 50%;
  height: 100vh;
  aspect-ratio: 1 / 1;
  /* multiple animations are separated by commas */
  animation:
    4s linear 0s infinite alternate rise,
    /* animation parameters are set independently */
    24s linear 0s infinite psychedelic;
}

@keyframes rise {
  from {
    transform: translateY(110vh);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes psychedelic {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}

Ini adalah matahari kuning dengan latar belakang biru muda. Matahari memantul di antara sisi kiri dan kanan viewport. Matahari tetap berada di area pandang meskipun animasi naik ditentukan. Properti transformasi animasi naik 'ditimpa' oleh animasi pantulan

Bagaimana cara mengubah teks dalam animasi CSS?

Salah satunya mengubah kata text animation. .
Langkah 1. Lakukan beberapa gaya dasar seperti warna latar belakang, warna teks, margin, padding, dll
Langkah 2. Sekarang, gunakan sebelum pilih/atau untuk menyetel konten rentang ke kata awal
Langkah 3. Gunakan properti animasi untuk mengatur total waktu animasi

Bagaimana Anda menganimasikan konten dalam CSS?

Animasi memungkinkan elemen secara bertahap berubah dari satu gaya ke gaya lainnya. Anda dapat mengubah properti CSS sebanyak yang Anda inginkan, sebanyak yang Anda inginkan. Untuk menggunakan animasi CSS, Anda harus terlebih dahulu menentukan beberapa keyframe untuk animasi . Bingkai utama menyimpan gaya apa yang akan dimiliki elemen pada waktu tertentu.

Bagaimana Anda membuat animasi pengetikan teks dalam HTML dan CSS?

Berikutnya, kita akan menggunakan animasi CSS untuk benar-benar menambahkan efek pengetikan. .
animasi. mengetik menetapkan aturan @keyframes yang kami buat ke. .
durasi animasi. 1. 5s membuat animasi bertahan 1. 5 detik
animasi-waktu-fungsi. langkah-langkah (30, akhir) membuat animasi diputar secara bertahap, bukan dengan lancar