samirerty commited on
Commit
563d51c
·
verified ·
1 Parent(s): ae4edd8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +651 -445
index.html CHANGED
@@ -1,460 +1,666 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
 
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Liquid Glass Apple</title>
7
- <link rel="preconnect" href="https://fonts.googleapis.com">
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&display=swap" rel="stylesheet">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- <style>
12
- :root {
13
- --primary-hue: 350;
14
- --glass-bg: rgba(255, 255, 255, 0.05);
15
- --glass-border: rgba(255, 255, 255, 0.2);
16
- --glass-highlight: rgba(255, 255, 255, 0.4);
17
- --blur-strength: 20px;
18
- --anim-speed: 8s;
19
- --distortion: 30px;
20
- }
21
-
22
- * {
23
- box-sizing: border-box;
24
- margin: 0;
25
- padding: 0;
26
- }
27
-
28
- body {
29
- font-family: 'Outfit', sans-serif;
30
- background-color: #050505;
31
- color: white;
32
- min-height: 100vh;
33
- display: flex;
34
- flex-direction: column;
35
- overflow-x: hidden;
36
- position: relative;
37
- }
38
-
39
- /* Ambient Animated Background */
40
- .ambient-bg {
41
- position: fixed;
42
- top: 0;
43
- left: 0;
44
- width: 100%;
45
- height: 100%;
46
- z-index: -1;
47
- background: radial-gradient(circle at 50% 50%, #1a1a2e, #000);
48
- }
49
-
50
- .blob {
51
- position: absolute;
52
- border-radius: 50%;
53
- filter: blur(80px);
54
- opacity: 0.6;
55
- animation: float 20s infinite alternate;
56
- }
57
-
58
- .blob-1 {
59
- width: 400px;
60
- height: 400px;
61
- background: hsl(var(--primary-hue), 70%, 50%);
62
- top: 10%;
63
- left: 20%;
64
- animation-duration: 25s;
65
- }
66
-
67
- .blob-2 {
68
- width: 300px;
69
- height: 300px;
70
- background: #4facfe;
71
- bottom: 20%;
72
- right: 20%;
73
- animation-duration: 18s;
74
- }
75
-
76
- .blob-3 {
77
- width: 200px;
78
- height: 200px;
79
- background: #00f260;
80
- top: 40%;
81
- left: 60%;
82
- animation-duration: 22s;
83
- }
84
-
85
- @keyframes float {
86
- 0% { transform: translate(0, 0) scale(1); }
87
- 100% { transform: translate(50px, -50px) scale(1.2); }
88
- }
89
-
90
- /* Header */
91
- header {
92
- padding: 2rem;
93
- display: flex;
94
- justify-content: space-between;
95
- align-items: center;
96
- z-index: 10;
97
- }
98
-
99
- .brand {
100
- font-size: 1.5rem;
101
- font-weight: 700;
102
- letter-spacing: -1px;
103
- background: linear-gradient(to right, #fff, #aaa);
104
- -webkit-background-clip: text;
105
- -webkit-text-fill-color: transparent;
106
- }
107
-
108
- .anycoder-link {
109
- font-size: 0.9rem;
110
- color: rgba(255, 255, 255, 0.7);
111
- text-decoration: none;
112
- border-bottom: 1px solid rgba(255, 255, 255, 0.3);
113
- transition: all 0.3s ease;
114
- }
115
-
116
- .anycoder-link:hover {
117
- color: #fff;
118
- border-color: #fff;
119
- }
120
-
121
- /* Main Content */
122
- main {
123
- flex: 1;
124
- display: flex;
125
- flex-direction: column;
126
- align-items: center;
127
- justify-content: center;
128
- padding: 2rem;
129
- position: relative;
130
- }
131
-
132
- .showcase-container {
133
- position: relative;
134
- width: 100%;
135
- max-width: 800px;
136
- height: 60vh;
137
- display: flex;
138
- align-items: center;
139
- justify-content: center;
140
- }
141
-
142
- /* The Liquid Glass Apple */
143
- .glass-apple-wrapper {
144
- position: relative;
145
- width: 300px;
146
- height: 350px;
147
- display: flex;
148
- justify-content: center;
149
- align-items: center;
150
- filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.1));
151
- }
152
-
153
- .apple-body {
154
- width: 280px;
155
- height: 280px;
156
- background: var(--glass-bg);
157
- backdrop-filter: blur(var(--blur-strength));
158
- -webkit-backdrop-filter: blur(var(--blur-strength));
159
- border: 1px solid var(--glass-border);
160
- border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
161
- position: relative;
162
- z-index: 2;
163
- box-shadow:
164
- inset 10px 10px 20px rgba(255, 255, 255, 0.05),
165
- inset -10px -10px 20px rgba(0, 0, 0, 0.1),
166
- 0 20px 50px rgba(0, 0, 0, 0.3);
167
- animation: liquid-morph var(--anim-speed) ease-in-out infinite;
168
- overflow: hidden;
169
- transition: border-color 0.3s;
170
- }
171
-
172
- /* Inner moving gradient for "Liquid" feel */
173
- .apple-body::before {
174
- content: '';
175
- position: absolute;
176
- top: -50%;
177
- left: -50%;
178
- width: 200%;
179
- height: 200%;
180
- background: conic-gradient(
181
- from 0deg,
182
- transparent 0deg,
183
- rgba(255,255,255,0.1) 60deg,
184
- transparent 120deg,
185
- rgba(255,255,255,0.05) 180deg,
186
- transparent 240deg,
187
- rgba(255,255,255,0.1) 300deg,
188
- transparent 360deg
189
- );
190
- animation: rotate-gradient 10s linear infinite;
191
- }
192
-
193
- .apple-body::after {
194
- content: '';
195
- position: absolute;
196
- top: 10%;
197
- left: 15%;
198
- width: 20%;
199
- height: 15%;
200
- border-radius: 50%;
201
- background: radial-gradient(circle, #fff, transparent);
202
- filter: blur(5px);
203
- opacity: 0.6;
204
- transform: rotate(-45deg);
205
- }
206
-
207
- /* Stem */
208
- .stem {
209
- position: absolute;
210
- top: -30px;
211
- left: 50%;
212
- transform: translateX(-50%);
213
- width: 8px;
214
- height: 40px;
215
- background: rgba(255, 255, 255, 0.3);
216
- border-radius: 4px;
217
- z-index: 1;
218
- backdrop-filter: blur(5px);
219
- border: 1px solid rgba(255, 255, 255, 0.1);
220
- box-shadow: 0 4px 10px rgba(0,0,0,0.1);
221
- animation: stem-wobble var(--anim-speed) ease-in-out infinite;
222
- }
223
-
224
- /* Leaf */
225
- .leaf {
226
- position: absolute;
227
- top: -40px;
228
- left: 55%;
229
- width: 50px;
230
- height: 30px;
231
- background: rgba(255, 255, 255, 0.2);
232
- border-radius: 0 50% 0 50%;
233
- z-index: 0;
234
- backdrop-filter: blur(5px);
235
- border: 1px solid rgba(255, 255, 255, 0.1);
236
- transform: rotate(-15deg);
237
- animation: leaf-flutter var(--anim-speed) ease-in-out infinite;
238
- }
239
-
240
- .leaf::after {
241
- content: '';
242
- position: absolute;
243
- top: 50%;
244
- left: 0;
245
- width: 100%;
246
- height: 1px;
247
- background: rgba(255, 255, 255, 0.2);
248
- transform: rotate(-15deg);
249
- }
250
-
251
- /* Animations */
252
- @keyframes liquid-morph {
253
- 0%, 100% {
254
- border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
255
- transform: translateY(0) scale(1);
256
- }
257
- 25% {
258
- border-radius: 55% 45% 55% 45% / 55% 65% 35% 45%;
259
- transform: translateY(-5px) scale(1.02);
260
- }
261
- 50% {
262
- border-radius: 45% 55% 45% 55% / 65% 35% 65% 35%;
263
- transform: translateY(0) scale(0.98);
264
- }
265
- 75% {
266
- border-radius: 50% 50% 55% 45% / 50% 60% 40% 50%;
267
- transform: translateY(5px) scale(1.01);
268
- }
269
- }
270
-
271
- @keyframes rotate-gradient {
272
- 0% { transform: rotate(0deg); }
273
- 100% { transform: rotate(360deg); }
274
- }
275
-
276
- @keyframes stem-wobble {
277
- 0%, 100% { transform: translateX(-50%) rotate(0deg); }
278
- 50% { transform: translateX(-50%) rotate(5deg); }
279
- }
280
-
281
- @keyframes leaf-flutter {
282
- 0%, 100% { transform: rotate(-15deg) scale(1); }
283
- 50% { transform: rotate(-10deg) scale(1.05); }
284
- }
285
-
286
- /* Controls Panel */
287
- .controls {
288
- background: rgba(0, 0, 0, 0.4);
289
- backdrop-filter: blur(20px);
290
- border: 1px solid rgba(255, 255, 255, 0.1);
291
- padding: 2rem;
292
- border-radius: 20px;
293
- width: 100%;
294
- max-width: 500px;
295
- margin-top: 2rem;
296
- display: grid;
297
- gap: 1.5rem;
298
- box-shadow: 0 10px 30px rgba(0,0,0,0.5);
299
- }
300
-
301
- .control-group {
302
- display: flex;
303
- flex-direction: column;
304
- gap: 0.5rem;
305
- }
306
-
307
- .control-label {
308
- font-size: 0.9rem;
309
- color: #aaa;
310
- display: flex;
311
- justify-content: space-between;
312
- }
313
-
314
- input[type="range"] {
315
- -webkit-appearance: none;
316
- width: 100%;
317
- height: 6px;
318
- background: rgba(255, 255, 255, 0.1);
319
- border-radius: 3px;
320
- outline: none;
321
- }
322
-
323
- input[type="range"]::-webkit-slider-thumb {
324
- -webkit-appearance: none;
325
- width: 18px;
326
- height: 18px;
327
- background: #fff;
328
- border-radius: 50%;
329
- cursor: pointer;
330
- box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
331
- transition: transform 0.2s;
332
- }
333
-
334
- input[type="range"]::-webkit-slider-thumb:hover {
335
- transform: scale(1.2);
336
- }
337
-
338
- /* Responsive */
339
- @media (max-width: 768px) {
340
- .glass-apple-wrapper {
341
- transform: scale(0.8);
342
- }
343
- .controls {
344
- padding: 1.5rem;
345
- }
346
- }
347
- </style>
348
  </head>
 
349
  <body>
350
 
351
- <div class="ambient-bg">
352
- <div class="blob blob-1"></div>
353
- <div class="blob blob-2"></div>
354
- <div class="blob blob-3"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  </div>
356
 
357
- <header>
358
- <div class="brand">Liquid Glass</div>
359
- <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">Built with anycoder</a>
360
- </header>
361
-
362
- <main>
363
- <div class="showcase-container">
364
- <div class="glass-apple-wrapper">
365
- <div class="stem"></div>
366
- <div class="leaf"></div>
367
- <div class="apple-body"></div>
368
- </div>
 
369
  </div>
 
 
370
 
371
- <div class="controls">
372
- <div class="control-group">
373
- <div class="control-label">
374
- <span>Liquid Speed</span>
375
- <span id="speed-val">1x</span>
376
- </div>
377
- <input type="range" id="speed" min="1" max="10" value="5" step="0.5">
378
- </div>
379
-
380
- <div class="control-group">
381
- <div class="control-label">
382
- <span>Glass Blur</span>
383
- <span id="blur-val">20px</span>
384
- </div>
385
- <input type="range" id="blur" min="0" max="50" value="20">
386
- </div>
387
-
388
- <div class="control-group">
389
- <div class="control-label">
390
- <span>Ambient Hue</span>
391
- <span id="hue-val">350°</span>
392
- </div>
393
- <input type="range" id="hue" min="0" max="360" value="350">
394
- </div>
395
  </div>
396
- </main>
397
-
398
- <script>
399
- // DOM Elements
400
- const root = document.documentElement;
401
- const speedInput = document.getElementById('speed');
402
- const blurInput = document.getElementById('blur');
403
- const hueInput = document.getElementById('hue');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
 
405
- const speedVal = document.getElementById('speed-val');
406
- const blurVal = document.getElementById('blur-val');
407
- const hueVal = document.getElementById('hue-val');
408
-
409
- // Update Function
410
- function updateLiquidGlass() {
411
- // Speed calculation: Higher value = faster (lower seconds)
412
- // Base is 8s. Range 1-10.
413
- // 1 -> 16s, 10 -> 2s roughly
414
- const rawSpeed = parseFloat(speedInput.value);
415
- const duration = 18 - (rawSpeed * 1.5);
416
-
417
- root.style.setProperty('--anim-speed', `${duration}s`);
418
- speedVal.textContent = `${rawSpeed}x`;
419
-
420
- // Blur calculation
421
- const blurValPx = blurInput.value;
422
- root.style.setProperty('--blur-strength', `${blurValPx}px`);
423
- blurVal.textContent = `${blurValPx}px`;
424
-
425
- // Hue calculation
426
- const hueDeg = hueInput.value;
427
- root.style.setProperty('--primary-hue', hueDeg);
428
- hueVal.textContent = `${hueDeg}°`;
429
- }
430
-
431
- // Event Listeners
432
- speedInput.addEventListener('input', updateLiquidGlass);
433
- blurInput.addEventListener('input', updateLiquidGlass);
434
- hueInput.addEventListener('input', updateLiquidGlass);
435
-
436
- // Initial Call
437
- updateLiquidGlass();
438
-
439
- // Interactive Parallax Effect on Mouse Move
440
- document.addEventListener('mousemove', (e) => {
441
- const x = e.clientX / window.innerWidth;
442
- const y = e.clientY / window.innerHeight;
443
-
444
- const apple = document.querySelector('.glass-apple-wrapper');
445
-
446
- // Subtle rotation based on mouse position
447
- const rotateX = (y - 0.5) * 20; // -10 to 10 deg
448
- const rotateY = (x - 0.5) * 20; // -10 to 10 deg
449
-
450
- apple.style.transform = `perspective(1000px) rotateX(${-rotateX}deg) rotateY(${rotateY}deg)`;
451
- });
452
-
453
- // Reset on mouse leave
454
- document.addEventListener('mouseleave', () => {
455
- const apple = document.querySelector('.glass-apple-wrapper');
456
- apple.style.transform = `perspective(1000px) rotateX(0deg) rotateY(0deg)`;
457
- });
458
- </script>
459
  </body>
 
460
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+
4
  <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Liquid Glass Apple | Interactive Showcase</title>
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap" rel="stylesheet">
11
+
12
+ <style>
13
+ :root {
14
+ /* Core Variables */
15
+ --primary-hue: 350;
16
+ --glass-bg: rgba(255, 255, 255, 0.03);
17
+ --glass-border: rgba(255, 255, 255, 0.15);
18
+ --glass-highlight: rgba(255, 255, 255, 0.6);
19
+ --blur-strength: 24px;
20
+ --anim-speed: 8s;
21
+ --noise-opacity: 0.04;
22
+
23
+ /* Interactive Variables (Updated via JS) */
24
+ --mouse-x: 50%;
25
+ --mouse-y: 50%;
26
+ --rotate-x: 0deg;
27
+ --rotate-y: 0deg;
28
+ }
29
+
30
+ * {
31
+ box-sizing: border-box;
32
+ margin: 0;
33
+ padding: 0;
34
+ -webkit-font-smoothing: antialiased;
35
+ }
36
+
37
+ body {
38
+ font-family: 'Outfit', sans-serif;
39
+ background-color: #050505;
40
+ color: white;
41
+ min-height: 100vh;
42
+ display: flex;
43
+ flex-direction: column;
44
+ overflow-x: hidden;
45
+ position: relative;
46
+ }
47
+
48
+ /* Noise Texture for Realism */
49
+ .noise-overlay {
50
+ position: fixed;
51
+ top: 0;
52
+ left: 0;
53
+ width: 100%;
54
+ height: 100%;
55
+ pointer-events: none;
56
+ z-index: 50;
57
+ opacity: var(--noise-opacity);
58
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
59
+ }
60
+
61
+ /* Ambient Animated Background */
62
+ .ambient-bg {
63
+ position: fixed;
64
+ top: 0;
65
+ left: 0;
66
+ width: 100%;
67
+ height: 100%;
68
+ z-index: -2;
69
+ background: radial-gradient(circle at 50% 50%, #1a1a2e, #000);
70
+ overflow: hidden;
71
+ }
72
+
73
+ .blob {
74
+ position: absolute;
75
+ border-radius: 50%;
76
+ filter: blur(90px);
77
+ opacity: 0.5;
78
+ mix-blend-mode: screen;
79
+ animation: float 20s infinite alternate ease-in-out;
80
+ }
81
+
82
+ .blob-1 {
83
+ width: 50vw;
84
+ height: 50vw;
85
+ background: hsl(var(--primary-hue), 80%, 40%);
86
+ top: -10%;
87
+ left: -10%;
88
+ animation-duration: 25s;
89
+ }
90
+
91
+ .blob-2 {
92
+ width: 40vw;
93
+ height: 40vw;
94
+ background: #4facfe;
95
+ bottom: -10%;
96
+ right: -10%;
97
+ animation-duration: 18s;
98
+ animation-delay: -5s;
99
+ }
100
+
101
+ .blob-3 {
102
+ width: 25vw;
103
+ height: 25vw;
104
+ background: #00f260;
105
+ top: 30%;
106
+ left: 40%;
107
+ animation-duration: 22s;
108
+ animation-delay: -10s;
109
+ }
110
+
111
+ @keyframes float {
112
+ 0% { transform: translate(0, 0) rotate(0deg) scale(1); }
113
+ 33% { transform: translate(30px, -50px) rotate(10deg) scale(1.1); }
114
+ 66% { transform: translate(-20px, 20px) rotate(-5deg) scale(0.95); }
115
+ 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
116
+ }
117
+
118
+ /* Header */
119
+ header {
120
+ padding: 2rem;
121
+ display: flex;
122
+ justify-content: space-between;
123
+ align-items: center;
124
+ z-index: 10;
125
+ width: 100%;
126
+ max-width: 1200px;
127
+ margin: 0 auto;
128
+ }
129
+
130
+ .brand {
131
+ font-size: 1.5rem;
132
+ font-weight: 800;
133
+ letter-spacing: -0.05em;
134
+ background: linear-gradient(135deg, #fff 0%, #aaa 100%);
135
+ -webkit-background-clip: text;
136
+ -webkit-text-fill-color: transparent;
137
+ position: relative;
138
+ }
139
+
140
+ .brand::after {
141
+ content: '';
142
+ position: absolute;
143
+ bottom: -5px;
144
+ left: 0;
145
+ width: 40px;
146
+ height: 2px;
147
+ background: var(--glass-highlight);
148
+ border-radius: 2px;
149
+ }
150
+
151
+ .anycoder-link {
152
+ font-size: 0.9rem;
153
+ font-weight: 500;
154
+ color: rgba(255, 255, 255, 0.6);
155
+ text-decoration: none;
156
+ padding: 0.5rem 1rem;
157
+ border: 1px solid rgba(255, 255, 255, 0.1);
158
+ border-radius: 50px;
159
+ transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
160
+ background: rgba(255, 255, 255, 0.02);
161
+ }
162
+
163
+ .anycoder-link:hover {
164
+ color: #fff;
165
+ border-color: rgba(255, 255, 255, 0.4);
166
+ background: rgba(255, 255, 255, 0.1);
167
+ transform: translateY(-2px);
168
+ }
169
+
170
+ /* Main Content */
171
+ main {
172
+ flex: 1;
173
+ display: flex;
174
+ flex-direction: column;
175
+ align-items: center;
176
+ justify-content: center;
177
+ padding: 1rem 2rem 4rem;
178
+ position: relative;
179
+ z-index: 1;
180
+ width: 100%;
181
+ max-width: 1200px;
182
+ margin: 0 auto;
183
+ }
184
+
185
+ .showcase-container {
186
+ position: relative;
187
+ width: 100%;
188
+ height: 55vh;
189
+ display: flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ perspective: 1200px; /* Essential for 3D rotation */
193
+ }
194
+
195
+ /* The Liquid Glass Apple Wrapper */
196
+ .glass-apple-wrapper {
197
+ position: relative;
198
+ width: 320px;
199
+ height: 380px;
200
+ display: flex;
201
+ justify-content: center;
202
+ align-items: center;
203
+ /* Use CSS variables for smooth parallax */
204
+ transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
205
+ transform-style: preserve-3d;
206
+ transition: transform 0.1s linear; /* Smooth micro-adjustments */
207
+ cursor: pointer;
208
+ -webkit-tap-highlight-color: transparent;
209
+ }
210
+
211
+ /* Interactive "Squish" class */
212
+ .glass-apple-wrapper.squish {
213
+ animation: squish-effect 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
214
+ }
215
+
216
+ @keyframes squish-effect {
217
+ 0% { transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) scale(1); }
218
+ 40% { transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) scale(0.92, 1.05); }
219
+ 70% { transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) scale(1.02, 0.98); }
220
+ 100% { transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) scale(1); }
221
+ }
222
+
223
+ .apple-body {
224
+ width: 280px;
225
+ height: 280px;
226
+ background: var(--glass-bg);
227
+ backdrop-filter: blur(var(--blur-strength));
228
+ -webkit-backdrop-filter: blur(var(--blur-strength));
229
+ border: 1px solid var(--glass-border);
230
+ border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
231
+ position: relative;
232
+ z-index: 2;
233
+ /* Complex shadow for depth */
234
+ box-shadow:
235
+ inset 10px 10px 20px rgba(255, 255, 255, 0.05),
236
+ inset -10px -10px 30px rgba(0, 0, 0, 0.2),
237
+ 0 30px 60px rgba(0, 0, 0, 0.4),
238
+ 0 0 0 1px rgba(255, 255, 255, 0.05); /* Subtle inner stroke */
239
+ animation: liquid-morph var(--anim-speed) ease-in-out infinite;
240
+ overflow: hidden;
241
+ }
242
+
243
+ /* Inner moving gradient for "Liquid" feel */
244
+ .apple-body::before {
245
+ content: '';
246
+ position: absolute;
247
+ top: -50%;
248
+ left: -50%;
249
+ width: 200%;
250
+ height: 200%;
251
+ background: conic-gradient(
252
+ from 0deg,
253
+ transparent 0deg,
254
+ rgba(255, 255, 255, 0.08) 60deg,
255
+ transparent 120deg,
256
+ rgba(255, 255, 255, 0.03) 180deg,
257
+ transparent 240deg,
258
+ rgba(255, 255, 255, 0.08) 300deg,
259
+ transparent 360deg
260
+ );
261
+ animation: rotate-gradient 12s linear infinite;
262
+ mix-blend-mode: overlay;
263
+ }
264
+
265
+ /* The main highlight (specular reflection) */
266
+ .apple-body::after {
267
+ content: '';
268
+ position: absolute;
269
+ top: 15%;
270
+ left: 15%;
271
+ width: 25%;
272
+ height: 15%;
273
+ border-radius: 50%;
274
+ background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.1) 60%, transparent 80%);
275
+ filter: blur(8px);
276
+ opacity: 0.8;
277
+ transform: rotate(-45deg);
278
+ pointer-events: none;
279
+ }
280
+
281
+ /* Dynamic Mouse-following highlight */
282
+ .dynamic-reflection {
283
+ position: absolute;
284
+ top: 0;
285
+ left: 0;
286
+ right: 0;
287
+ bottom: 0;
288
+ border-radius: inherit;
289
+ background: radial-gradient(
290
+ circle at var(--mouse-x) var(--mouse-y),
291
+ rgba(255, 255, 255, 0.15) 0%,
292
+ transparent 40%
293
+ );
294
+ z-index: 3;
295
+ pointer-events: none;
296
+ mix-blend-mode: overlay;
297
+ }
298
+
299
+ /* Stem */
300
+ .stem {
301
+ position: absolute;
302
+ top: -35px;
303
+ left: 50%;
304
+ transform: translateX(-50%);
305
+ width: 10px;
306
+ height: 45px;
307
+ background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.4), rgba(255,255,255,0.1));
308
+ border-radius: 5px;
309
+ z-index: 1;
310
+ backdrop-filter: blur(10px);
311
+ border: 1px solid rgba(255, 255, 255, 0.15);
312
+ box-shadow: 0 5px 15px rgba(0,0,0,0.2);
313
+ animation: stem-wobble var(--anim-speed) ease-in-out infinite;
314
+ }
315
+
316
+ /* Leaf */
317
+ .leaf {
318
+ position: absolute;
319
+ top: -45px;
320
+ left: 55%;
321
+ width: 60px;
322
+ height: 35px;
323
+ background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
324
+ border-radius: 0 60% 0 60%;
325
+ z-index: 0;
326
+ backdrop-filter: blur(10px);
327
+ border: 1px solid rgba(255, 255, 255, 0.2);
328
+ transform-origin: bottom left;
329
+ animation: leaf-flutter var(--anim-speed) ease-in-out infinite;
330
+ box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
331
+ }
332
+
333
+ .leaf::before {
334
+ content: '';
335
+ position: absolute;
336
+ top: 50%;
337
+ left: 0;
338
+ width: 100%;
339
+ height: 1px;
340
+ background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
341
+ transform: rotate(-12deg);
342
+ }
343
+
344
+ /* Animations */
345
+ @keyframes liquid-morph {
346
+ 0%, 100% {
347
+ border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
348
+ transform: translateY(0) scale(1);
349
+ }
350
+ 25% {
351
+ border-radius: 55% 45% 55% 45% / 55% 65% 35% 45%;
352
+ transform: translateY(-8px) scale(1.02, 0.98);
353
+ }
354
+ 50% {
355
+ border-radius: 45% 55% 45% 55% / 65% 35% 65% 35%;
356
+ transform: translateY(0) scale(0.98, 1.02);
357
+ }
358
+ 75% {
359
+ border-radius: 50% 50% 55% 45% / 50% 60% 40% 50%;
360
+ transform: translateY(5px) scale(1.01, 0.99);
361
+ }
362
+ }
363
+
364
+ @keyframes rotate-gradient {
365
+ from { transform: rotate(0deg); }
366
+ to { transform: rotate(360deg); }
367
+ }
368
+
369
+ @keyframes stem-wobble {
370
+ 0%, 100% { transform: translateX(-50%) rotate(-2deg); }
371
+ 50% { transform: translateX(-50%) rotate(3deg); }
372
+ }
373
+
374
+ @keyframes leaf-flutter {
375
+ 0%, 100% { transform: rotate(-15deg) scale(1); }
376
+ 50% { transform: rotate(-5deg) scale(1.05) skewX(5deg); }
377
+ }
378
+
379
+ /* Controls Panel */
380
+ .controls {
381
+ background: rgba(20, 20, 20, 0.5);
382
+ backdrop-filter: blur(30px);
383
+ -webkit-backdrop-filter: blur(30px);
384
+ border: 1px solid rgba(255, 255, 255, 0.08);
385
+ padding: 2rem;
386
+ border-radius: 24px;
387
+ width: 100%;
388
+ max-width: 540px;
389
+ margin-top: 1rem;
390
+ display: grid;
391
+ gap: 1.8rem;
392
+ box-shadow:
393
+ 0 20px 40px rgba(0, 0, 0, 0.4),
394
+ inset 0 1px 0 rgba(255, 255, 255, 0.05);
395
+ }
396
+
397
+ .control-group {
398
+ display: flex;
399
+ flex-direction: column;
400
+ gap: 0.8rem;
401
+ position: relative;
402
+ }
403
+
404
+ .control-label {
405
+ font-size: 0.85rem;
406
+ font-weight: 600;
407
+ color: #ccc;
408
+ display: flex;
409
+ justify-content: space-between;
410
+ letter-spacing: 0.5px;
411
+ text-transform: uppercase;
412
+ }
413
+
414
+ .value-display {
415
+ font-family: monospace;
416
+ color: var(--glass-highlight);
417
+ }
418
+
419
+ /* Modern Range Input Styling */
420
+ input[type="range"] {
421
+ -webkit-appearance: none;
422
+ width: 100%;
423
+ height: 6px;
424
+ background: rgba(255, 255, 255, 0.08);
425
+ border-radius: 4px;
426
+ outline: none;
427
+ cursor: pointer;
428
+ position: relative;
429
+ z-index: 2;
430
+ }
431
+
432
+ /* Track Progress Fill (simulated via shadow or gradient is tricky in pure CSS cross-browser,
433
+ so we stick to a clean track style) */
434
+
435
+ input[type="range"]::-webkit-slider-thumb {
436
+ -webkit-appearance: none;
437
+ width: 20px;
438
+ height: 20px;
439
+ background: #fff;
440
+ border-radius: 50%;
441
+ cursor: pointer;
442
+ box-shadow:
443
+ 0 0 0 4px rgba(255, 255, 255, 0.1),
444
+ 0 4px 10px rgba(0, 0, 0, 0.3);
445
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
446
+ margin-top: -7px; /* Center thumb on track */
447
+ }
448
+
449
+ input[type="range"]::-moz-range-thumb {
450
+ width: 20px;
451
+ height: 20px;
452
+ background: #fff;
453
+ border: none;
454
+ border-radius: 50%;
455
+ cursor: pointer;
456
+ box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
457
+ transition: transform 0.2s;
458
+ }
459
+
460
+ input[type="range"]::-webkit-slider-runnable-track {
461
+ width: 100%;
462
+ height: 6px;
463
+ cursor: pointer;
464
+ background: transparent;
465
+ border-radius: 4px;
466
+ }
467
+
468
+ input[type="range"]:hover::-webkit-slider-thumb {
469
+ transform: scale(1.1);
470
+ box-shadow:
471
+ 0 0 0 6px rgba(255, 255, 255, 0.15),
472
+ 0 0 15px rgba(255, 255, 255, 0.3);
473
+ }
474
 
475
+ input[type="range"]:active::-webkit-slider-thumb {
476
+ transform: scale(0.95);
477
+ background: #f0f0f0;
478
+ }
479
+
480
+ /* Responsive */
481
+ @media (max-width: 768px) {
482
+ header {
483
+ padding: 1.5rem;
484
+ }
485
+
486
+ .glass-apple-wrapper {
487
+ transform: scale(0.75) !important; /* Force scale down on mobile */
488
+ }
489
+
490
+ .showcase-container {
491
+ height: 45vh;
492
+ }
493
+
494
+ .controls {
495
+ padding: 1.5rem;
496
+ gap: 1.2rem;
497
+ margin-top: -2rem; /* Pull controls closer to apple */
498
+ }
499
+ }
500
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  </head>
502
+
503
  <body>
504
 
505
+ <div class="noise-overlay"></div>
506
+
507
+ <div class="ambient-bg">
508
+ <div class="blob blob-1"></div>
509
+ <div class="blob blob-2"></div>
510
+ <div class="blob blob-3"></div>
511
+ </div>
512
+
513
+ <header>
514
+ <div class="brand">Liquid Glass</div>
515
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">Built with anycoder</a>
516
+ </header>
517
+
518
+ <main>
519
+ <div class="showcase-container">
520
+ <div class="glass-apple-wrapper" id="appleWrapper">
521
+ <div class="stem"></div>
522
+ <div class="leaf"></div>
523
+ <div class="apple-body">
524
+ <div class="dynamic-reflection"></div>
525
+ </div>
526
+ </div>
527
  </div>
528
 
529
+ <div class="controls">
530
+ <div class="control-group">
531
+ <div class="control-label">
532
+ <span>Liquid Speed</span>
533
+ <span id="speed-val" class="value-display">1x</span>
534
+ </div>
535
+ <input type="range" id="speed" min="0.1" max="3" value="1" step="0.1">
536
+ </div>
537
+
538
+ <div class="control-group">
539
+ <div class="control-label">
540
+ <span>Glass Blur</span>
541
+ <span id="blur-val" class="value-display">24px</span>
542
  </div>
543
+ <input type="range" id="blur" min="0" max="60" value="24">
544
+ </div>
545
 
546
+ <div class="control-group">
547
+ <div class="control-label">
548
+ <span>Ambient Hue</span>
549
+ <span id="hue-val" class="value-display">350°</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
  </div>
551
+ <input type="range" id="hue" min="0" max="360" value="350">
552
+ </div>
553
+ </div>
554
+ </main>
555
+
556
+ <script>
557
+ // DOM Elements
558
+ const root = document.documentElement;
559
+ const appleWrapper = document.getElementById('appleWrapper');
560
+
561
+ const speedInput = document.getElementById('speed');
562
+ const blurInput = document.getElementById('blur');
563
+ const hueInput = document.getElementById('hue');
564
+
565
+ const speedVal = document.getElementById('speed-val');
566
+ const blurVal = document.getElementById('blur-val');
567
+ const hueVal = document.getElementById('hue-val');
568
+
569
+ // --- 1. State Management & UI Updates ---
570
+
571
+ function updateLiquidGlass() {
572
+ // Speed calculation:
573
+ // Input is 0.1 to 3.
574
+ // Base duration is 8s.
575
+ // Formula: Base / InputMultiplier
576
+ const speedMult = parseFloat(speedInput.value);
577
+ const duration = (8 / speedMult).toFixed(2);
578
+
579
+ root.style.setProperty('--anim-speed', `${duration}s`);
580
+ speedVal.textContent = `${speedMult}x`;
581
+
582
+ // Blur calculation
583
+ const blurValPx = blurInput.value;
584
+ root.style.setProperty('--blur-strength', `${blurValPx}px`);
585
+ blurVal.textContent = `${blurValPx}px`;
586
+
587
+ // Hue calculation
588
+ const hueDeg = hueInput.value;
589
+ root.style.setProperty('--primary-hue', hueDeg);
590
+ hueVal.textContent = `${hueDeg}°`;
591
+ }
592
+
593
+ // Listeners for Controls
594
+ speedInput.addEventListener('input', updateLiquidGlass);
595
+ blurInput.addEventListener('input', updateLiquidGlass);
596
+ hueInput.addEventListener('input', updateLiquidGlass);
597
+
598
+ // Initialize
599
+ updateLiquidGlass();
600
+
601
+ // --- 2. Interactive Parallax & Lighting (Performance Optimized) ---
602
+
603
+ let mouseX = 0;
604
+ let mouseY = 0;
605
+ let currentX = 0;
606
+ let currentY = 0;
607
+
608
+ // Using requestAnimationFrame for smooth 60fps+ updates
609
+ // instead of updating DOM on every mousemove event.
610
+ document.addEventListener('mousemove', (e) => {
611
+ // Normalize mouse position (0 to 1)
612
+ mouseX = e.clientX / window.innerWidth;
613
+ mouseY = e.clientY / window.innerHeight;
614
+ });
615
+
616
+ function animateParallax() {
617
+ // Linear interpolation (Lerp) for smoothness
618
+ // Move 10% of the distance per frame
619
+ const ease = 0.08;
620
 
621
+ // Calculate target rotation (Max 15deg rotation)
622
+ const targetRotateX = (mouseY - 0.5) * 30;
623
+ const targetRotateY = (mouseX - 0.5) * 30;
624
+
625
+ currentX += (targetRotateX - currentX) * ease;
626
+ currentY += (targetRotateY - currentY) * ease;
627
+
628
+ // Update CSS Variables
629
+ root.style.setProperty('--rotate-x', `${-currentX}deg`);
630
+ root.style.setProperty('--rotate-y', `${currentY}deg`);
631
+
632
+ // Update reflection position relative to apple center
633
+ // We map mouse 0-1 to percentage
634
+ root.style.setProperty('--mouse-x', `${mouseX * 100}%`);
635
+ root.style.setProperty('--mouse-y', `${mouseY * 100}%`);
636
+
637
+ requestAnimationFrame(animateParallax);
638
+ }
639
+
640
+ // Start the loop
641
+ animateParallax();
642
+
643
+ // Reset on mouse leave (smoothly return to center via Lerp logic above)
644
+ document.addEventListener('mouseleave', () => {
645
+ mouseX = 0.5;
646
+ mouseY = 0.5;
647
+ });
648
+
649
+ // --- 3. Click Interaction (Squish Effect) ---
650
+ appleWrapper.addEventListener('mousedown', () => {
651
+ appleWrapper.classList.remove('squish'); // reset animation
652
+ void appleWrapper.offsetWidth; // trigger reflow
653
+ appleWrapper.classList.add('squish');
654
+ });
655
+
656
+ // Mobile Touch Support for Parallax
657
+ document.addEventListener('touchmove', (e) => {
658
+ const touch = e.touches[0];
659
+ mouseX = touch.clientX / window.innerWidth;
660
+ mouseY = touch.clientY / window.innerHeight;
661
+ }, { passive: true });
662
+
663
+ </script>
 
 
 
 
 
 
 
 
 
 
 
664
  </body>
665
+
666
  </html>