ΠΡΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠΈ ΠΊΠ»ΡΡΠ΅Π²ΡΡ ΠΊΠ°Π΄ΡΠΎΠ² Π² css-ΠΌΠΎΠ΄ΡΠ»ΡΡ Π±ΡΠ»ΠΈ ΠΎΠ±Π½Π°ΡΡΠΆΠ΅Π½Ρ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ:
ΠΡΡ ΠΎΠ΄Π½ΡΠΉ ΠΊΠΎΠ΄ css:
<strong i="7">@keyframes</strong> rotating {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
.rotating-item {
animation: 5s linear 0 infinite rotating;
}
Π‘ΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΠΎΠ²Π°Π½ Π² ΡΠ»Π΅Π΄ΡΡΡΠΈΠΉ ΠΊΠΎΠ΄:
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="11">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite :local(rotating);
animation: 5s linear 0 infinite :local(rotating);
}
ΠΡΠΌΠ°Ρ, ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΠΌ Π΄ΠΎΠ»ΠΆΠ½ΠΎ Π±ΡΡΡ:
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="15">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite rotating___3vsQl;
animation: 5s linear 0 infinite rotating___3vsQl;
}
Π― Π½Π΅ Π·Π½Π°Ρ, ΠΎΡΠΈΠ±ΠΊΠ° Π»ΠΈ ΡΡΠΎ css-modules ΠΈΠ»ΠΈ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ Π² webpack.
ΠΡΠΈΠΌΠ΅ΡΠ°Π½ΠΈΠ΅:
- ΠΡΠΎΠ΅ΠΊΡ, ΡΠΎΠ·Π΄Π°Π½Π½ΡΠΉ Ρ ΠΏΠΎΠΌΠΎΡΡΡ dva-cli, Π½Π΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠ» ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ Π²Π΅Π±-ΠΏΠ°ΠΊΠ΅ΡΠ°.
- ΠΠ½Π°ΡΠ°Π»Π΅ Ρ ΠΏΠΈΡΠ°Π» ΠΌΠ΅Π½ΡΡΠ΅, Π½ΠΎ ΡΡΠΎ Π½Π΅ ΡΡΠ°Π±ΠΎΡΠ°Π»ΠΎ, Π΅ΡΠ»ΠΈ Ρ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠ» Π΅Π³ΠΎ Π½Π° css.
Π ΡΠ»ΡΡΠ°Π΅ ΠΌΠ΅Π½ΡΡΠ΅Π³ΠΎ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²Π° Π·Π°ΠΏΠΈΡΠ΅ΠΉ ΡΠΊΠ°ΠΆΠΈΡΠ΅, ΡΡΠΎ
<strong i="25">@keyframes</strong> :global(rotating)
ΡΠΎΠΎΠ±ΡΠΈΡ ΠΎΠ± ΠΎΡΠΈΠ±ΠΊΠ΅.ΠΠ΅ΡΡΠΈΠΈ ΠΈΠ½ΡΡΡΡΠΌΠ΅Π½ΡΠ° ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅:
ΡΠ·Π΅Π». [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
https://github.com/css-modules/css-modules/issues/141#issuecomment -243011699
ΠΠΎΠΆΠ΅Ρ Π»ΠΈ ΡΡΠΎ ΡΠ΅ΡΠΈΡΡ Π²Π°ΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ?
Π‘ΠΏΠ°ΡΠΈΠ±ΠΎ π!
ΠΠ°, ΡΡΠΎ Π½ΠΎΡΠΌΠ°Π»ΡΠ½ΠΎ, Π½ΠΎ Ρ ΠΎΠ±Π½Π°ΡΡΠΆΠΈΠ», ΡΡΠΎ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° Π²
animation: name .6s ease; // θΏζ ·ζ―ε―δ»₯η
animation: .6s ease name; // θθΏζ ·ε°±δΈδΌθ’«θ―ε«ε°δΊ
ΠΡΠ» ΠΈΠ·ΡΡΡ ΠΈΠ· Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Mozillaπ
<single-animation> = <time> || <single-timing-function> || <time> || <single-animation-iteration-count> || <single- animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ] /* <strong i="11">@keyframes</strong> duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* <strong i="12">@keyframes</strong> duration | timing-function | delay | name */ animation: 3s linear 1s slidein; /* <strong i="13">@keyframes</strong> duration | name */ animation: 3s slidein;
Π‘Π°ΠΌΡΠΉ ΠΏΠΎΠ»Π΅Π·Π½ΡΠΉ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΉ
Π‘ΠΏΠ°ΡΠΈΠ±ΠΎ π!
ΠΠ°, ΡΡΠΎ Π½ΠΎΡΠΌΠ°Π»ΡΠ½ΠΎ, Π½ΠΎ Ρ ΠΎΠ±Π½Π°ΡΡΠΆΠΈΠ», ΡΡΠΎ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ° Π²
ΠΡΠ» ΠΈΠ·ΡΡΡ ΠΈΠ· Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Mozillaπ