-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
234 lines (220 loc) · 11.1 KB
/
index.html
File metadata and controls
234 lines (220 loc) · 11.1 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Frog on a Bike 🐸🚲</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="hud">
<div class="control">
<label for="speed">Pedal speed</label>
<input id="speed" type="range" min="0" max="3" step="0.05" value="1.2" />
<span id="speedVal">1.2×</span>
</div>
<button id="toggle">Pause</button>
<button id="bell" aria-label="Ring bell" title="Ring bell (B)">Bell</button>
</div>
<div class="scene">
<svg id="world" viewBox="0 0 800 320" role="img" aria-label="Cartoon frog riding a bicycle">
<!-- sky and ground -->
<defs>
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#b4e3ff" />
<stop offset="100%" stop-color="#e6f7ff" />
</linearGradient>
<linearGradient id="grass" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#9ae66e" />
<stop offset="100%" stop-color="#66c84a" />
</linearGradient>
<pattern id="roadStripe" width="20" height="6" patternUnits="userSpaceOnUse">
<rect width="12" height="6" fill="#fff" />
</pattern>
<radialGradient id="bellyGrad" cx="50%" cy="60%" r="60%">
<stop offset="0%" stop-color="#bff6b8"/>
<stop offset="100%" stop-color="#83da76"/>
</radialGradient>
<linearGradient id="backShade" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#50bf55"/>
<stop offset="40%" stop-color="#67d36b"/>
<stop offset="100%" stop-color="#67d36b"/>
</linearGradient>
<filter id="frogShadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="2" stdDeviation="2" flood-color="#000" flood-opacity="0.25"/>
</filter>
</defs>
<rect x="0" y="0" width="800" height="240" fill="url(#sky)" />
<rect x="0" y="240" width="800" height="80" fill="url(#grass)" />
<rect x="0" y="268" width="800" height="22" fill="#3f3f54" />
<rect x="0" y="278" width="800" height="2" fill="#2b2b3a" />
<rect x="0" y="279" width="800" height="4" fill="url(#roadStripe)" opacity="0.6" />
<!-- simple clouds -->
<g class="cloud" transform="translate(100,50)">
<circle r="14" cx="0" cy="0" fill="#fff" />
<circle r="16" cx="18" cy="-5" fill="#fff" />
<circle r="12" cx="34" cy="0" fill="#fff" />
<circle r="10" cx="18" cy="6" fill="#fff" />
</g>
<g class="cloud" transform="translate(520,70)">
<circle r="12" cx="0" cy="0" fill="#fff" />
<circle r="16" cx="16" cy="-6" fill="#fff" />
<circle r="10" cx="30" cy="0" fill="#fff" />
</g>
<!-- Parallax background layers -->
<g id="bg-layer-far" class="parallax far" transform="translate(0,0)">
<path d="M0 190 Q120 160 220 180 T440 190 T800 180 L800 240 L0 240 Z" fill="#a8d2ff" opacity="0.7"/>
</g>
<g id="bg-layer-mid" class="parallax mid" transform="translate(0,0)">
<path d="M0 210 Q100 190 220 205 T440 210 T800 205 L800 240 L0 240 Z" fill="#9bd98b" opacity="0.9"/>
<g fill="#6dbb5c" opacity="0.95">
<rect x="60" y="200" width="8" height="22" rx="2"/>
<circle cx="64" cy="198" r="10"/>
<rect x="180" y="202" width="9" height="20" rx="2"/>
<circle cx="184" cy="199" r="9"/>
<rect x="420" y="203" width="7" height="18" rx="2"/>
<circle cx="424" cy="201" r="8"/>
</g>
</g>
<g id="bg-layer-near" class="parallax near" transform="translate(0,0)">
<path d="M0 228 Q80 220 160 226 T320 228 T480 226 T640 228 T800 226 L800 240 L0 240 Z" fill="#5daa4a"/>
<g fill="#4c8f3e">
<rect x="100" y="214" width="10" height="24" rx="2"/>
<circle cx="105" cy="210" r="12"/>
<rect x="300" y="215" width="10" height="24" rx="2"/>
<circle cx="305" cy="211" r="11"/>
<rect x="560" y="216" width="9" height="22" rx="2"/>
<circle cx="564" cy="213" r="10"/>
</g>
</g>
<!-- the rig (bike + frog) that moves across the scene -->
<g id="rig" transform="translate(20,0)">
<!-- BIKE -->
<g id="bike" stroke="#111" stroke-width="5" stroke-linecap="round" fill="none">
<!-- wheels -->
<g id="wheel-back" transform="translate(230,240)">
<circle r="36" fill="#1b1b1b" />
<circle r="30" fill="#2a2a2a" stroke="#111" stroke-width="3" />
<g class="spokes" stroke="#e8e8e8" stroke-width="2" opacity="0.7">
<line x1="0" y1="0" x2="30" y2="0" />
<line x1="0" y1="0" x2="-30" y2="0" />
<line x1="0" y1="0" x2="0" y2="30" />
<line x1="0" y1="0" x2="0" y2="-30" />
<line x1="0" y1="0" x2="21" y2="21" />
<line x1="0" y1="0" x2="-21" y2="21" />
<line x1="0" y1="0" x2="21" y2="-21" />
<line x1="0" y1="0" x2="-21" y2="-21" />
</g>
<circle r="4" fill="#111" />
</g>
<g id="wheel-front" transform="translate(350,240)">
<circle r="36" fill="#1b1b1b" />
<circle r="30" fill="#2a2a2a" stroke="#111" stroke-width="3" />
<g class="spokes" stroke="#e8e8e8" stroke-width="2" opacity="0.7">
<line x1="0" y1="0" x2="30" y2="0" />
<line x1="0" y1="0" x2="-30" y2="0" />
<line x1="0" y1="0" x2="0" y2="30" />
<line x1="0" y1="0" x2="0" y2="-30" />
<line x1="0" y1="0" x2="21" y2="21" />
<line x1="0" y1="0" x2="-21" y2="21" />
<line x1="0" y1="0" x2="21" y2="-21" />
<line x1="0" y1="0" x2="-21" y2="-21" />
</g>
<circle r="4" fill="#111" />
</g>
<!-- frame (stylized) -->
<g id="frame" stroke="#2d73ff" stroke-width="6">
<line x1="230" y1="240" x2="280" y2="230" />
<line x1="280" y1="230" x2="350" y2="240" />
<line x1="280" y1="230" x2="270" y2="195" />
<line x1="330" y1="210" x2="350" y2="240" />
<line x1="270" y1="195" x2="330" y2="210" />
</g>
<!-- seat and handlebar -->
<rect x="258" y="188" width="32" height="10" rx="6" fill="#111" />
<g id="handle" stroke="#111" stroke-width="6">
<line x1="330" y1="210" x2="350" y2="178" />
<line x1="350" y1="178" x2="365" y2="176" />
<line x1="350" y1="178" x2="337" y2="172" />
</g>
<!-- crank + pedals (rotates) -->
<g id="crank" transform="translate(280,230)">
<circle r="6" fill="#111" />
<!-- rotated in JS -->
<g id="crank-rotor">
<line x1="0" y1="0" x2="24" y2="0" stroke="#111" stroke-width="5" />
<rect id="pedal-left" x="28" y="-6" width="18" height="12" rx="3" fill="#111" />
<line x1="0" y1="0" x2="-24" y2="0" stroke="#111" stroke-width="5" />
<rect id="pedal-right" x="-46" y="-6" width="18" height="12" rx="3" fill="#111" />
</g>
</g>
</g>
<!-- FROG with subtle shading and details -->
<g id="frog" stroke="#111" stroke-width="3" stroke-linecap="round" filter="url(#frogShadow)">
<!-- body with back shading and belly gradient -->
<ellipse cx="275" cy="178" rx="28" ry="22" fill="url(#backShade)" />
<ellipse cx="275" cy="182" rx="20" ry="14" fill="url(#bellyGrad)" stroke="#111" stroke-width="2" opacity="0.9" />
<!-- spots -->
<circle cx="265" cy="176" r="4" fill="#111" />
<circle cx="282" cy="186" r="3" fill="#111" />
<circle cx="286" cy="170" r="3.5" fill="#111" />
<!-- head -->
<g id="head">
<ellipse cx="295" cy="160" rx="18" ry="14" fill="#67d36b" />
<circle cx="288" cy="155" r="6" fill="#fff" />
<circle cx="303" cy="155" r="6" fill="#fff" />
<circle cx="288" cy="155" r="2.5" fill="#111" />
<circle cx="303" cy="155" r="2.5" fill="#111" />
<!-- eyelids for blinking (animated in CSS) -->
<rect id="lidL" x="282" y="149" width="12" height="12" rx="6" fill="#67d36b" opacity="0" />
<rect id="lidR" x="297" y="149" width="12" height="12" rx="6" fill="#67d36b" opacity="0" />
<path d="M288 165 Q296 170 304 165" fill="none" stroke="#111" stroke-width="2" />
<!-- nostrils -->
<circle cx="294" cy="160" r="1.2" fill="#111" />
<circle cx="298" cy="160" r="1.2" fill="#111" />
</g>
<!-- arms to handlebar -->
<g id="arms" stroke="#111">
<line x1="273" y1="175" x2="343" y2="176" />
<circle cx="343" cy="176" r="5" fill="#67d36b" />
<line x1="275" y1="183" x2="337" y2="172" />
<circle cx="337" cy="172" r="5" fill="#67d36b" />
</g>
<!-- legs (animated with IK to pedals) with simple toes -->
<g id="legs" fill="#67d36b">
<!-- left leg -->
<g id="legL" transform="translate(270,182)">
<g id="legL-thigh" transform="rotate(0)">
<rect x="0" y="-4" width="46" height="8" rx="4" />
<g id="legL-knee" transform="translate(46,0) rotate(0)">
<rect x="0" y="-4" width="46" height="8" rx="4" />
<g id="legL-foot" transform="translate(46,0) rotate(0)">
<ellipse cx="6" cy="0" rx="10" ry="6" fill="#67d36b" stroke="#111" stroke-width="3" />
<circle cx="14" cy="-2" r="1.5" fill="#111" />
<circle cx="14" cy="2" r="1.5" fill="#111" />
</g>
</g>
</g>
</g>
<!-- right leg -->
<g id="legR" transform="translate(270,182)">
<g id="legR-thigh" transform="rotate(0)">
<rect x="0" y="-4" width="46" height="8" rx="4" />
<g id="legR-knee" transform="translate(46,0) rotate(0)">
<rect x="0" y="-4" width="46" height="8" rx="4" />
<g id="legR-foot" transform="translate(46,0) rotate(0)">
<ellipse cx="6" cy="0" rx="10" ry="6" fill="#67d36b" stroke="#111" stroke-width="3" />
<circle cx="14" cy="-2" r="1.5" fill="#111" />
<circle cx="14" cy="2" r="1.5" fill="#111" />
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
<script src="script.js"></script>
</body>
</html>