-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvoidspace.html
More file actions
856 lines (745 loc) · 28.5 KB
/
Copy pathvoidspace.html
File metadata and controls
856 lines (745 loc) · 28.5 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
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Void Space - Release Into The Cosmos</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Orbitron', sans-serif;
overflow-x: hidden;
background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
color: white;
position: relative;
}
/* Starfield background */
.stars {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
}
.star {
position: absolute;
width: 2px;
height: 2px;
background: white;
border-radius: 50%;
animation: twinkle 3s infinite;
}
@keyframes twinkle {
0%, 100% { opacity: 0.3; }
50% { opacity: 1; }
}
canvas {
position: fixed;
top: 0;
left: 0;
z-index: 2;
pointer-events: none;
}
.container {
position: relative;
z-index: 10;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 40px 20px;
}
.header {
text-align: center;
margin-bottom: 40px;
animation: fadeInDown 1s ease;
}
.logo {
font-size: 56px;
font-weight: 900;
background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #f107a3 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
letter-spacing: 8px;
text-shadow: 0 0 60px rgba(0, 212, 255, 0.6);
animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
0%, 100% { filter: brightness(1); }
50% { filter: brightness(1.3); }
}
.tagline {
font-size: 14px;
color: #00d4ff;
letter-spacing: 4px;
text-transform: uppercase;
}
.mood-selector {
display: flex;
gap: 12px;
margin-bottom: 30px;
flex-wrap: wrap;
justify-content: center;
animation: fadeIn 1s ease 0.3s both;
}
.mood-btn {
padding: 10px 20px;
border: 2px solid transparent;
background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(10px);
border-radius: 30px;
color: white;
cursor: pointer;
transition: all 0.3s;
font-size: 16px;
font-weight: 600;
font-family: 'Orbitron', sans-serif;
}
.mood-btn:hover {
transform: translateY(-3px) scale(1.05);
box-shadow: 0 10px 40px currentColor;
}
.mood-btn[data-mood="stressed"] { border-color: #ff6b6b; color: #ff6b6b; }
.mood-btn[data-mood="sad"] { border-color: #4ecdc4; color: #4ecdc4; }
.mood-btn[data-mood="anxious"] { border-color: #ffe66d; color: #ffe66d; }
.mood-btn[data-mood="angry"] { border-color: #ff006e; color: #ff006e; }
.mood-btn[data-mood="overwhelmed"] { border-color: #a770ef; color: #a770ef; }
.mood-btn.active {
background: currentColor;
color: #000;
box-shadow: 0 10px 40px currentColor;
}
.main-card {
width: 100%;
max-width: 700px;
background: rgba(255, 255, 255, 0.02);
backdrop-filter: blur(30px);
border-radius: 30px;
padding: 40px;
border: 1px solid rgba(0, 212, 255, 0.2);
box-shadow: 0 20px 80px rgba(0, 212, 255, 0.1);
animation: fadeInUp 1s ease 0.5s both;
}
.input-label {
font-size: 18px;
margin-bottom: 15px;
color: #00d4ff;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 2px;
}
.vent-input {
width: 100%;
min-height: 200px;
background: rgba(0, 0, 0, 0.5);
border: 2px solid rgba(0, 212, 255, 0.3);
border-radius: 20px;
padding: 20px;
color: white;
font-size: 16px;
font-family: 'Orbitron', sans-serif;
resize: vertical;
transition: all 0.3s;
line-height: 1.6;
}
.vent-input:focus {
outline: none;
border-color: #00d4ff;
box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
background: rgba(0, 0, 0, 0.7);
}
.vent-input::placeholder {
color: rgba(0, 212, 255, 0.3);
}
.char-count {
text-align: right;
margin-top: 10px;
color: rgba(0, 212, 255, 0.5);
font-size: 12px;
}
.action-buttons {
display: flex;
gap: 15px;
margin-top: 30px;
}
.release-btn, .clear-btn {
flex: 1;
padding: 18px;
border: none;
border-radius: 20px;
font-size: 16px;
font-weight: 700;
cursor: pointer;
transition: all 0.3s;
font-family: 'Orbitron', sans-serif;
text-transform: uppercase;
letter-spacing: 2px;
}
.release-btn {
background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #f107a3 100%);
color: white;
box-shadow: 0 10px 40px rgba(0, 212, 255, 0.4);
position: relative;
overflow: hidden;
}
.release-btn::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
transform: rotate(45deg);
animation: shine 3s infinite;
}
@keyframes shine {
0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}
.release-btn:hover:not(:disabled) {
transform: translateY(-3px) scale(1.02);
box-shadow: 0 15px 60px rgba(0, 212, 255, 0.6);
}
.release-btn:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.clear-btn {
background: rgba(255, 255, 255, 0.05);
color: #00d4ff;
border: 2px solid rgba(0, 212, 255, 0.3);
}
.clear-btn:hover {
background: rgba(0, 212, 255, 0.1);
transform: translateY(-3px);
box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
}
/* ROCKET ANIMATION */
.rocket-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999;
display: none;
}
.rocket-container.active {
display: block;
}
.rocket {
position: absolute;
font-size: 80px;
bottom: -100px;
left: 50%;
transform: translateX(-50%) rotate(-45deg);
filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8));
}
.rocket.launching {
animation: rocketLaunch 2s ease-in-out forwards;
}
@keyframes rocketLaunch {
0% {
bottom: -100px;
left: 50%;
transform: translateX(-50%) rotate(-45deg) scale(1);
opacity: 1;
}
50% {
bottom: 50%;
left: 50%;
transform: translateX(-50%) rotate(-45deg) scale(1.2);
opacity: 1;
}
100% {
bottom: 120%;
left: 70%;
transform: translateX(-50%) rotate(-20deg) scale(0.8);
opacity: 0;
}
}
.explosion {
position: absolute;
top: 30%;
left: 60%;
transform: translate(-50%, -50%);
font-size: 120px;
opacity: 0;
}
.explosion.active {
animation: explode 1.5s ease-out forwards;
}
@keyframes explode {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0);
}
30% {
opacity: 1;
transform: translate(-50%, -50%) scale(1.5);
}
100% {
opacity: 0;
transform: translate(-50%, -50%) scale(3);
}
}
.release-text {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
z-index: 10000;
opacity: 0;
pointer-events: none;
}
.release-text.active {
animation: releaseTextAnim 3s ease-out forwards;
}
@keyframes releaseTextAnim {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.5);
}
20% {
opacity: 1;
transform: translate(-50%, -50%) scale(1.2);
}
80% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
100% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
}
}
.release-main-text {
font-size: 64px;
font-weight: 900;
background: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 50%, #f107a3 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 20px;
text-shadow: 0 0 60px rgba(0, 212, 255, 0.8);
}
.release-sub-text {
font-size: 28px;
color: #00d4ff;
text-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}
.affirmation-box {
margin-top: 40px;
background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(123, 47, 247, 0.05) 100%);
border: 1px solid rgba(0, 212, 255, 0.3);
border-radius: 20px;
padding: 30px;
text-align: center;
}
.affirmation-text {
font-size: 22px;
font-weight: 600;
line-height: 1.6;
color: #00d4ff;
margin-bottom: 15px;
}
.affirmation-author {
font-size: 12px;
color: rgba(0, 212, 255, 0.5);
text-transform: uppercase;
letter-spacing: 2px;
}
.quick-actions {
margin-top: 30px;
}
.quick-action-title {
font-size: 16px;
margin-bottom: 20px;
color: #00d4ff;
text-transform: uppercase;
letter-spacing: 2px;
}
.quick-action-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
}
.quick-action-card {
background: rgba(0, 212, 255, 0.03);
backdrop-filter: blur(10px);
border: 1px solid rgba(0, 212, 255, 0.2);
border-radius: 20px;
padding: 20px;
cursor: pointer;
transition: all 0.3s;
}
.quick-action-card:hover {
transform: translateY(-5px);
background: rgba(0, 212, 255, 0.1);
box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
border-color: #00d4ff;
}
.quick-action-icon {
font-size: 32px;
margin-bottom: 10px;
}
.quick-action-text {
font-size: 12px;
color: #00d4ff;
text-transform: uppercase;
letter-spacing: 1px;
}
.resources {
margin-top: 40px;
text-align: center;
padding: 25px;
background: rgba(255, 87, 87, 0.05);
border: 1px solid rgba(255, 87, 87, 0.3);
border-radius: 20px;
}
.resources-title {
font-size: 14px;
font-weight: 700;
margin-bottom: 15px;
color: #ff5757;
text-transform: uppercase;
letter-spacing: 2px;
}
.resources-text {
font-size: 13px;
color: rgba(255, 255, 255, 0.7);
line-height: 1.8;
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@media (max-width: 768px) {
.logo {
font-size: 36px;
}
.main-card {
padding: 25px;
}
.action-buttons {
flex-direction: column;
}
.release-main-text {
font-size: 48px;
}
.release-sub-text {
font-size: 20px;
}
}
</style>
</head>
<body>
<!-- Starfield -->
<div class="stars" id="stars"></div>
<!-- Nebula particles canvas -->
<canvas id="canvas"></canvas>
<!-- Rocket Animation Container -->
<div class="rocket-container" id="rocketContainer">
<div class="rocket" id="rocket">🚀</div>
<div class="explosion" id="explosion">💥</div>
</div>
<!-- Release Text -->
<div class="release-text" id="releaseText">
<div class="release-main-text">MIND CLEARED</div>
<div class="release-sub-text">THE NEW YOU ✨</div>
</div>
<div class="container">
<div class="header">
<div class="logo">VOID SPACE</div>
<div class="tagline">Launch Your Thoughts Into The Cosmos</div>
</div>
<div class="mood-selector">
<button class="mood-btn" data-mood="stressed">😤 STRESSED</button>
<button class="mood-btn" data-mood="sad">😔 SAD</button>
<button class="mood-btn" data-mood="anxious">😰 ANXIOUS</button>
<button class="mood-btn" data-mood="angry">😡 ANGRY</button>
<button class="mood-btn" data-mood="overwhelmed">😫 OVERWHELMED</button>
</div>
<div class="main-card">
<div class="input-label">🌌 What's Heavy On Your Mind?</div>
<textarea
class="vent-input"
id="ventInput"
placeholder="Type everything you're feeling... No filters. No judgment. Just you and the void. Hit launch and watch it all explode into stardust..."
maxlength="2000"
></textarea>
<div class="char-count"><span id="charCount">0</span>/2000</div>
<div class="action-buttons">
<button class="release-btn" id="releaseBtn" disabled>🚀 LAUNCH INTO SPACE</button>
<button class="clear-btn" id="clearBtn">CLEAR</button>
</div>
</div>
<div class="main-card quick-actions">
<div class="quick-action-title">⚡ Quick Relief</div>
<div class="quick-action-grid">
<div class="quick-action-card" data-action="breathe">
<div class="quick-action-icon">🫁</div>
<div class="quick-action-text">Breathe</div>
</div>
<div class="quick-action-card" data-action="distract">
<div class="quick-action-icon">🎮</div>
<div class="quick-action-text">Distract</div>
</div>
<div class="quick-action-card" data-action="music">
<div class="quick-action-icon">🎵</div>
<div class="quick-action-text">Sounds</div>
</div>
<div class="quick-action-card" data-action="affirmation">
<div class="quick-action-icon">💭</div>
<div class="quick-action-text">Affirmation</div>
</div>
</div>
</div>
<div class="main-card affirmation-box">
<div class="affirmation-text" id="affirmationText">You're doing better than you think. Every day you show up is a win. 💜</div>
<div class="affirmation-author">— Your mind needs to hear this</div>
</div>
<div class="main-card resources">
<div class="resources-title">⚠️ NEED REAL HELP?</div>
<div class="resources-text">
If you're in crisis or thinking about self-harm:<br>
<strong>CALL: 988 (Suicide & Crisis Lifeline)</strong><br>
<strong>TEXT "HELLO" to 741741 (Crisis Text Line)</strong><br>
You matter. Your life matters. Talk to someone who can help.
</div>
</div>
</div>
<script>
// Create starfield
const starsContainer = document.getElementById('stars');
for (let i = 0; i < 200; i++) {
const star = document.createElement('div');
star.className = 'star';
star.style.left = Math.random() * 100 + '%';
star.style.top = Math.random() * 100 + '%';
star.style.animationDelay = Math.random() * 3 + 's';
star.style.opacity = Math.random() * 0.7 + 0.3;
starsContainer.appendChild(star);
}
// Canvas setup for nebula particles
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const particles = [];
const moodColors = {
stressed: ['#ff6b6b', '#ee5a6f', '#ff8787'],
sad: ['#4ecdc4', '#44a9d6', '#5ce1e6'],
anxious: ['#ffe66d', '#ffd93d', '#ffed4e'],
angry: ['#ff006e', '#d90368', '#ff1744'],
overwhelmed: ['#a770ef', '#cf8bf3', '#fbc2eb'],
default: ['#00d4ff', '#7b2ff7', '#f107a3']
};
let currentMood = 'default';
let particleIntensity = 1;
class NebulaParticle {
constructor(x, y, isExplosion = false) {
this.x = x || Math.random() * canvas.width;
this.y = y || Math.random() * canvas.height;
if (isExplosion) {
const angle = Math.random() * Math.PI * 2;
const speed = Math.random() * 10 + 5;
this.vx = Math.cos(angle) * speed;
this.vy = Math.sin(angle) * speed;
this.life = 255;
this.decay = Math.random() * 3 + 2;
} else {
this.vx = (Math.random() - 0.5) * 0.5;
this.vy = (Math.random() - 0.5) * 0.5;
this.life = 255;
this.decay = 0;
}
this.size = Math.random() * 4 + 2;
this.color = moodColors[currentMood][Math.floor(Math.random() * 3)];
this.pulseSpeed = Math.random() * 0.05 + 0.02;
this.pulsePhase = Math.random() * Math.PI * 2;
}
update() {
this.x += this.vx * particleIntensity;
this.y += this.vy * particleIntensity;
this.life -= this.decay;
this.pulsePhase += this.pulseSpeed;
if (this.x < 0) this.x = canvas.width;
if (this.x > canvas.width) this.x = 0;
if (this.y < 0) this.y = canvas.height;
if (this.y > canvas.height) this.y = 0;
return this.life > 0;
}
draw() {
const pulse = Math.sin(this.pulsePhase) * 0.5 + 0.5;
const alpha = (this.life / 255) * (0.5 + pulse * 0.5);
const gradient = ctx.createRadialGradient(
this.x, this.y, 0,
this.x, this.y, this.size * 3
);
gradient.addColorStop(0, this.color + Math.floor(alpha * 255).toString(16).padStart(2, '0'));
gradient.addColorStop(0.5, this.color + Math.floor(alpha * 128).toString(16).padStart(2, '0'));
gradient.addColorStop(1, this.color + '00');
ctx.beginPath();
ctx.arc(this.x, this.y, this.size * (1 + pulse * 0.5), 0, Math.PI * 2);
ctx.fillStyle = gradient;
ctx.fill();
}
}
function initParticles(count = 150) {
for (let i = 0; i < count; i++) {
particles.push(new NebulaParticle());
}
}
function createExplosion(x, y, count = 150) {
for (let i = 0; i < count; i++) {
particles.push(new NebulaParticle(x, y, true));
}
}
function animate() {
ctx.fillStyle = 'rgba(9, 10, 15, 0.1)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
for (let i = particles.length - 1; i >= 0; i--) {
if (!particles[i].update()) {
particles.splice(i, 1);
} else {
particles[i].draw();
}
}
if (particles.length < 150) {
particles.push(new NebulaParticle());
}
requestAnimationFrame(animate);
}
// App functionality
const ventInput = document.getElementById('ventInput');
const charCount = document.getElementById('charCount');
const releaseBtn = document.getElementById('releaseBtn');
const clearBtn = document.getElementById('clearBtn');
const rocketContainer = document.getElementById('rocketContainer');
const rocket = document.getElementById('rocket');
const explosion = document.getElementById('explosion');
const releaseText = document.getElementById('releaseText');
const affirmationText = document.getElementById('affirmationText');
const affirmations = [
"You're doing better than you think. Every day you show up is a win. 💜",
"It's okay to not be okay. Your feelings are valid. 🌙",
"You're not alone in this. Millions feel exactly like you do. ⭐",
"Bad days don't last forever. You've survived 100% of them. 💪",
"Taking care of your mental health isn't weak, it's brave. 🦋",
"You don't have to have it all figured out. Nobody does. ✨",
"Your worth isn't determined by productivity or grades. 🌸",
"It's okay to ask for help. That takes real strength. 🤝",
"You're allowed to take up space. You're allowed to exist. 🌟",
"Progress isn't linear. Some days are harder. That's okay. 🌈",
"You're stronger than the thoughts trying to break you. 🔥",
"One step at a time. One breath at a time. You got this. 🌊"
];
ventInput.addEventListener('input', () => {
const length = ventInput.value.length;
charCount.textContent = length;
releaseBtn.disabled = length === 0;
});
releaseBtn.addEventListener('click', () => {
// Start rocket animation
rocketContainer.classList.add('active');
rocket.classList.add('launching');
// Create particle burst at launch
createExplosion(window.innerWidth / 2, window.innerHeight, 100);
particleIntensity = 3;
// Explosion after 1.5s
setTimeout(() => {
explosion.classList.add('active');
createExplosion(window.innerWidth * 0.6, window.innerHeight * 0.3, 300);
// Show release text
releaseText.classList.add('active');
}, 1500);
// Clean up animations
setTimeout(() => {
rocketContainer.classList.remove('active');
rocket.classList.remove('launching');
explosion.classList.remove('active');
releaseText.classList.remove('active');
particleIntensity = 1;
// Clear input
ventInput.value = '';
charCount.textContent = '0';
releaseBtn.disabled = true;
}, 4500);
});
clearBtn.addEventListener('click', () => {
ventInput.value = '';
charCount.textContent = '0';
releaseBtn.disabled = true;
});
document.querySelectorAll('.mood-btn').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.mood-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
currentMood = btn.dataset.mood;
createExplosion(window.innerWidth / 2, window.innerHeight / 2, 80);
});
});
document.querySelectorAll('.quick-action-card').forEach(card => {
card.addEventListener('click', () => {
const action = card.dataset.action;
if (action === 'affirmation') {
const randomAffirmation = affirmations[Math.floor(Math.random() * affirmations.length)];
affirmationText.textContent = randomAffirmation;
createExplosion(window.innerWidth / 2, window.innerHeight / 2, 50);
} else if (action === 'breathe') {
alert('🫁 Breathe in for 4 seconds... Hold for 4... Breathe out for 4... Repeat. You got this.');
} else if (action === 'distract') {
alert('🎮 Try: Count backwards from 100 by 7s, or name 5 things you see, 4 you can touch, 3 you hear, 2 you smell, 1 you taste.');
} else if (action === 'music') {
alert('🎵 Search for: "lofi beats", "space ambient", "rain sounds", or "calming frequencies" on YouTube/Spotify.');
}
const rect = card.getBoundingClientRect();
createExplosion(rect.left + rect.width / 2, rect.top + rect.height / 2, 40);
});
});
canvas.addEventListener('click', (e) => {
createExplosion(e.clientX, e.clientY, 60);
});
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
});
// Initialize
initParticles(150);
animate();
</script>
</body>
</html>