1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Add retry button to notfound and make another easter egg!

This commit is contained in:
Cooper Ransom 2024-03-01 16:38:44 -05:00
parent 8c3c124516
commit 507fa97d77
6 changed files with 41 additions and 14 deletions

View file

@ -10,7 +10,7 @@
"theme_color": "#120f1d", "theme_color": "#120f1d",
"icons": [ "icons": [
{ {
"src": "public/android-chrome-192x192.png", "src": "/android-chrome-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png", "type": "image/png",
"purpose": "any" "purpose": "any"
@ -22,7 +22,7 @@
"purpose": "any" "purpose": "any"
}, },
{ {
"src": "public/android-chrome-192x192.png", "src": "/android-chrome-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png", "type": "image/png",
"purpose": "maskable" "purpose": "maskable"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

@ -177,6 +177,7 @@
"notFound": { "notFound": {
"badge": "Not found", "badge": "Not found",
"goHome": "Back to home", "goHome": "Back to home",
"reloadButton": "Try again",
"message": "We looked everywhere: under the bins, in the closet, behind the proxy but ultimately couldn't find the page you are looking for. (ಥ﹏ಥ)", "message": "We looked everywhere: under the bins, in the closet, behind the proxy but ultimately couldn't find the page you are looking for. (ಥ﹏ಥ)",
"title": "Couldn't find that page" "title": "Couldn't find that page"
}, },

View file

@ -32,7 +32,7 @@ class Particle {
canvas: HTMLCanvasElement, canvas: HTMLCanvasElement,
options: LightbarOptions = { options: LightbarOptions = {
horizontalMotion: false, horizontalMotion: false,
sizeRange: [10, 10], sizeRange: [10, 15],
}, },
) { ) {
if (options.imgSrc) { if (options.imgSrc) {
@ -54,7 +54,7 @@ class Particle {
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.085; this.speed = 0.02 + Math.random() * 0.085;
const second = 60; const second = 75;
this.lifetime = second * 3 + Math.random() * (second * 30); this.lifetime = second * 3 + Math.random() * (second * 30);
this.size = this.options.sizeRange this.size = this.options.sizeRange
@ -220,7 +220,7 @@ function ParticlesCanvas() {
} }
// Kitty easter egg // Kitty easter egg
const shouldShowCat = Math.random() < 0.3; // 30% const shouldShowCat = Math.random() < 0.25; // 25%
if (shouldShowCat) { if (shouldShowCat) {
imageOverride = [ imageOverride = [
{ {
@ -244,7 +244,7 @@ function ParticlesCanvas() {
sizeRange: [18, 27] as [number, number], sizeRange: [18, 27] as [number, number],
}, },
]; ];
imageParticleCount = particleCount / 7.5; imageParticleCount = particleCount / 7.85;
} }
// Chicken easter egg // Chicken easter egg
@ -267,6 +267,22 @@ function ParticlesCanvas() {
imageParticleCount = particleCount / 9; imageParticleCount = particleCount / 9;
} }
// Dev easter egg
const shouldShowCode = Math.random() < 0.9; // 25%
if (shouldShowCode) {
imageOverride = [
{
image: "/lightbar-images/ts.png",
sizeRange: [20, 32] as [number, number],
},
{
image: "/lightbar-images/git.png",
sizeRange: [20, 28] as [number, number],
},
];
imageParticleCount = particleCount / 9;
}
// HOIST THE SAIL (of particles)! // HOIST THE SAIL (of particles)!
for (let i = 0; i < particleCount; i += 1) { for (let i = 0; i < particleCount; i += 1) {
const isImageParticle = imageOverride && i <= imageParticleCount; const isImageParticle = imageOverride && i <= imageParticleCount;

View file

@ -24,14 +24,24 @@ export function NotFoundPart() {
<IconPill icon={Icons.EYE_SLASH}>{t("notFound.badge")}</IconPill> <IconPill icon={Icons.EYE_SLASH}>{t("notFound.badge")}</IconPill>
<Title>{t("notFound.title")}</Title> <Title>{t("notFound.title")}</Title>
<Paragraph>{t("notFound.message")}</Paragraph> <Paragraph>{t("notFound.message")}</Paragraph>
<div className="flex gap-3">
<Button <Button
href="/" href="/"
theme="purple" theme="secondary"
padding="md:px-12 p-2.5" padding="md:px-12 p-2.5"
className="mt-6" className="mt-6"
> >
{t("notFound.goHome")} {t("notFound.goHome")}
</Button> </Button>
<Button
onClick={() => window.location.reload()}
theme="purple"
padding="md:px-12 p-2.5"
className="mt-6"
>
{t("notFound.reloadButton")}
</Button>
</div>
</ErrorContainer> </ErrorContainer>
</ErrorLayout> </ErrorLayout>
</div> </div>