質問編集履歴
1
htmlとcssのコードも追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,4 +52,224 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
+
```html
|
56
|
+
|
57
|
+
<body class="container">
|
58
|
+
|
59
|
+
<script>
|
60
|
+
|
61
|
+
var scrollAnimationElm = document.querySelectorAll(".express");
|
62
|
+
|
63
|
+
var scrollAnimationFunc = function(){
|
64
|
+
|
65
|
+
for(var i = 0; i < scrollAnimationElm.length; i++) {
|
66
|
+
|
67
|
+
var triggerMargin = 300;
|
68
|
+
|
69
|
+
if (window.innerHeight > scrollAnimationElm[i].getBoundingClientRect().top + triggerMargin) {
|
70
|
+
|
71
|
+
scrollAnimationElm[i].classList.add('show');
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
window.addEventListener('load', scrollAnimationFunc);
|
80
|
+
|
81
|
+
window.addEventListener('scroll', scrollAnimationFunc);
|
82
|
+
|
83
|
+
</script>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<main class="main">
|
88
|
+
|
89
|
+
<div class="profile">
|
90
|
+
|
91
|
+
<img class="profile_img" src="画像のリンク">
|
92
|
+
|
93
|
+
<div class="profile_content">
|
94
|
+
|
95
|
+
<p class="profile_name">名前</p>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<div class="history_gackground">
|
102
|
+
|
103
|
+
<h3>〜地域編〜</h3>
|
104
|
+
|
105
|
+
<div class="sized_img express--up express"><img src="画像のリンク"></div>
|
106
|
+
|
107
|
+
<img class="sized_img express--up express" src="リンク">
|
108
|
+
|
109
|
+
<img class="sized_img express--up express" src="リンク">
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="history_gackground">
|
114
|
+
|
115
|
+
<h3>〜地域編<img class="kuma_img" src="リンク">〜</h3>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<img class="sized_img express--up express" src="リンク">
|
120
|
+
|
121
|
+
<img class="sized_img express--up express" src="リンク">
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="history_gackground">
|
126
|
+
|
127
|
+
<h3>〜地域編〜</h3>
|
128
|
+
|
129
|
+
<img class="sized_img express--up express" src="リンク">
|
130
|
+
|
131
|
+
<a href="別サイトへのリンク"><img class="sized_img express--up express" src="リンク"></a>
|
132
|
+
|
133
|
+
<img class="sized_img express--up express" src="リンク">
|
134
|
+
|
135
|
+
<img class="sized_img express--up express" src="リンク">
|
136
|
+
|
137
|
+
<img class="sized_img express--up express" src="リンク">
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</main>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
</body>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
```css
|
154
|
+
|
155
|
+
.container{
|
156
|
+
|
157
|
+
max-width: 1200px;
|
158
|
+
|
159
|
+
margin: 0 auto;
|
160
|
+
|
161
|
+
padding: 0px;
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
.main{
|
166
|
+
|
167
|
+
width: 100%;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
.sized_img{
|
174
|
+
|
175
|
+
width:300px;
|
176
|
+
|
177
|
+
height:auto;
|
178
|
+
|
179
|
+
margin: 5px;
|
180
|
+
|
181
|
+
border-radius: 2px;
|
182
|
+
|
183
|
+
box-shadow: 0 10px 25px 0 rgba(0, 0, 0, .5), 10px 10px 0px 0 rgba(0, 0, 0, .5) inset;
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
.express{
|
188
|
+
|
189
|
+
opacity: 0;
|
190
|
+
|
191
|
+
transition: all .5s ease;
|
192
|
+
|
193
|
+
}
|
194
|
+
|
195
|
+
.show{
|
196
|
+
|
197
|
+
opacity: 1;
|
198
|
+
|
199
|
+
transform: none;
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
.express--up{
|
204
|
+
|
205
|
+
transform: translate(0, 100px);
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
.kuma_img{
|
210
|
+
|
211
|
+
height: 33.6px;
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
.history_gackground{
|
218
|
+
|
219
|
+
/* background-color: #F8EFBA; */
|
220
|
+
|
221
|
+
margin-top: 10px;
|
222
|
+
|
223
|
+
margin-bottom: 10px;
|
224
|
+
|
225
|
+
padding: 10px;
|
226
|
+
|
227
|
+
}
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
.profile{
|
232
|
+
|
233
|
+
display: flex;
|
234
|
+
|
235
|
+
width: 500px;
|
236
|
+
|
237
|
+
margin: 0 auto;
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
.profile_img{
|
242
|
+
|
243
|
+
width:300px;
|
244
|
+
|
245
|
+
height:auto;
|
246
|
+
|
247
|
+
margin: 5px;
|
248
|
+
|
249
|
+
border-radius: 150px;
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
.profile_content{
|
254
|
+
|
255
|
+
position: relative;
|
256
|
+
|
257
|
+
top: 50px;
|
258
|
+
|
259
|
+
left: 30px;
|
260
|
+
|
261
|
+
}
|
262
|
+
|
263
|
+
.profile_name{
|
264
|
+
|
265
|
+
font-weight: bold;
|
266
|
+
|
267
|
+
font-size: 24px;
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
```
|
272
|
+
|
273
|
+
|
274
|
+
|
55
275
|
初歩的な質問で申し訳ありませんが、アドバイスを頂けますでしょうか。
|