mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Remove cancerous lightbar random code
This commit is contained in:
parent
f942e6cf6b
commit
090eac0539
1 changed files with 184 additions and 211 deletions
|
@ -145,234 +145,207 @@ function ParticlesCanvas() {
|
||||||
|
|
||||||
// Basic particle config
|
// Basic particle config
|
||||||
const particleCount = 265;
|
const particleCount = 265;
|
||||||
let imageParticleCount = particleCount;
|
|
||||||
|
|
||||||
// Holiday overrides
|
|
||||||
let imageOverride: { image: string; sizeRange?: [number, number] }[] = [];
|
let imageOverride: { image: string; sizeRange?: [number, number] }[] = [];
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const month = date.getMonth();
|
const month = date.getMonth();
|
||||||
const day = date.getDate();
|
const day = date.getDate();
|
||||||
if (
|
let imageParticleCount = particleCount;
|
||||||
(month === 11 && day >= 24 && day <= 26) ||
|
|
||||||
Math.random() < 0.051 // 5.1%
|
|
||||||
) {
|
|
||||||
imageOverride = [
|
|
||||||
{
|
|
||||||
image: "/lightbar-images/snowflake.svg",
|
|
||||||
sizeRange: [12, 20] as [number, number],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: "/lightbar-images/santa.png",
|
|
||||||
sizeRange: [25, 35] as [number, number],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
imageParticleCount = particleCount * 0.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Halloween overrides
|
switch (true) {
|
||||||
const month2 = date.getMonth();
|
case (month === 11 && day >= 24 && day <= 26) || Math.random() < 0.051:
|
||||||
const day2 = date.getDate();
|
imageOverride = [
|
||||||
if (
|
{
|
||||||
(month2 === 9 && day2 >= 29 && day2 <= 31) ||
|
image: "/lightbar-images/snowflake.svg",
|
||||||
Math.random() < 0.05 // 5%
|
sizeRange: [12, 20] as [number, number],
|
||||||
) {
|
},
|
||||||
imageOverride = [
|
{
|
||||||
{
|
image: "/lightbar-images/santa.png",
|
||||||
image: "/lightbar-images/ghost.png",
|
sizeRange: [25, 35] as [number, number],
|
||||||
sizeRange: [20, 33] as [number, number],
|
},
|
||||||
},
|
];
|
||||||
{
|
imageParticleCount = particleCount * 0.1;
|
||||||
image: "/lightbar-images/pumpkin.png",
|
break;
|
||||||
sizeRange: [25, 35] as [number, number],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
imageParticleCount = particleCount * 0.0879;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fish easter egg
|
case (month === 9 && day >= 29 && day <= 31) || Math.random() < 0.05:
|
||||||
const shouldShowFishie = Math.random() < 0.1; // 10%
|
imageOverride = [
|
||||||
if (shouldShowFishie) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/ghost.png",
|
||||||
{
|
sizeRange: [20, 33] as [number, number],
|
||||||
image: "/lightbar-images/fishie.png",
|
},
|
||||||
sizeRange: [10, 13] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/pumpkin.png",
|
||||||
{
|
sizeRange: [25, 35] as [number, number],
|
||||||
image: "/lightbar-images/shark.png",
|
},
|
||||||
sizeRange: [48, 56] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount * 0.0879;
|
||||||
];
|
break;
|
||||||
imageParticleCount = particleCount * 0.075;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Weed easter egg
|
case Math.random() < 0.1:
|
||||||
const month3 = date.getMonth() + 1;
|
imageOverride = [
|
||||||
const day3 = date.getDate();
|
{
|
||||||
const shouldShowZa = (month3 === 4 && day3 === 20) || Math.random() < 0.25; // 25%
|
image: "/lightbar-images/fishie.png",
|
||||||
if (shouldShowZa) {
|
sizeRange: [10, 13] as [number, number],
|
||||||
imageOverride = [
|
},
|
||||||
{
|
{
|
||||||
image: "/lightbar-images/weed.png",
|
image: "/lightbar-images/shark.png",
|
||||||
sizeRange: [32, 40] as [number, number],
|
sizeRange: [48, 56] as [number, number],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
imageParticleCount = particleCount / 6.25;
|
imageParticleCount = particleCount * 0.075;
|
||||||
}
|
break;
|
||||||
|
|
||||||
// Kitty easter egg
|
case (month === 4 && day === 20) || Math.random() < 0.25:
|
||||||
const shouldShowCat = Math.random() < 0.2; // 20%
|
imageOverride = [
|
||||||
if (shouldShowCat) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/weed.png",
|
||||||
{
|
sizeRange: [32, 40] as [number, number],
|
||||||
image: "/lightbar-images/cat.png",
|
},
|
||||||
sizeRange: [30, 38] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 6.25;
|
||||||
];
|
break;
|
||||||
imageParticleCount = particleCount / 6.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Movie & popcorn easter egg
|
case Math.random() < 0.2:
|
||||||
const shouldShowParaphernalia = Math.random() < 0.3; // 30%
|
imageOverride = [
|
||||||
if (shouldShowParaphernalia) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/cat.png",
|
||||||
{
|
sizeRange: [30, 38] as [number, number],
|
||||||
image: "/lightbar-images/camera.png",
|
},
|
||||||
sizeRange: [24, 32] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 6.6;
|
||||||
{
|
break;
|
||||||
image: "/lightbar-images/popcorn.png",
|
|
||||||
sizeRange: [18, 27] as [number, number],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
imageParticleCount = particleCount / 7.85;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chicken easter egg
|
case Math.random() < 0.3:
|
||||||
const shouldShow4thDecor = Math.random() < 0.08; // 8%
|
imageOverride = [
|
||||||
if (shouldShow4thDecor) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/camera.png",
|
||||||
{
|
sizeRange: [24, 32] as [number, number],
|
||||||
image: "/lightbar-images/cock.png",
|
},
|
||||||
sizeRange: [25, 32] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/popcorn.png",
|
||||||
{
|
sizeRange: [18, 27] as [number, number],
|
||||||
image: "/lightbar-images/egg.png",
|
},
|
||||||
sizeRange: [18, 24] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 7.85;
|
||||||
{
|
break;
|
||||||
image: "/lightbar-images/barn.png",
|
|
||||||
sizeRange: [32, 38] as [number, number],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
imageParticleCount = particleCount / 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Money easter egg
|
case Math.random() < 0.08:
|
||||||
const shouldShowMoney = Math.random() < 0.06; // 6%
|
imageOverride = [
|
||||||
if (shouldShowMoney) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/cock.png",
|
||||||
{
|
sizeRange: [25, 32] as [number, number],
|
||||||
image: "/lightbar-images/money-sack.png",
|
},
|
||||||
sizeRange: [24, 32] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/egg.png",
|
||||||
{
|
sizeRange: [18, 24] as [number, number],
|
||||||
image: "/lightbar-images/money.png",
|
},
|
||||||
sizeRange: [13, 23] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/barn.png",
|
||||||
{
|
sizeRange: [32, 38] as [number, number],
|
||||||
image: "/lightbar-images/coin.png",
|
},
|
||||||
sizeRange: [8, 20] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 9;
|
||||||
];
|
break;
|
||||||
imageParticleCount = particleCount / 8.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pirate easter egg
|
case Math.random() < 0.06:
|
||||||
const shouldShowPirate = Math.random() < 0.075; // 7.5%
|
imageOverride = [
|
||||||
if (shouldShowPirate) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/money-sack.png",
|
||||||
{
|
sizeRange: [24, 32] as [number, number],
|
||||||
image: "/lightbar-images/skull.png",
|
},
|
||||||
sizeRange: [20, 28] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/money.png",
|
||||||
{
|
sizeRange: [13, 23] as [number, number],
|
||||||
image: "/lightbar-images/ship.png",
|
},
|
||||||
sizeRange: [23, 27] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/coin.png",
|
||||||
];
|
sizeRange: [8, 20] as [number, number],
|
||||||
imageParticleCount = particleCount / 10;
|
},
|
||||||
}
|
];
|
||||||
|
imageParticleCount = particleCount / 8.45;
|
||||||
|
break;
|
||||||
|
|
||||||
// Dev easter egg
|
case Math.random() < 0.075:
|
||||||
const shouldShowCode = Math.random() < 0.03; // 3%
|
imageOverride = [
|
||||||
if (shouldShowCode) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/skull.png",
|
||||||
{
|
sizeRange: [20, 28] as [number, number],
|
||||||
image: "/lightbar-images/ts.png",
|
},
|
||||||
sizeRange: [20, 32] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/ship.png",
|
||||||
{
|
sizeRange: [23, 27] as [number, number],
|
||||||
image: "/lightbar-images/git.png",
|
},
|
||||||
sizeRange: [20, 28] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 10;
|
||||||
];
|
break;
|
||||||
imageParticleCount = particleCount / 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DUI easter egg
|
case Math.random() < 0.03:
|
||||||
const shouldShowFlix = Math.random() < 0.08; // 8%
|
imageOverride = [
|
||||||
if (shouldShowFlix) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/ts.png",
|
||||||
{
|
sizeRange: [20, 32] as [number, number],
|
||||||
image: "/lightbar-images/beer.png",
|
},
|
||||||
sizeRange: [15, 35] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/git.png",
|
||||||
{
|
sizeRange: [20, 28] as [number, number],
|
||||||
image: "/lightbar-images/beer-bottle.png",
|
},
|
||||||
sizeRange: [10, 38] as [number, number],
|
];
|
||||||
},
|
imageParticleCount = particleCount / 9;
|
||||||
{
|
break;
|
||||||
image: "/lightbar-images/wine.png",
|
|
||||||
sizeRange: [15, 35] as [number, number],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: "/lightbar-images/cigarette.png",
|
|
||||||
sizeRange: [10, 38] as [number, number],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
image: "/lightbar-images/cigarette2.png",
|
|
||||||
sizeRange: [15, 35] as [number, number],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
imageParticleCount = particleCount / 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gangster easter egg
|
case Math.random() < 0.7:
|
||||||
const shouldShowCowboy = Math.random() < 0.05; // 5%
|
imageOverride = [
|
||||||
if (shouldShowCowboy) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/beer.png",
|
||||||
{
|
sizeRange: [15, 35] as [number, number],
|
||||||
image: "/lightbar-images/auto-gun.png",
|
},
|
||||||
sizeRange: [28, 36] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/beer-bottle.png",
|
||||||
{
|
sizeRange: [10, 38] as [number, number],
|
||||||
image: "/lightbar-images/gun.png",
|
},
|
||||||
sizeRange: [23, 30] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/wine.png",
|
||||||
];
|
sizeRange: [15, 35] as [number, number],
|
||||||
imageParticleCount = particleCount / 11.6;
|
},
|
||||||
}
|
{
|
||||||
|
image: "/lightbar-images/cigarette.png",
|
||||||
|
sizeRange: [10, 38] as [number, number],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image: "/lightbar-images/cigarette2.png",
|
||||||
|
sizeRange: [15, 35] as [number, number],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
imageParticleCount = particleCount / 11;
|
||||||
|
break;
|
||||||
|
|
||||||
// Star easter egg
|
case Math.random() < 0.05:
|
||||||
const shouldShowStars = Math.random() < 0.15; // 15%
|
imageOverride = [
|
||||||
if (shouldShowStars) {
|
{
|
||||||
imageOverride = [
|
image: "/lightbar-images/auto-gun.png",
|
||||||
{
|
sizeRange: [28, 36] as [number, number],
|
||||||
image: "/lightbar-images/star.png",
|
},
|
||||||
sizeRange: [18, 28] as [number, number],
|
{
|
||||||
},
|
image: "/lightbar-images/gun.png",
|
||||||
];
|
sizeRange: [23, 30] as [number, number],
|
||||||
imageParticleCount = particleCount / 6.6;
|
},
|
||||||
|
];
|
||||||
|
imageParticleCount = particleCount / 11.6;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Math.random() < 0.15:
|
||||||
|
imageOverride = [
|
||||||
|
{
|
||||||
|
image: "/lightbar-images/star.png",
|
||||||
|
sizeRange: [18, 28] as [number, number],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
imageParticleCount = particleCount / 6.6;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Default case
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HOIST THE SAIL (of particles)!
|
// HOIST THE SAIL (of particles)!
|
||||||
|
|
Loading…
Reference in a new issue