From a723e56b4ce392d2b11d28f2745279aa825a2ee1 Mon Sep 17 00:00:00 2001 From: memdmp Date: Mon, 21 Jul 2025 22:53:11 +0200 Subject: feat: initial commit --- src/routes/train-ico/[type]/[[line]]/+page.svelte | 13 ++++++++++++ src/routes/train-ico/[type]/[[line]]/+page.ts | 1 + .../train-ico/[type]/[[line]]/.svg/+server.ts | 23 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/routes/train-ico/[type]/[[line]]/+page.svelte create mode 100644 src/routes/train-ico/[type]/[[line]]/+page.ts create mode 100644 src/routes/train-ico/[type]/[[line]]/.svg/+server.ts (limited to 'src/routes/train-ico') diff --git a/src/routes/train-ico/[type]/[[line]]/+page.svelte b/src/routes/train-ico/[type]/[[line]]/+page.svelte new file mode 100644 index 0000000..915f57b --- /dev/null +++ b/src/routes/train-ico/[type]/[[line]]/+page.svelte @@ -0,0 +1,13 @@ + + + diff --git a/src/routes/train-ico/[type]/[[line]]/+page.ts b/src/routes/train-ico/[type]/[[line]]/+page.ts new file mode 100644 index 0000000..3eeed27 --- /dev/null +++ b/src/routes/train-ico/[type]/[[line]]/+page.ts @@ -0,0 +1 @@ +export const load = ({ params }) => ({ params }); diff --git a/src/routes/train-ico/[type]/[[line]]/.svg/+server.ts b/src/routes/train-ico/[type]/[[line]]/.svg/+server.ts new file mode 100644 index 0000000..0120348 --- /dev/null +++ b/src/routes/train-ico/[type]/[[line]]/.svg/+server.ts @@ -0,0 +1,23 @@ +import LineGlyph from '$lib/assets/LineGlyph.svelte'; +import { render } from 'svelte/server'; +import { optimize } from 'svgo'; +export const GET = ({ params }) => { + return new Response( + optimize(` +${render(LineGlyph, { + props: { + kind: `${params.type}${params.line}`, + type: `${params.type}`, + line: params.line, + }, +}).body.replace( + '