Add sharks, fix easter eggs and increase visablity of 'did you enable the extension?'

This commit is contained in:
Cooper Ransom 2024-02-28 15:42:10 -05:00
parent aba645817c
commit d0df347e7a
6 changed files with 41 additions and 16 deletions

View file

@ -1,6 +1,6 @@
{
"name": "sudo-flix",
"version": "4.5.0",
"version": "4.5.1",
"private": true,
"homepage": "https://sudo-flix.lol",
"scripts": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -139,7 +139,7 @@
}
},
"media": {
"episodeDisplay": "S{{season}} E{{episode}}",
"episodeDisplay": "S{{season}} - E{{episode}}",
"types": {
"movie": "Meow Movie",
"show": "Meow Show"

View file

@ -386,7 +386,7 @@
"badge": "Not found",
"detailsButton": "Show details",
"homeButton": "Go home",
"text": "We can not find the media you are looking for or no one provides it... Did you enable the extension for this site?",
"text": "We can not find the media you are looking for or no one provides it... <bold>Did you enable the extension for this site?</bold>",
"title": "We couldn't find that"
}
},

View file

@ -52,7 +52,7 @@ class Particle {
this.radius = 1 + Math.floor(Math.random() * 0.5);
this.direction = (Math.random() * Math.PI) / 2 + Math.PI / 4;
this.speed = 0.02 + Math.random() * 0.08;
this.speed = 0.02 + Math.random() * 0.085;
const second = 60;
this.lifetime = second * 3 + Math.random() * (second * 30);
@ -107,8 +107,14 @@ class Particle {
ctx.translate(this.x, this.y);
const w = this.size;
const h = (this.image.naturalWidth / this.image.naturalHeight) * w;
ctx.rotate(this.direction - Math.PI);
ctx.drawImage(this.image, -w / 2, h, h, w);
if (this.image.src.includes("shark")) {
const flip = this.direction === Math.PI ? 1 : -1;
ctx.scale(flip, 1);
ctx.drawImage(this.image, (-w / 2) * flip, -h / 2, w, h);
} else {
ctx.rotate(this.direction - Math.PI);
ctx.drawImage(this.image, -w / 2, h, h, w);
}
} else {
ctx.ellipse(
this.x,
@ -138,7 +144,7 @@ function ParticlesCanvas() {
canvas.height = canvas.scrollHeight;
// Basic particle config
const particleCount = 25;
const particleCount = Math.floor(Math.random() * (30 - 25 + 1)) + 25;
let imageParticleCount = particleCount;
// Holiday overrides
@ -160,36 +166,43 @@ function ParticlesCanvas() {
}
// Fish easter egg
const shouldShowFishie = Math.floor(Math.random() * 75) > 69;
const shouldShowFishie = Math.floor(Math.random() * 73) > 69;
if (shouldShowFishie) {
imageOverride = [
{
image: "/lightbar-images/fishie.png",
sizeRange: [10, 13] as [number, number],
},
{
image: "/lightbar-images/shark.png",
sizeRange: [48, 56] as [number, number],
},
];
imageParticleCount = particleCount / 2;
imageParticleCount = particleCount * 0.9; // Adjusting the count to display significantly more fish than sharks
}
// Weed easter egg
const shouldShowZa = Math.floor(Math.random() * 435) > 420;
const month2 = date.getMonth() + 1;
const day2 = date.getDate();
const shouldShowZa =
(month2 === 4 && day2 === 20) || Math.floor(Math.random() * 425) > 420;
if (shouldShowZa) {
imageOverride = [
{
image: "/lightbar-images/weed.png",
sizeRange: [23, 28] as [number, number],
sizeRange: [25, 28] as [number, number],
},
];
imageParticleCount = particleCount / 2;
}
// Kitty easter egg
const shouldShowCat = Math.floor(Math.random() * 83) > 50;
const shouldShowCat = Math.floor(Math.random() * 50) > 45;
if (shouldShowCat) {
imageOverride = [
{
image: "/lightbar-images/cat.png",
sizeRange: [26, 30] as [number, number],
sizeRange: [27, 32] as [number, number],
},
];
imageParticleCount = particleCount / 2;
@ -203,7 +216,7 @@ function ParticlesCanvas() {
const src = imageOverride[randomImageIndex]?.image;
const particle = new Particle(canvas, {
imgSrc: isImageParticle ? src : undefined,
horizontalMotion: src?.includes("fishie"),
horizontalMotion: src?.includes("fishie") || src?.includes("shark"),
sizeRange,
});
particles.push(particle);

View file

@ -1,5 +1,5 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Trans, useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";
import { Button } from "@/components/buttons/Button";
@ -49,7 +49,19 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) {
{t("player.scraping.notFound.badge")}
</IconPill>
<Title>{t("player.scraping.notFound.title")}</Title>
<Paragraph>{t("player.scraping.notFound.text")}</Paragraph>
<Paragraph>
<Trans
i18nKey="player.scraping.notFound.text"
components={{
bold: (
<span
className="text-white·font-bold"
style={{ color: "#DADADA" }}
/>
),
}}
/>
</Paragraph>
<div className="flex gap-3">
<Button
href="/"