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", "name": "sudo-flix",
"version": "4.5.0", "version": "4.5.1",
"private": true, "private": true,
"homepage": "https://sudo-flix.lol", "homepage": "https://sudo-flix.lol",
"scripts": { "scripts": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

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

View file

@ -386,7 +386,7 @@
"badge": "Not found", "badge": "Not found",
"detailsButton": "Show details", "detailsButton": "Show details",
"homeButton": "Go home", "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" "title": "We couldn't find that"
} }
}, },

View file

@ -52,7 +52,7 @@ class Particle {
this.radius = 1 + Math.floor(Math.random() * 0.5); this.radius = 1 + Math.floor(Math.random() * 0.5);
this.direction = (Math.random() * Math.PI) / 2 + Math.PI / 4; 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; const second = 60;
this.lifetime = second * 3 + Math.random() * (second * 30); this.lifetime = second * 3 + Math.random() * (second * 30);
@ -107,8 +107,14 @@ class Particle {
ctx.translate(this.x, this.y); ctx.translate(this.x, this.y);
const w = this.size; const w = this.size;
const h = (this.image.naturalWidth / this.image.naturalHeight) * w; const h = (this.image.naturalWidth / this.image.naturalHeight) * w;
ctx.rotate(this.direction - Math.PI); if (this.image.src.includes("shark")) {
ctx.drawImage(this.image, -w / 2, h, h, w); 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 { } else {
ctx.ellipse( ctx.ellipse(
this.x, this.x,
@ -138,7 +144,7 @@ function ParticlesCanvas() {
canvas.height = canvas.scrollHeight; canvas.height = canvas.scrollHeight;
// Basic particle config // Basic particle config
const particleCount = 25; const particleCount = Math.floor(Math.random() * (30 - 25 + 1)) + 25;
let imageParticleCount = particleCount; let imageParticleCount = particleCount;
// Holiday overrides // Holiday overrides
@ -160,36 +166,43 @@ function ParticlesCanvas() {
} }
// Fish easter egg // Fish easter egg
const shouldShowFishie = Math.floor(Math.random() * 75) > 69; const shouldShowFishie = Math.floor(Math.random() * 73) > 69;
if (shouldShowFishie) { if (shouldShowFishie) {
imageOverride = [ imageOverride = [
{ {
image: "/lightbar-images/fishie.png", image: "/lightbar-images/fishie.png",
sizeRange: [10, 13] as [number, number], 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 // 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) { if (shouldShowZa) {
imageOverride = [ imageOverride = [
{ {
image: "/lightbar-images/weed.png", image: "/lightbar-images/weed.png",
sizeRange: [23, 28] as [number, number], sizeRange: [25, 28] as [number, number],
}, },
]; ];
imageParticleCount = particleCount / 2; imageParticleCount = particleCount / 2;
} }
// Kitty easter egg // Kitty easter egg
const shouldShowCat = Math.floor(Math.random() * 83) > 50; const shouldShowCat = Math.floor(Math.random() * 50) > 45;
if (shouldShowCat) { if (shouldShowCat) {
imageOverride = [ imageOverride = [
{ {
image: "/lightbar-images/cat.png", image: "/lightbar-images/cat.png",
sizeRange: [26, 30] as [number, number], sizeRange: [27, 32] as [number, number],
}, },
]; ];
imageParticleCount = particleCount / 2; imageParticleCount = particleCount / 2;
@ -203,7 +216,7 @@ function ParticlesCanvas() {
const src = imageOverride[randomImageIndex]?.image; const src = imageOverride[randomImageIndex]?.image;
const particle = new Particle(canvas, { const particle = new Particle(canvas, {
imgSrc: isImageParticle ? src : undefined, imgSrc: isImageParticle ? src : undefined,
horizontalMotion: src?.includes("fishie"), horizontalMotion: src?.includes("fishie") || src?.includes("shark"),
sizeRange, sizeRange,
}); });
particles.push(particle); particles.push(particle);

View file

@ -1,5 +1,5 @@
import { useMemo } from "react"; import { useMemo } from "react";
import { useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import { Button } from "@/components/buttons/Button"; import { Button } from "@/components/buttons/Button";
@ -49,7 +49,19 @@ export function ScrapeErrorPart(props: ScrapeErrorPartProps) {
{t("player.scraping.notFound.badge")} {t("player.scraping.notFound.badge")}
</IconPill> </IconPill>
<Title>{t("player.scraping.notFound.title")}</Title> <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"> <div className="flex gap-3">
<Button <Button
href="/" href="/"