From a00142e17c9b06b49103b541de3773fe2f49dd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Sun, 17 May 2026 15:31:05 -0300 Subject: [PATCH 1/3] feat: add custom 404 error page --- src/lib/translations/en-US/error.json | 15 ++ src/lib/translations/index.js | 10 + src/lib/translations/pt-BR/error.json | 15 ++ src/routes/+error.svelte | 283 ++++++++++++++++++++++++++ 4 files changed, 323 insertions(+) create mode 100644 src/lib/translations/en-US/error.json create mode 100644 src/lib/translations/pt-BR/error.json create mode 100644 src/routes/+error.svelte diff --git a/src/lib/translations/en-US/error.json b/src/lib/translations/en-US/error.json new file mode 100644 index 0000000..57dac99 --- /dev/null +++ b/src/lib/translations/en-US/error.json @@ -0,0 +1,15 @@ +{ + "seo.title": "Page not found — Embroidery Viewer", + "seo.description": "The page you are looking for could not be found.", + "seo.keywords": "404, page not found, embroidery viewer", + "seo.url": "https://embroideryviewer.xyz", + "notFound.code": "404", + "notFound.title": "This stitch went off pattern", + "notFound.description": "The page you are looking for may have been moved, removed, or never existed. Let's get you back to previewing embroidery designs.", + "notFound.home": "Back to home", + "notFound.viewer": "Open the viewer", + "notFound.imageAlt": "Embroidery design preview on screen", + "generic.title": "Something went wrong", + "generic.description": "We hit a snag while loading this page. Please try again or return to the home page.", + "generic.home": "Back to home" +} diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js index 7030ce3..a695a52 100644 --- a/src/lib/translations/index.js +++ b/src/lib/translations/index.js @@ -247,6 +247,16 @@ const config = { key: 'announcement', loader: async () => (await import('./en-US/announcement.json')).default, }, + { + locale: SUPPORTED_LOCALES.PT_BR, + key: 'error', + loader: async () => (await import('./pt-BR/error.json')).default, + }, + { + locale: SUPPORTED_LOCALES.EN_US, + key: 'error', + loader: async () => (await import('./en-US/error.json')).default, + }, ], }; diff --git a/src/lib/translations/pt-BR/error.json b/src/lib/translations/pt-BR/error.json new file mode 100644 index 0000000..261fe67 --- /dev/null +++ b/src/lib/translations/pt-BR/error.json @@ -0,0 +1,15 @@ +{ + "seo.title": "Página não encontrada — Embroidery Viewer", + "seo.description": "A página que você procura não foi encontrada.", + "seo.keywords": "404, página não encontrada, visualizador de bordado", + "seo.url": "https://embroideryviewer.xyz", + "notFound.code": "404", + "notFound.title": "Este ponto saiu do desenho", + "notFound.description": "A página pode ter sido movida, removida ou nunca existiu. Vamos voltar para visualizar seus bordados.", + "notFound.home": "Voltar ao início", + "notFound.viewer": "Abrir o visualizador", + "notFound.imageAlt": "Prévia de desenho de bordado na tela", + "generic.title": "Algo deu errado", + "generic.description": "Encontramos um problema ao carregar esta página. Tente novamente ou volte ao início.", + "generic.home": "Voltar ao início" +} diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte new file mode 100644 index 0000000..7041516 --- /dev/null +++ b/src/routes/+error.svelte @@ -0,0 +1,283 @@ + + + + + + + + + + {isNotFound ? $t('error.notFound.code') : status} + + {isNotFound ? $t('error.notFound.title') : $t('error.generic.title')} + + + {isNotFound + ? $t('error.notFound.description') + : $t('error.generic.description')} + + + + + {isNotFound ? $t('error.notFound.home') : $t('error.generic.home')} + + {#if isNotFound} + + {$t('error.notFound.viewer')} + + {/if} + + + + {#if isNotFound} + + + + + + + + + {/if} + + + + From b0199136216693feed31e7f4d2f1ed6dc4f8825b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Sun, 17 May 2026 15:34:32 -0300 Subject: [PATCH 2/3] style: add some styling to footer --- src/lib/components/Footer.svelte | 117 ++++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index c784631..a8faaa0 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -9,6 +9,66 @@
{isNotFound ? $t('error.notFound.code') : status}
+ {isNotFound + ? $t('error.notFound.description') + : $t('error.generic.description')} +