Skip to content

Commit 8f4f114

Browse files
committed
Fix fish speed on mobile
1 parent db0f513 commit 8f4f114

File tree

2 files changed

+122
-40
lines changed

2 files changed

+122
-40
lines changed

css/index.css

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -212,86 +212,121 @@ header .jumboTxt p {
212212
top: 0;
213213
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 30s linear infinite alternate;
214214
}
215+
@media (max-width: 501px) {
216+
.fishAnimation .jellyfish {
217+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s linear infinite alternate;
218+
}
219+
}
215220
.fishAnimation .normFish2 {
216221
top: 40%;
217222
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 4s infinite normal;
218223
}
219224
.fishAnimation .dolphin {
220225
top: 80%;
221226
width: 250px;
222-
animation: SwimUpDown 1s infinite alternate,
223-
MoveOnScreen 15s 5s infinite reverse;
227+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 5s infinite reverse;
228+
}
229+
@media (max-width: 501px) {
230+
.fishAnimation .dolphin {
231+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 5s infinite reverse;
232+
}
224233
}
225234
.fishAnimation .puffer {
226235
top: 0;
227236
width: 100px;
228237
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 7s linear infinite normal;
229238
transform: scaleX(-1);
230239
}
240+
@media (max-width: 501px) {
241+
.fishAnimation .puffer {
242+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 7s linear infinite normal;
243+
}
244+
}
231245
.fishAnimation .school {
232246
top: 20%;
233247
width: 250px;
234-
animation: SwimUpDown 1s infinite alternate,
235-
MoveOnScreen 15s infinite normal;
248+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s infinite normal;
236249
}
237250
.fishAnimation .spiny {
238251
top: 50%;
239-
animation: SwimUpDown 1s infinite alternate,
240-
MoveOnScreen 15s 3s infinite reverse;
252+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 3s infinite reverse;
241253
}
242254
.fishAnimation .sword {
243255
top: 85%;
244256
width: 300px;
245-
animation: SwimUpDown 1s infinite alternate,
246-
MoveOnScreen 15s 5s linear infinite reverse;
257+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 2s linear infinite reverse;
247258
transform: rotate(-15deg);
248259
}
260+
@media (max-width: 501px) {
261+
.fishAnimation .sword {
262+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 2s linear infinite reverse;
263+
}
264+
}
249265
.fishAnimation .normFish3 {
250266
top: 0;
251-
animation: SwimUpDown 1s infinite alternate,
252-
MoveOnScreen 15s 5s linear infinite normal;
267+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 5s linear infinite normal;
268+
}
269+
@media (max-width: 501px) {
270+
.fishAnimation .normFish3 {
271+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 5s linear infinite normal;
272+
}
253273
}
254274
.fishAnimation .seahorse {
255275
width: 90px;
256276
top: 70%;
257-
animation: SwimUpDown 1s infinite alternate,
258-
MoveOnScreen 15s 5s linear infinite reverse;
277+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 5s linear infinite reverse;
278+
}
279+
@media (max-width: 501px) {
280+
.fishAnimation .seahorse {
281+
top: 80%;
282+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 5s linear infinite reverse;
283+
}
259284
}
260285
.fishAnimation .shark {
261286
top: 0;
262-
animation: SwimUpDown 1s infinite alternate,
263-
MoveOnScreen 15s linear infinite normal;
287+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s linear infinite normal;
264288
width: 330px;
265289
transform: scale(1.3);
266290
}
267291
@media (max-width: 501px) {
268292
.fishAnimation .shark {
293+
top: -5%;
269294
height: 410px;
270-
animation: SwimUpDown 1s infinite alternate,
271-
MoveOnScreen 9s linear infinite normal;
295+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 9s 2s linear infinite normal;
272296
}
273297
}
274298
.fishAnimation .normFish {
275299
top: 20%;
276-
animation: SwimUpDown 1s infinite alternate,
277-
MoveOnScreen 15s linear infinite normal;
300+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s linear infinite normal;
278301
}
279302
.fishAnimation .bass {
280303
top: 0;
281-
animation: SwimUpDown 1s infinite alternate,
282-
MoveOnScreen 15s linear infinite reverse;
304+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s linear infinite reverse;
305+
}
306+
@media (max-width: 501px) {
307+
.fishAnimation .bass {
308+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s linear infinite reverse;
309+
}
283310
}
284311
.fishAnimation .norm {
285312
top: 10%;
286-
animation: SwimUpDown 1s infinite alternate,
287-
MoveOnScreen 15s 2s linear infinite normal;
313+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s 2s linear infinite normal;
314+
}
315+
@media (max-width: 501px) {
316+
.fishAnimation .norm {
317+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 2s linear infinite normal;
318+
}
288319
}
289320
.fishAnimation .whale {
290321
top: 80%;
291-
animation: SwimUpDown 1s infinite alternate,
292-
MoveOnScreen 15s linear infinite reverse;
322+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 15s linear infinite reverse;
293323
transform: scale(3) scaleX(-1);
294324
}
325+
@media (max-width: 501px) {
326+
.fishAnimation .whale {
327+
animation: SwimUpDown 1.5s infinite alternate, MoveOnScreen 7s 4s linear infinite reverse;
328+
}
329+
}
295330
@keyframes SwimUpDown {
296331
0% {
297332
margin-top: 0;
@@ -303,7 +338,7 @@ header .jumboTxt p {
303338
@keyframes MoveOnScreen {
304339
0% {
305340
opacity: 1;
306-
margin-left: -20%;
341+
margin-left: -70%;
307342
}
308343
100% {
309344
margin-left: 120%;

less/fishAnimation.less

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
top: 0;
1414
animation: SwimUpDown 1.5s infinite alternate,
1515
MoveOnScreen 30s linear infinite alternate;
16+
17+
@media @phone {
18+
animation: SwimUpDown 1.5s infinite alternate,
19+
MoveOnScreen 15s linear infinite alternate;
20+
}
1621
}
1722

1823
.normFish2 {
@@ -24,8 +29,13 @@
2429
.dolphin {
2530
top: 80%;
2631
width: 250px;
27-
animation: SwimUpDown 1s infinite alternate,
32+
animation: SwimUpDown 1.5s infinite alternate,
2833
MoveOnScreen 15s 5s infinite reverse;
34+
35+
@media @phone {
36+
animation: SwimUpDown 1.5s infinite alternate,
37+
MoveOnScreen 7s 5s infinite reverse;
38+
}
2939
}
3040

3141
.puffer {
@@ -34,80 +44,117 @@
3444
animation: SwimUpDown 1.5s infinite alternate,
3545
MoveOnScreen 15s 7s linear infinite normal;
3646
transform: scaleX(-1);
47+
48+
@media @phone {
49+
animation: SwimUpDown 1.5s infinite alternate,
50+
MoveOnScreen 7s 7s linear infinite normal;
51+
}
3752
}
3853

3954
.school {
4055
top: 20%;
4156
width: 250px;
42-
animation: SwimUpDown 1s infinite alternate,
57+
animation: SwimUpDown 1.5s infinite alternate,
4358
MoveOnScreen 15s infinite normal;
4459
}
4560

4661
.spiny {
4762
top: 50%;
4863
// width: 0px;
49-
animation: SwimUpDown 1s infinite alternate,
64+
animation: SwimUpDown 1.5s infinite alternate,
5065
MoveOnScreen 15s 3s infinite reverse;
5166
}
5267

5368
.sword {
5469
top: 85%;
5570
width: 300px;
56-
animation: SwimUpDown 1s infinite alternate,
57-
MoveOnScreen 15s 5s linear infinite reverse;
71+
animation: SwimUpDown 1.5s infinite alternate,
72+
MoveOnScreen 15s 2s linear infinite reverse;
5873
transform: rotate(-15deg);
74+
75+
@media @phone {
76+
animation: SwimUpDown 1.5s infinite alternate,
77+
MoveOnScreen 7s 2s linear infinite reverse;
78+
}
5979
}
6080

6181
.normFish3 {
6282
top: 0;
63-
animation: SwimUpDown 1s infinite alternate,
83+
animation: SwimUpDown 1.5s infinite alternate,
6484
MoveOnScreen 15s 5s linear infinite normal;
85+
86+
@media @phone {
87+
animation: SwimUpDown 1.5s infinite alternate,
88+
MoveOnScreen 7s 5s linear infinite normal;
89+
}
6590
}
6691

6792
.seahorse {
6893
width: 90px;
6994
top: 70%;
70-
animation: SwimUpDown 1s infinite alternate,
95+
animation: SwimUpDown 1.5s infinite alternate,
7196
MoveOnScreen 15s 5s linear infinite reverse;
97+
98+
@media @phone {
99+
top: 80%;
100+
animation: SwimUpDown 1.5s infinite alternate,
101+
MoveOnScreen 7s 5s linear infinite reverse;
102+
}
72103
}
73104

74105
.shark {
75106
top: 0;
76-
animation: SwimUpDown 1s infinite alternate,
107+
animation: SwimUpDown 1.5s infinite alternate,
77108
MoveOnScreen 15s linear infinite normal;
78109
width: 330px;
79110
transform: scale(1.3);
80111

81112
@media @phone {
113+
top: -5%;
82114
height: 410px;
83-
animation: SwimUpDown 1s infinite alternate,
84-
MoveOnScreen 9s linear infinite normal;
115+
animation: SwimUpDown 1.5s infinite alternate,
116+
MoveOnScreen 9s 2s linear infinite normal;
85117
}
86118
}
87119

88120
.normFish {
89121
top: 20%;
90-
animation: SwimUpDown 1s infinite alternate,
122+
animation: SwimUpDown 1.5s infinite alternate,
91123
MoveOnScreen 15s linear infinite normal;
92124
}
93125

94126
.bass {
95127
top: 0;
96-
animation: SwimUpDown 1s infinite alternate,
128+
animation: SwimUpDown 1.5s infinite alternate,
97129
MoveOnScreen 15s linear infinite reverse;
130+
131+
@media @phone {
132+
animation: SwimUpDown 1.5s infinite alternate,
133+
MoveOnScreen 7s linear infinite reverse;
134+
}
98135
}
99136

100137
.norm {
101138
top: 10%;
102-
animation: SwimUpDown 1s infinite alternate,
139+
animation: SwimUpDown 1.5s infinite alternate,
103140
MoveOnScreen 15s 2s linear infinite normal;
141+
142+
@media @phone {
143+
animation: SwimUpDown 1.5s infinite alternate,
144+
MoveOnScreen 7s 2s linear infinite normal;
145+
}
104146
}
105147

106148
.whale {
107149
top: 80%;
108-
animation: SwimUpDown 1s infinite alternate,
150+
animation: SwimUpDown 1.5s infinite alternate,
109151
MoveOnScreen 15s linear infinite reverse;
110152
transform: scale(3) scaleX(-1);
153+
154+
@media @phone {
155+
animation: SwimUpDown 1.5s infinite alternate,
156+
MoveOnScreen 7s 4s linear infinite reverse;
157+
}
111158
}
112159
}
113160

@@ -123,7 +170,7 @@
123170
@keyframes MoveOnScreen {
124171
0% {
125172
opacity: 1;
126-
margin-left: -20%;
173+
margin-left: -70%;
127174
}
128175

129176
100% {

0 commit comments

Comments
 (0)