-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrivers.html
More file actions
534 lines (506 loc) · 18 KB
/
Drivers.html
File metadata and controls
534 lines (506 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formula Flicks</title>
<link rel = "icon" type = "image/jpg" href = "https://nmgprod.s3.amazonaws.com/media/files/bd/a0/bda0bfc1dd54bceec158199b9a372b1a/cover_image_1700249180.jpg">
<style>@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");
body{
font-family: Poppins;
margin: 0;
background-color: #010101;
color: #eee;
}
svg{
width: 25px;
}
header .logo{
font-weight: bold;
}
header .menu{
padding: 0;
margin: 0;
list-style: none;
display: flex;
justify-content: center;
gap: 20px;
font-weight: 500;
}
/* css slider */
.slider{
height: 100vh;
margin-top: 80px;
position: relative;
}
.slider .list .item{
position: absolute;
inset: 0 0 0 0;
overflow:visible;
opacity: 0;
transition: .5s;
}
.slider .list .item img{
width: 110%;
height: 120%;
object-fit: cover;
}
.slider .list .item::after{
content: '';
width: 200%;
height: 100%;
position: fixed;
left: 0;
bottom: 0;
background-image: linear-gradient( to top, #000 40%, transparent);
}
.slider .list .item .content{
position: absolute;
left: 3%;
top: 20%;
width: 350px;
max-width: 80%;
z-index: 1;
}
.slider .list .item .content p:nth-child(1){
text-transform: uppercase;
letter-spacing: 10px;
}
.slider .list .item .content h2{
font-size: 100px;
margin: 0;
}
.slider .list .item.active{
opacity: 1;
z-index: 10;
}
@keyframes showContent {
to{
transform: translateY(0);
filter: blur(0);
opacity: 1;
}
}
.slider .list .item.active p:nth-child(1),
.slider .list .item.active h2,
.slider .list .item.active p:nth-child(3){
transform: translateY(50px);
filter: blur(20px);
opacity: 0;
animation: showContent .5s .7s ease-in-out 1 forwards;
}
.slider .list .item.active h2{
animation-delay: 1s;
}
.slider .list .item.active p:nth-child(3){
animation-duration: 1.3s;
}
.thumbnail{
position: absolute;
bottom: 0px;
top: 550px;
left: 200px;
z-index: 11;
display: flex;
gap: 35px;
width: 100%;
height: 250px;
padding: 0 50px;
box-sizing: border-box;
overflow: auto;
justify-content: center;
border-radius: "15px";
}
.thumbnail::-webkit-scrollbar{
width: 0;
}
.thumbnail .item{
width: 150px;
height: 220px;
filter: brightness(.5);
transition: .5s;
flex-shrink: 0;
cursor: pointer;
}
.thumbnail .item img{
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 10px;
}
.thumbnail .item.active{
filter: brightness(1.2);
}
.thumbnail .item .content{
position: absolute;
inset: auto 10px 10px 10px;
}
@media screen and (max-width: 678px) {
.thumbnail{
justify-content: start;
}
.slider .list .item .content h2{
font-size: 60px;
}
.arrows{
top: 10%;
}
}
.header {
width: 95%;
height: 50px;
position: fixed;
top: 0;
left: 0;
padding: 15px 50px;
background: rgba(255, 255, 255, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
backdrop-filter: blur(10px);
border-bottom: 2px solid rgba(255, 255, 255, 0.2);
z-index: 100;
}
.header::before {
content: "";
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.4),
transparent
);
transition: 0.5s;
}
.header:hover::before {
left: 100%;
}
.logo {
color: #fff;
font-size: 25px;
text-decoration: none;
font-weight: 600;
cursor: pointer;
}
.navbar a {
color: #fff;
font-size: 18px;
text-decoration: none;
transition: 0.3s;
}
.navbar a:hover {
color: #f00;
}
#menu-icon {
font-size: 36px;
color: #fff;
display: none;
}
/* BREAKPOINTS */
@media (max-width: 992px) {
.header {
padding: 1.25rem 4%;
}
}
@media (max-width: 768px) {
#menu-icon {
font-size: 36px;
color: #fff;
display: none;
}
.navbar {
position: absolute;
top: 100%;
left: 0;
width: 100%;
padding: 0.5rem 4%;
display: none;
}
.navbar.active {
display: block;
}
.navbar a {
display: block;
margin: 1.5rem 0;
}
.nav-bg {
position: absolute;
top: 79px;
left: 0;
width: 100%;
height: 295px;
background: rgba(255, 255, 255, 0.1);
border-bottom: 2px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
z-index: 99;
display: none;
}
.nav-bg.active {
display: block;
}
}
/* Button Styles */
.navbar .nav-btn {
position: relative;
text-align: center;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
z-index: 0;
margin: 10px;
padding: 10px 15px;
border: none;
outline: none;
color: #FFF; /* Button text color */
background-color: transparent;
cursor: pointer;
border-radius: 12px;
font-size: 16px;
font-weight: 500;
text-transform: uppercase;
transition: color 0.3s ease-in-out;
}
.navbar .nav-btn a {
text-decoration: none;
color: inherit; /* Inherit color from button */
}
.navbar .nav-btn::after {
content: "";
z-index: -1;
position: absolute;
width: 100%;
height: 100%;
background-color: #333;
left: 0;
top: 0;
border-radius: 12px;
transition: background 0.3s ease-in-out;
}
/* Glowing Effect */
.navbar .nav-btn::before {
content: "";
background: linear-gradient(
45deg,
#FF0000, #FF7300, #FFFB00, #48FF00,
#00FFD5, #002BFF, #FF00C8, #FF0000
);
position: absolute;
top: -3px;
left: -3px;
background-size: 600%;
z-index: -1;
width: calc(100% + 6px);
height: calc(100% + 6px);
filter: blur(8px);
border-radius: 12px;
opacity: 0;
animation: glowing 20s linear infinite;
transition: opacity 0.3s ease-in-out;
}
/* Glowing Animation */
@keyframes glowing {
0% {
background-position: 0 0;
}
50% {
background-position: 400% 0;
}
100% {
background-position: 0 0;
}
}
/* Hover Effects */
.navbar .nav-btn:hover::before {
opacity: 1;
}
.navbar .nav-btn:hover {
color: #FFF; /* Ensure text remains visible */
}
.navbar .nav-btn:active:after {
background: transparent;
}
.navbar .nav-btn:active {
color: #000; /* Change text color on active click */
font-weight: bold;
}
</style>
</head>
<body>
<!-- header -->
<header class="header">
<a href="index.html" class="logo">FORMULA FLICKS</a>
<i class='bx bx-menu' id="menu-icon"></i>
<nav class="navbar">
<button class="nav-btn"><a href="index.html">HOME</a></button>
<button class="nav-btn"><a href="Teams.html">TEAMS</a></button>
<button class="nav-btn"><a href="Results.html">RESULTS</a></button>
<button class="nav-btn"><a href="Highlights.html">HIGHLIGHTS</a></button>
</nav>
</header>
<div class="nav-bg"></div>
<!-- slider -->
<div class="slider">
<!-- list Items -->
<div class="list">
<div class="item active">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/M/MAXVER01_Max_Verstappen/maxver01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>MAX VERSTAPPEN</h2>
<p>
He's Max by name, and max by nature.
Arriving as Formula 1's youngest ever competitor at just 17 years old, Verstappen pushed his car, his rivals and the sport's record books to the limit. The baby-faced Dutchman with the heart of a lion took the Toro Rosso and then the Red Bull by the horns with his instinctive racing style.
F1's youngest points scorer soon became its youngest race winner at the age of 18 years and 228 days.
</p>
</div>
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/L/LANNOR01_Lando_Norris/lannor01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>LANDO NORRIS</h2>
<p>
Lando Norris may not be named after Star Wars rebel Lando Calrissian - his Mum just liked the moniker - but he has flair and fighting spirit in bountiful supply.
McLaren had the British teenager on their books for two years before fast-tracking him into F1's galaxy of stars in 2019. A firecracker in his junior career, with a penchant for pole positions and wheel-to-wheel tussles, Norris didn't let them down.
</p>
</div>
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/C/CHALEC01_Charles_Leclerc/chalec01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>CHARLES LECLERC</h2>
<p>
Born in the Mediterranean idyll of Monaco, Leclerc arrived in F1 on a tidal wave of expectation.
Practically peerless on his way to the GP3 and Formula 2 crowns, he showcased a dazzling array of skills from scorching pole positions, commanding victories even when his car caught fire twice at Silverstone to an ability to muscle his way through the pack
</p>
</div>
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/F/FERALO01_Fernando_Alonso/feralo01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>FERNANDO ALONSO</h2>
<p>
Michael Schumacher was the undisputed king of Formula 1 in the early 2000s, picking up wins and championships at a rate that was simply unheard of at the time. It was going to take someone very special to topple the Ferrari legend from his throne and that it was Fernando Alonso who did it, tells you all you need to know about the Spaniard.
</p>
</div>
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/C/CARSAI01_Carlos_Sainz/carsai01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>CARLOS SAINZ</h2>
<p>
He's the matador from Madrid racing royalty.
After entering F1's Bull Ring paired alongside Max Verstappen at Toro Rosso in 2015, Sainz quickly showed his fighting spirit. A tenacious racer, he puts the car on the edge as he hustles his way through the pack. No wonder Sainz has earned the nickname Chilli.
</p>
</div>
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/L/LEWHAM01_Lewis_Hamilton/lewham01.png">
<div class="content">
<p>MEET YOUR DRIVER</p>
<h2>LEWIS HAMILTON</h2>
<p>
"Still I Rise" these are the words emblazoned across the back of Lewis Hamilton's helmet and tattooed across his shoulders, and ever since annihilating expectations with one of the greatest rookie performances in F1 history in 2007, that's literally all he's done: risen to the top of the all-time pole positions list ahead of his hero Ayrton Senna, surged into first place in the wins column surpassing the inimitable Michael Schumacher, and then matched the legendary German's seven world titles.
</p>
</div>
</div>
</div>
<div id="prev" class="arrows"></div>
<div id="next" class="arrows"></div>
<!-- thumbnail -->
<div class="thumbnail">
<div class="item active">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/M/MAXVER01_Max_Verstappen/maxver01.png">
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/L/LANNOR01_Lando_Norris/lannor01.png">
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/C/CHALEC01_Charles_Leclerc/chalec01.png">
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/F/FERALO01_Fernando_Alonso/feralo01.png">
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/C/CARSAI01_Carlos_Sainz/carsai01.png">
</div>
<div class="item">
<img src="https://media.formula1.com/d_driver_fallback_image.png/content/dam/fom-website/drivers/L/LEWHAM01_Lewis_Hamilton/lewham01.png">
</div>
</div>
</div>
<script>let items = document.querySelectorAll('.slider .list .item');
let next = document.getElementById('next');
let prev = document.getElementById('prev');
let thumbnails = document.querySelectorAll('.thumbnail .item');
// config param
let countItem = items.length;
let itemActive = 0;
// event next click
next.onclick = function(){
itemActive = itemActive + 1;
if(itemActive >= countItem){
itemActive = 0;
}
showSlider();
}
//event prev click
prev.onclick = function(){
itemActive = itemActive - 1;
if(itemActive < 0){
itemActive = countItem - 1;
}
showSlider();
}
// auto run slider
let refreshInterval = setInterval(() => {
next.click();
}, 50000)
function showSlider(){
// remove item active old
let itemActiveOld = document.querySelector('.slider .list .item.active');
let thumbnailActiveOld = document.querySelector('.thumbnail .item.active');
itemActiveOld.classList.remove('active');
thumbnailActiveOld.classList.remove('active');
// active new item
items[itemActive].classList.add('active');
thumbnails[itemActive].classList.add('active');
setPositionThumbnail();
// clear auto time run slider
clearInterval(refreshInterval);
refreshInterval = setInterval(() => {
next.click();
}, 10000)
}
function setPositionThumbnail () {
let thumbnailActive = document.querySelector('.thumbnail .item.active');
let rect = thumbnailActive.getBoundingClientRect();
if (rect.left < 0 || rect.right > window.innerWidth) {
thumbnailActive.scrollIntoView({ behavior: 'smooth', inline: 'nearest' });
}
}
// click thumbnail
thumbnails.forEach((thumbnail, index) => {
thumbnail.addEventListener('click', () => {
itemActive = index;
showSlider();
})
})
const menuIcon = document.querySelector('#menu-icon');
const navbar = document.querySelector('.navbar');
const navbg = document.querySelector('.nav-bg');
menuIcon.addEventListener('click', () => {
menuIcon.classList.toggle('bx-x');
navbar.classList.toggle('active');
navbg.classList.toggle('active');
});
</script>
</body>
</html>