teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

コード修正

2021/01/22 00:16

投稿

hatena19
hatena19

スコア34367

answer CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  ```css
27
27
  .node1 {
28
- animation: anm0 8.2s, anm1 10s 10s infinite;
28
+ animation: anm0 8.11s, anm1 10s 8.11s infinite;
29
29
  }
30
30
  @keyframes anm1 {
31
31
  0% {

1

コード追記

2021/01/22 00:16

投稿

hatena19
hatena19

スコア34367

answer CHANGED
@@ -19,4 +19,28 @@
19
19
  .node1 {
20
20
  animation: anm1 10s linear -1.89s infinite;
21
21
  }
22
+ ```
23
+ ---
24
+ animation-timing-function を初期値(ease)で、開始時もease-inで開始したい場合は、複数アニメーションを設定するいいでしょう。カンマで区切って記述すると複数のアニメーションを設定できます。
25
+
26
+ ```css
27
+ .node1 {
28
+ animation: anm0 8.2s, anm1 10s 10s infinite;
29
+ }
30
+ @keyframes anm1 {
31
+ 0% {
32
+ transform: translate(-100px,50px);
33
+ }
34
+ 100% {
35
+ transform: translate(1000px,50px);
36
+ }
37
+ }
38
+ @keyframes anm0 {
39
+ 0% {
40
+ transform: translate(100px,50px);
41
+ }
42
+ 100% {
43
+ transform: translate(1000px,50px);
44
+ }
45
+ }
22
46
  ```