disable the particle system until I optimize
This commit is contained in:
9
public/css/main-site.min.css
vendored
9
public/css/main-site.min.css
vendored
@@ -226,9 +226,6 @@
|
|||||||
.pointer-events-none {
|
.pointer-events-none {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.visible {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
.absolute {
|
.absolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
@@ -388,9 +385,6 @@
|
|||||||
.h-48 {
|
.h-48 {
|
||||||
height: calc(var(--spacing) * 48);
|
height: calc(var(--spacing) * 48);
|
||||||
}
|
}
|
||||||
.h-\[7vh\] {
|
|
||||||
height: 7vh;
|
|
||||||
}
|
|
||||||
.h-\[30vh\] {
|
.h-\[30vh\] {
|
||||||
height: 30vh;
|
height: 30vh;
|
||||||
}
|
}
|
||||||
@@ -400,9 +394,6 @@
|
|||||||
.h-\[40vh\] {
|
.h-\[40vh\] {
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
}
|
}
|
||||||
.h-\[75vh\] {
|
|
||||||
height: 75vh;
|
|
||||||
}
|
|
||||||
.h-full {
|
.h-full {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
2
public/css/style.min.css
vendored
2
public/css/style.min.css
vendored
@@ -2061,4 +2061,4 @@
|
|||||||
--tw-translate-z: 0;
|
--tw-translate-z: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -2442,58 +2442,58 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
observer.observe(section);
|
observer.observe(section);
|
||||||
});
|
});
|
||||||
|
|
||||||
const PARTICLE_POOL_SIZE = 50;
|
// const PARTICLE_POOL_SIZE = 50;
|
||||||
const particlePool = [];
|
// const particlePool = [];
|
||||||
const activeParticles = new Set();
|
// const activeParticles = new Set();
|
||||||
|
|
||||||
function createParticleElement() {
|
// function createParticleElement() {
|
||||||
const particle = document.createElement('div');
|
// const particle = document.createElement('div');
|
||||||
particle.classList.add('particle');
|
// particle.classList.add('particle');
|
||||||
if (Math.random() > 0.6) particle.classList.add('large');
|
// if (Math.random() > 0.6) particle.classList.add('large');
|
||||||
return particle;
|
// return particle;
|
||||||
}
|
// }
|
||||||
|
|
||||||
function initializeParticlePool() {
|
// function initializeParticlePool() {
|
||||||
for (let i = 0; i < PARTICLE_POOL_SIZE; i++) {
|
// for (let i = 0; i < PARTICLE_POOL_SIZE; i++) {
|
||||||
particlePool.push(createParticleElement());
|
// particlePool.push(createParticleElement());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function resetParticle(particle) {
|
// function resetParticle(particle) {
|
||||||
particle.style.left = `${Math.random() * 100}%`;
|
// particle.style.left = `${Math.random() * 100}%`;
|
||||||
particle.style.top = `${Math.random() * 100}%`;
|
// particle.style.top = `${Math.random() * 100}%`;
|
||||||
particle.style.animationDelay = `${Math.random() * 8}s`;
|
// particle.style.animationDelay = `${Math.random() * 8}s`;
|
||||||
particle.style.animationDuration = `${8 + Math.random() * 6}s`;
|
// particle.style.animationDuration = `${8 + Math.random() * 6}s`;
|
||||||
particle.classList.remove('fade-out');
|
// particle.classList.remove('fade-out');
|
||||||
return particle;
|
// return particle;
|
||||||
}
|
// }
|
||||||
|
|
||||||
function spawnParticle() {
|
// function spawnParticle() {
|
||||||
if (particlePool.length === 0 || activeParticles.size >= PARTICLE_POOL_SIZE) return;
|
// if (particlePool.length === 0 || activeParticles.size >= PARTICLE_POOL_SIZE) return;
|
||||||
|
|
||||||
const particle = resetParticle(particlePool.pop());
|
// const particle = resetParticle(particlePool.pop());
|
||||||
if (!particle.parentNode) document.body.appendChild(particle);
|
// if (!particle.parentNode) document.body.appendChild(particle);
|
||||||
activeParticles.add(particle);
|
// activeParticles.add(particle);
|
||||||
|
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
particle.classList.add('fade-out');
|
// particle.classList.add('fade-out');
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
activeParticles.delete(particle);
|
// activeParticles.delete(particle);
|
||||||
particlePool.push(particle);
|
// particlePool.push(particle);
|
||||||
}, 500);
|
// }, 500);
|
||||||
}, 14000);
|
// }, 14000);
|
||||||
}
|
// }
|
||||||
|
|
||||||
function animate() {
|
// function animate() {
|
||||||
if (Math.random() < 0.1) spawnParticle(); // Reduced spawn frequency
|
// if (Math.random() < 0.1) spawnParticle(); // Reduced spawn frequency
|
||||||
requestAnimationFrame(animate);
|
// requestAnimationFrame(animate);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Initialize and start
|
// // Initialize and start
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
initializeParticlePool();
|
// initializeParticlePool();
|
||||||
animate();
|
// animate();
|
||||||
}, 500);
|
// }, 500);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
Reference in New Issue
Block a user