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:
parent
8c3c124516
commit
507fa97d77
6 changed files with 41 additions and 14 deletions
|
@ -10,7 +10,7 @@
|
|||
"theme_color": "#120f1d",
|
||||
"icons": [
|
||||
{
|
||||
"src": "public/android-chrome-192x192.png",
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
|
@ -22,7 +22,7 @@
|
|||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "public/android-chrome-192x192.png",
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
|
|
BIN
public/lightbar-images/git.png
Normal file
BIN
public/lightbar-images/git.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
public/lightbar-images/ts.png
Normal file
BIN
public/lightbar-images/ts.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
|
@ -177,6 +177,7 @@
|
|||
"notFound": {
|
||||
"badge": "Not found",
|
||||
"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. (ಥ﹏ಥ)",
|
||||
"title": "Couldn't find that page"
|
||||
},
|
||||
|
|
|
@ -32,7 +32,7 @@ class Particle {
|
|||
canvas: HTMLCanvasElement,
|
||||
options: LightbarOptions = {
|
||||
horizontalMotion: false,
|
||||
sizeRange: [10, 10],
|
||||
sizeRange: [10, 15],
|
||||
},
|
||||
) {
|
||||
if (options.imgSrc) {
|
||||
|
@ -54,7 +54,7 @@ class Particle {
|
|||
this.direction = (Math.random() * Math.PI) / 2 + Math.PI / 4;
|
||||
this.speed = 0.02 + Math.random() * 0.085;
|
||||
|
||||
const second = 60;
|
||||
const second = 75;
|
||||
this.lifetime = second * 3 + Math.random() * (second * 30);
|
||||
|
||||
this.size = this.options.sizeRange
|
||||
|
@ -220,7 +220,7 @@ function ParticlesCanvas() {
|
|||
}
|
||||
|
||||
// Kitty easter egg
|
||||
const shouldShowCat = Math.random() < 0.3; // 30%
|
||||
const shouldShowCat = Math.random() < 0.25; // 25%
|
||||
if (shouldShowCat) {
|
||||
imageOverride = [
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ function ParticlesCanvas() {
|
|||
sizeRange: [18, 27] as [number, number],
|
||||
},
|
||||
];
|
||||
imageParticleCount = particleCount / 7.5;
|
||||
imageParticleCount = particleCount / 7.85;
|
||||
}
|
||||
|
||||
// Chicken easter egg
|
||||
|
@ -267,6 +267,22 @@ function ParticlesCanvas() {
|
|||
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)!
|
||||
for (let i = 0; i < particleCount; i += 1) {
|
||||
const isImageParticle = imageOverride && i <= imageParticleCount;
|
||||
|
|
|
@ -24,14 +24,24 @@ export function NotFoundPart() {
|
|||
<IconPill icon={Icons.EYE_SLASH}>{t("notFound.badge")}</IconPill>
|
||||
<Title>{t("notFound.title")}</Title>
|
||||
<Paragraph>{t("notFound.message")}</Paragraph>
|
||||
<div className="flex gap-3">
|
||||
<Button
|
||||
href="/"
|
||||
theme="purple"
|
||||
theme="secondary"
|
||||
padding="md:px-12 p-2.5"
|
||||
className="mt-6"
|
||||
>
|
||||
{t("notFound.goHome")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => window.location.reload()}
|
||||
theme="purple"
|
||||
padding="md:px-12 p-2.5"
|
||||
className="mt-6"
|
||||
>
|
||||
{t("notFound.reloadButton")}
|
||||
</Button>
|
||||
</div>
|
||||
</ErrorContainer>
|
||||
</ErrorLayout>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue