回答編集履歴

3

説明追記

2020/08/21 11:10

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -65,3 +65,7 @@
65
65
  })
66
66
 
67
67
  ```
68
+
69
+
70
+
71
+ ブラウザの幅を変えて高さが変化したときにも対応させる場合は、リサイズイベントからも呼び出すようにします。

2

コード追記

2020/08/21 11:10

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -35,3 +35,33 @@
35
35
  }
36
36
 
37
37
  ```
38
+
39
+
40
+
41
+ ---
42
+
43
+
44
+
45
+ ページの高さということらしいので、js の animateメソッドで。
46
+
47
+
48
+
49
+ ```js
50
+
51
+ const el = document.querySelector('.title')
52
+
53
+ const h = document.documentElement.scrollHeight;
54
+
55
+ el.animate({
56
+
57
+ transform: ['translatey(' + h + 'px)', 'translatey(0px)']
58
+
59
+ }, {
60
+
61
+ duration: 3000,
62
+
63
+ iterations: Infinity
64
+
65
+ })
66
+
67
+ ```

1

コード修正

2020/08/21 11:05

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  .title{
12
12
 
13
- animation: SlideIn 1.6s infinite;
13
+ animation: SlideIn 1.6s;
14
14
 
15
15
  }
16
16