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

質問編集履歴

1

ソースコードを追加しました。

2020/07/22 09:39

投稿

gumin
gumin

スコア4

title CHANGED
File without changes
body CHANGED
@@ -13,4 +13,99 @@
13
13
 
14
14
  ページ表示の遅延を防ぐため、できればJSは使用したくないです。。。
15
15
 
16
- 申し訳ないのですが、ご教授よろしくお願いします。
16
+ 申し訳ないのですが、ご教授よろしくお願いします。
17
+
18
+
19
+ ソース追記します。opacity:1で現時点でまず文字が表示されないため、フェードアウトまで実装できておりません…。
20
+
21
+ ```HTML
22
+ <div class="p-home-mainvisual__text-area">
23
+ <div>
24
+ <span class="f-bg">abcde</span>
25
+ <ul class="f-text">
26
+ <li>a</li>
27
+ <li>b</li>
28
+ <li>c</li>
29
+ <li>d</li>
30
+ <li>e</li>
31
+ </ul>
32
+ </div>
33
+ </div>
34
+ ```
35
+
36
+ ```css
37
+ .p-home-mainvisual__text-area{
38
+ position: relative;
39
+ width: 100%!important;
40
+ text-align: center;
41
+ color: #FFF;
42
+ }
43
+ .f-bg{
44
+ content: "";
45
+ position: absolute;
46
+ top: 200px;
47
+ left: 50%;
48
+ font-size: 3.5em;
49
+ color: transparent;
50
+ width:50%;
51
+ -webkit-transform: translateX(-50%);
52
+ transform: translateX(-50%);
53
+ padding: 0 20px;
54
+
55
+ }
56
+ .f-bg::before{
57
+ display: block;
58
+ content: "";
59
+ height: 100%;
60
+ background: #AAA;
61
+ position: absolute;
62
+ top: 0;
63
+ opacity:0.7;
64
+ animation: wipe .7s ease-in-out both;
65
+ animation-delay: 1s;
66
+ }
67
+ @keyframes wipe {
68
+ 0% {
69
+ left:0;
70
+ right: 100%;
71
+ }
72
+ 100% {
73
+ left:0;
74
+ right:0;
75
+ }
76
+ }
77
+ .f-text{
78
+ margin-left:30%;
79
+ margin-top:16%;
80
+ }
81
+ .f-text li{
82
+ float: left;
83
+ animation: wipe-text;
84
+ opacity:0;
85
+ font-size:4em;
86
+ }
87
+ .f-text > li:nth-child(1){
88
+ animation-delay: 2s;
89
+ }
90
+ .f-text > li:nth-child(2){
91
+ animation-delay: 2.5s;
92
+ }
93
+ .f-text > li:nth-child(3){
94
+ animation-delay: 3s;
95
+ }
96
+ .f-text > li:nth-child(4){
97
+ animation-delay: 3.5s;
98
+ }
99
+ .f-text > li:nth-child(5){
100
+ animation-delay: 4.0s;
101
+ }
102
+
103
+ @keyframes wipe-text{
104
+ 0% {
105
+ opacity:0;
106
+ }
107
+ 100%{
108
+ opacity:1;
109
+ }
110
+
111
+ ```