TyphoidComa commited on
Commit
2af4483
·
verified ·
1 Parent(s): 146219c

Make the system boot up when the button is powered up and make the particles move wilding ly

Browse files
Files changed (2) hide show
  1. index.html +78 -41
  2. style.css +4 -2
index.html CHANGED
@@ -43,37 +43,47 @@
43
 
44
  button.addEventListener('click', () => {
45
  if (!activated) {
46
- document.body.classList.add('activated');
47
- button.textContent = 'SYSTEM ONLINE';
48
- button.classList.add('pulse');
49
- activated = true;
50
-
51
- // Play activation sound
52
- const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-modern-click-box-check-1120.mp3');
53
- audio.play();
54
-
55
- // Create particle effects
56
- createParticles();
 
 
 
 
 
 
 
57
 
58
- // Full power mode effects
59
- document.documentElement.style.setProperty('--cyber-power', '1');
60
- document.body.style.background = 'radial-gradient(circle, #050505 0%, #000 100%)';
61
- document.querySelector('h1').classList.add('full-power');
62
- VANTA.NET({
63
- el: "#vanta-bg",
64
- mouseControls: true,
65
- touchControls: true,
66
- gyroControls: false,
67
- minHeight: 200.00,
68
- minWidth: 200.00,
69
- scale: 1.50,
70
- scaleMobile: 1.50,
71
- color: 0xf9ff00,
72
- backgroundColor: 0x000000,
73
- points: 20.00,
74
- spacing: 20.00
75
- });
76
- } else {
 
 
 
77
  document.documentElement.style.setProperty('--cyber-power', '0');
78
  document.body.style.background = '';
79
  document.querySelector('h1').classList.remove('full-power');
@@ -89,26 +99,53 @@ document.body.classList.remove('activated');
89
  particles.id = 'particles';
90
  particles.className = 'fixed inset-0 pointer-events-none';
91
  document.body.appendChild(particles);
92
-
93
- for (let i = 0; i < 100; i++) {
94
  setTimeout(() => {
95
  const particle = document.createElement('div');
96
- particle.className = 'absolute w-2 h-2 bg-cyberyellow rounded-full';
 
 
97
  particle.style.left = `${Math.random() * 100}vw`;
98
  particle.style.top = `${Math.random() * 100}vh`;
99
  particles.appendChild(particle);
100
 
101
- // Animation
102
- const duration = 2000 + Math.random() * 3000;
 
 
 
103
  const keyframes = [
104
- { transform: 'translate(0, 0)', opacity: 1 },
105
- { transform: `translate(${Math.random() * 200 - 100}px, ${Math.random() * 200 - 100}px)`, opacity: 0 }
 
 
 
 
 
 
 
106
  ];
107
- particle.animate(keyframes, { duration, easing: 'cubic-bezier(0.4, 0, 0.2, 1)' })
108
- .onfinish = () => particle.remove();
109
- }, i * 30);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
- }
112
  </script>
113
  <script>
114
  feather.replace();
 
43
 
44
  button.addEventListener('click', () => {
45
  if (!activated) {
46
+ // Boot sequence animation
47
+ let bootProgress = 0;
48
+ const bootInterval = setInterval(() => {
49
+ bootProgress += 10;
50
+ button.textContent = `BOOTING ${bootProgress}%`;
51
+ if (bootProgress >= 100) {
52
+ clearInterval(bootInterval);
53
+ document.body.classList.add('activated');
54
+ button.textContent = 'SYSTEM ONLINE';
55
+ button.classList.add('pulse');
56
+ activated = true;
57
+
58
+ // Play activation sound
59
+ const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-modern-click-box-check-1120.mp3');
60
+ audio.play();
61
+
62
+ // Create wild particle effects
63
+ createParticles();
64
 
65
+ // Full power mode effects
66
+ document.documentElement.style.setProperty('--cyber-power', '1');
67
+ document.body.style.background = 'radial-gradient(circle, #050505 0%, #000 100%)';
68
+ document.querySelector('h1').classList.add('full-power');
69
+ VANTA.NET({
70
+ el: "#vanta-bg",
71
+ mouseControls: true,
72
+ touchControls: true,
73
+ gyroControls: false,
74
+ minHeight: 200.00,
75
+ minWidth: 200.00,
76
+ scale: 2.00,
77
+ scaleMobile: 2.00,
78
+ color: 0xf9ff00,
79
+ backgroundColor: 0x000000,
80
+ points: 30.00,
81
+ spacing: 15.00,
82
+ maxDistance: 30.00
83
+ });
84
+ }
85
+ }, 100);
86
+ } else {
87
  document.documentElement.style.setProperty('--cyber-power', '0');
88
  document.body.style.background = '';
89
  document.querySelector('h1').classList.remove('full-power');
 
99
  particles.id = 'particles';
100
  particles.className = 'fixed inset-0 pointer-events-none';
101
  document.body.appendChild(particles);
102
+ // Create 200 wild particles
103
+ for (let i = 0; i < 200; i++) {
104
  setTimeout(() => {
105
  const particle = document.createElement('div');
106
+ particle.className = 'absolute bg-cyberyellow rounded-full';
107
+ particle.style.width = `${2 + Math.random() * 4}px`;
108
+ particle.style.height = particle.style.width;
109
  particle.style.left = `${Math.random() * 100}vw`;
110
  particle.style.top = `${Math.random() * 100}vh`;
111
  particles.appendChild(particle);
112
 
113
+ // Wild animation with more randomness
114
+ const duration = 1000 + Math.random() * 2000;
115
+ const startX = Math.random() * window.innerWidth;
116
+ const startY = Math.random() * window.innerHeight;
117
+
118
  const keyframes = [
119
+ {
120
+ transform: `translate(0, 0)`,
121
+ opacity: 1
122
+ },
123
+ {
124
+ transform: `translate(${Math.random() * 1000 - 500}px, ${Math.random() * 1000 - 500}px) rotate(${Math.random() * 360}deg)`,
125
+ opacity: 0,
126
+ filter: 'blur(2px)'
127
+ }
128
  ];
129
+
130
+ const animation = particle.animate(keyframes, {
131
+ duration,
132
+ easing: 'cubic-bezier(0.1, 0.7, 1.0, 0.1)',
133
+ iterations: Infinity
134
+ });
135
+
136
+ // Make particles bounce off edges
137
+ const moveParticle = () => {
138
+ const rect = particle.getBoundingClientRect();
139
+ if (rect.left <= 0 || rect.right >= window.innerWidth ||
140
+ rect.top <= 0 || rect.bottom >= window.innerHeight) {
141
+ animation.reverse();
142
+ }
143
+ requestAnimationFrame(moveParticle);
144
+ };
145
+ moveParticle();
146
+ }, i * 15);
147
  }
148
+ }
149
  </script>
150
  <script>
151
  feather.replace();
style.css CHANGED
@@ -17,18 +17,20 @@ body.activated {
17
  0 0 60px rgba(249, 255, 0, 0.4);
18
  animation: power-pulse 1s infinite alternate;
19
  }
20
-
21
  @keyframes power-pulse {
22
  from {
23
  opacity: 0.8;
24
  transform: scale(1);
 
25
  }
26
  to {
27
  opacity: 1;
28
  transform: scale(1.05);
 
 
 
29
  }
30
  }
31
-
32
  #vanta-bg {
33
  transition: filter 0.5s ease;
34
  }
 
17
  0 0 60px rgba(249, 255, 0, 0.4);
18
  animation: power-pulse 1s infinite alternate;
19
  }
 
20
  @keyframes power-pulse {
21
  from {
22
  opacity: 0.8;
23
  transform: scale(1);
24
+ text-shadow: 0 0 10px rgba(249, 255, 0, 0.8);
25
  }
26
  to {
27
  opacity: 1;
28
  transform: scale(1.05);
29
+ text-shadow: 0 0 20px rgba(249, 255, 0, 0.8),
30
+ 0 0 40px rgba(249, 255, 0, 0.6),
31
+ 0 0 80px rgba(249, 255, 0, 0.4);
32
  }
33
  }
 
34
  #vanta-bg {
35
  transition: filter 0.5s ease;
36
  }