Skip to content

Commit

Permalink
Add retry button to notfound and make another easter egg!
Browse files Browse the repository at this point in the history
  • Loading branch information
itzCozi committed Mar 1, 2024
1 parent 8c3c124 commit 507fa97
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 14 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -22,7 +22,7 @@
"purpose": "any"
},
{
"src": "public/android-chrome-192x192.png",
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
Expand Down
Binary file added public/lightbar-images/git.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/lightbar-images/ts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
24 changes: 20 additions & 4 deletions src/components/utils/Lightbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Particle {
canvas: HTMLCanvasElement,
options: LightbarOptions = {
horizontalMotion: false,
sizeRange: [10, 10],
sizeRange: [10, 15],
},
) {
if (options.imgSrc) {
Expand All @@ -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
Expand Down Expand Up @@ -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 = [
{
Expand All @@ -244,7 +244,7 @@ function ParticlesCanvas() {
sizeRange: [18, 27] as [number, number],
},
];
imageParticleCount = particleCount / 7.5;
imageParticleCount = particleCount / 7.85;
}

// Chicken easter egg
Expand All @@ -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;
Expand Down
26 changes: 18 additions & 8 deletions src/pages/parts/errors/NotFoundPart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
<Button
href="/"
theme="purple"
padding="md:px-12 p-2.5"
className="mt-6"
>
{t("notFound.goHome")}
</Button>
<div className="flex gap-3">
<Button
href="/"
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>
Expand Down

0 comments on commit 507fa97

Please sign in to comment.