-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarousel.html
More file actions
127 lines (114 loc) · 3.62 KB
/
carousel.html
File metadata and controls
127 lines (114 loc) · 3.62 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fully Accessible Carousel</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
:root {
/* This controls the overall scale of the drawing */
--unit: 18vmin;
}
body, html {
margin: 0;
min-height: 100dvh;
font-family: "Google Sans", sans-serif;
overflow-x: hidden;
}
body {
display: grid;
place-content: center;
text-align: center;
background-color: #f0f8ff;
}
/* Container for the drawing */
.easter-scene {
position: fixed;
bottom: 20px;
left: 20px;
width: var(--unit);
height: var(--unit);
z-index: 100;
}
/* --- THE BUNNY --- */
.bunny {
position: absolute;
bottom: 0;
width: 70%;
height: 60%;
background: #ffffff;
border-radius: 50% 50% 40% 40%;
border: 2px solid #ddd;
}
.bunny::before, .bunny::after { /* Ears */
content: '';
position: absolute;
top: -45%;
width: 30%;
height: 70%;
background: #ffffff;
border: 2px solid #ddd;
border-radius: 50% 50% 0 0;
z-index: -1;
}
.bunny::before { left: 10%; transform: rotate(-10deg); }
.bunny::after { right: 10%; transform: rotate(10deg); }
.face {
position: absolute;
top: 20%;
width: 100%;
text-align: center;
}
.eyes {
display: inline-block;
width: 8%;
height: 8px;
background: #333;
border-radius: 50%;
margin: 0 10%;
}
.nose {
width: 12%;
height: 8px;
background: #ffb6c1;
border-radius: 50%;
margin: 5% auto;
}
/* --- THE EGGS --- */
.egg {
position: absolute;
width: 30%;
height: 40%;
border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
bottom: 0;
border: 1px solid rgba(0,0,0,0.1);
}
.egg-1 { background: #FF7EB9; right: -10%; transform: rotate(15deg); z-index: 2; }
.egg-2 { background: #7AFCFF; right: 10%; transform: rotate(-5deg); z-index: 1; }
.egg-3 { background: #FFF77A; right: 30%; transform: rotate(-20deg); z-index: 0; }
/* Smooth scaling for very small screens */
@media (max-width: 480px) {
:root { --unit: 30vmin; }
.easter-scene { bottom: 10px; left: 10px; }
}
</style>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
<h1>April Fools</h1>
<h2>Don't use Carousels</h2>
<div class="easter-scene">
<div class="bunny">
<div class="face">
<div class="eyes"></div>
<div class="eyes"></div>
<div class="nose"></div>
</div>
</div>
<div class="egg egg-1"></div>
<div class="egg egg-2"></div>
<div class="egg egg-3"></div>
</div>
</body>
</html>