diff --git a/package.json b/package.json index 1264911..8ab1808 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@prisma/client": "^7.4.2", "@sveltejs/adapter-node": "^5.5.3", "@types/js-yaml": "^4.0.9", + "canvas-dither": "^1.0.1", "date-fns": "^4.1.0", "dotenv": "^17.3.1", "feed": "^4.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c074e90..1960783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 + canvas-dither: + specifier: ^1.0.1 + version: 1.0.1 date-fns: specifier: ^4.1.0 version: 4.1.0 @@ -1010,6 +1013,9 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + canvas-dither@1.0.1: + resolution: {integrity: sha512-wT1RnV2y9SauibcsfMMCagQTnXmyQq2nJXuX5tTEvo0sXm1vVbJ2r8QxSC3fRQMY3ZgZVq1j54cOvmO4u+Lu/A==} + ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -3165,6 +3171,8 @@ snapshots: callsites@3.1.0: {} + canvas-dither@1.0.1: {} + ccount@2.0.1: {} chai@5.3.3: diff --git a/src/routes/dither/+layout.svelte b/src/routes/dither/+layout.svelte new file mode 100644 index 0000000..e381018 --- /dev/null +++ b/src/routes/dither/+layout.svelte @@ -0,0 +1,29 @@ + + + + Dithering Tool | thomaswilson.xyz + + +
+

Image Dither Tool

+

+ In-browser, privacy respecting image dithering tool. +

+ {@render children()} +
+ + diff --git a/src/routes/dither/+page.svelte b/src/routes/dither/+page.svelte new file mode 100644 index 0000000..142e6b5 --- /dev/null +++ b/src/routes/dither/+page.svelte @@ -0,0 +1,158 @@ + + + + +

1: Select a file

+ +
+ +
+ +

2: Select a dithering algorithm

+ + + + +
+ ctx = canvas.getContext('2d')}> +
+ + +

+ 3: Save the file +

+ + + + diff --git a/src/routes/dither/Editor.svelte b/src/routes/dither/Editor.svelte new file mode 100644 index 0000000..30f65e0 --- /dev/null +++ b/src/routes/dither/Editor.svelte @@ -0,0 +1,9 @@ + diff --git a/src/routes/dither/ErrorMessage.svelte b/src/routes/dither/ErrorMessage.svelte new file mode 100644 index 0000000..1260cb5 --- /dev/null +++ b/src/routes/dither/ErrorMessage.svelte @@ -0,0 +1,18 @@ + + +{#if errorMessage} +
+

{errorMessage}

+
+{/if} + + diff --git a/src/routes/photo-posts/new/+page.server.ts b/src/routes/photo-posts/new/+page.server.ts new file mode 100644 index 0000000..2ded3ee --- /dev/null +++ b/src/routes/photo-posts/new/+page.server.ts @@ -0,0 +1,7 @@ +import type { PageServerLoad } from "./$types.js"; + +export const load: PageServerLoad = async({}) => { + return { + + } +} diff --git a/src/routes/photo-posts/new/+page.svelte b/src/routes/photo-posts/new/+page.svelte new file mode 100644 index 0000000..456f7fb --- /dev/null +++ b/src/routes/photo-posts/new/+page.svelte @@ -0,0 +1 @@ +

Create a new photo post

diff --git a/src/routes/photo-posts/new/page.server.ts b/src/routes/photo-posts/new/page.server.ts new file mode 100644 index 0000000..2ded3ee --- /dev/null +++ b/src/routes/photo-posts/new/page.server.ts @@ -0,0 +1,7 @@ +import type { PageServerLoad } from "./$types.js"; + +export const load: PageServerLoad = async({}) => { + return { + + } +}