diff --git a/src/app.css b/src/app.css index 77bf6af..d7100cb 100644 --- a/src/app.css +++ b/src/app.css @@ -1,17 +1,14 @@ @import '@fontsource/fira-mono'; :root { - font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, - Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - --font-mono: 'Fira Mono', monospace; + font-family: 'Syne Mono', monospace; --pure-white: #ffffff; - --primary-color: #b9c6d2; - --secondary-color: #d0dde9; - --tertiary-color: #edf0f8; - --accent-color: #ff3e00; + --primary-color: #642aa7; + --secondary-color: #5c0ac7; + --tertiary-color: #385196; + --accent-color: #4b0981; --heading-color: rgba(0, 0, 0, 0.7); - --text-color: #444444; - --background-without-opacity: rgba(255, 255, 255, 0.7); + --background-without-opacity: rgba(8, 4, 4, 0.7); --column-width: 42rem; --column-margin-top: 4rem; } @@ -53,7 +50,7 @@ body::before { h1, h2, p { - font-weight: 400; + font-weight: 800; color: var(--heading-color); } @@ -71,23 +68,12 @@ a:hover { } h1 { - font-size: 2rem; + font-size: 2.2rem; text-align: center; } h2 { - font-size: 1rem; -} - -pre { - font-size: 16px; - font-family: var(--font-mono); - background-color: rgba(255, 255, 255, 0.45); - border-radius: 3px; - box-shadow: 2px 2px 6px rgb(255 255 255 / 25%); - padding: 0.5em; - overflow-x: auto; - color: var(--text-color); + font-size: 2rem; } input, diff --git a/src/app.html b/src/app.html index e7d2cbd..e198983 100644 --- a/src/app.html +++ b/src/app.html @@ -1,13 +1,17 @@ - - - - - - %svelte.head% - - -
%svelte.body%
- - + + + + + + + + %svelte.head% + + + +
%svelte.body%
+ + + \ No newline at end of file diff --git a/src/lib/Counter.svelte b/src/lib/Counter.svelte deleted file mode 100644 index 0df76f5..0000000 --- a/src/lib/Counter.svelte +++ /dev/null @@ -1,102 +0,0 @@ - - -
- - -
-
- - {Math.floor($displayed_count)} -
-
- - -
- - diff --git a/src/lib/form.ts b/src/lib/form.ts deleted file mode 100644 index 787a397..0000000 --- a/src/lib/form.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { invalidate } from '$app/navigation'; - -// this action (https://svelte.dev/tutorial/actions) allows us to -// progressively enhance a
that already works without JS -export function enhance( - form: HTMLFormElement, - { - pending, - error, - result - }: { - pending?: ({ data, form }: { data: FormData; form: HTMLFormElement }) => void; - error?: ({ - data, - form, - response, - error - }: { - data: FormData; - form: HTMLFormElement; - response: Response | null; - error: Error | null; - }) => void; - result?: ({ - data, - form, - response - }: { - data: FormData; - response: Response; - form: HTMLFormElement; - }) => void; - } = {} -): { destroy: () => void } { - let current_token: unknown; - - async function handle_submit(e: Event) { - const token = (current_token = {}); - - e.preventDefault(); - - const data = new FormData(form); - - if (pending) pending({ data, form }); - - try { - const response = await fetch(form.action, { - method: form.method, - headers: { - accept: 'application/json' - }, - body: data - }); - - if (token !== current_token) return; - - if (response.ok) { - if (result) result({ data, form, response }); - - const url = new URL(form.action); - url.search = url.hash = ''; - invalidate(url.href); - } else if (error) { - error({ data, form, error: null, response }); - } else { - console.error(await response.text()); - } - } catch (e: any) { - if (error) { - error({ data, form, error: e, response: null }); - } else { - throw e; - } - } - } - - form.addEventListener('submit', handle_submit); - - return { - destroy() { - form.removeEventListener('submit', handle_submit); - } - }; -} diff --git a/src/lib/header/Header.svelte b/src/lib/header/Header.svelte index 9d3120f..9a67de9 100644 --- a/src/lib/header/Header.svelte +++ b/src/lib/header/Header.svelte @@ -1,36 +1,23 @@
-
- - SvelteKit - -
+
-
- -
+
diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 68311dd..9623091 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -2,58 +2,44 @@ export const prerender = true; - - - Home + Me
-

-
- - - Welcome - -
- to your new
SvelteKit app -

+

I am

-

- try editing src/routes/index.svelte -

- - +
+

For

+
    +
  • open source coding
  • +
  • made-to-be-fixed electronics
  • +
  • internet self-sufficientcy
  • +
  • private personal data
  • +
+

Against

+
    +
  • targeted advertisement
  • +
  • unregulated social media platforms
  • +
  • closed firmware
  • +
  • browser cookies
  • +
diff --git a/src/routes/projects.svelte b/src/routes/projects.svelte new file mode 100644 index 0000000..5056ec1 --- /dev/null +++ b/src/routes/projects.svelte @@ -0,0 +1,27 @@ + + + + Projekteja + + +
+

Computer workshop

+

Come get your eletronics fixed. Every Thursday in Aliopisto of Livonsaari 18:00.

+

More info from: tietokonepaja.net

+
+ + diff --git a/src/routes/todos/_api.ts b/src/routes/todos/_api.ts deleted file mode 100644 index 397cdda..0000000 --- a/src/routes/todos/_api.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - This module is used by the /todos endpoint to - make calls to api.svelte.dev, which stores todos - for each user. The leading underscore indicates that this is - a private module, _not_ an endpoint — visiting /todos/_api - will net you a 404 response. - - (The data on the todo app will expire periodically; no - guarantees are made. Don't use it to organise your life.) -*/ - -const base = 'https://api.svelte.dev'; - -export function api(method: string, resource: string, data?: Record) { - return fetch(`${base}/${resource}`, { - method, - headers: { - 'content-type': 'application/json' - }, - body: data && JSON.stringify(data) - }); -} diff --git a/src/routes/todos/index.svelte b/src/routes/todos/index.svelte deleted file mode 100644 index 7f997c2..0000000 --- a/src/routes/todos/index.svelte +++ /dev/null @@ -1,186 +0,0 @@ - - - - Todos - - -
-

Todos

- - { - form.reset(); - } - }} - > - - - - {#each todos as todo (todo.uid)} -
-
{ - todo.done = !!data.get('done'); - } - }} - > - - -
- {/each} -
- - diff --git a/src/routes/todos/index.ts b/src/routes/todos/index.ts deleted file mode 100644 index fc8bd4b..0000000 --- a/src/routes/todos/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { api } from './_api'; -import type { RequestHandler } from '@sveltejs/kit'; - -export const get: RequestHandler = async ({ locals }) => { - // locals.userid comes from src/hooks.js - const response = await api('get', `todos/${locals.userid}`); - - if (response.status === 404) { - // user hasn't created a todo list. - // start with an empty array - return { - body: { - todos: [] - } - }; - } - - if (response.status === 200) { - return { - body: { - todos: await response.json() - } - }; - } - - return { - status: response.status - }; -}; - -export const post: RequestHandler = async ({ request, locals }) => { - const form = await request.formData(); - - await api('post', `todos/${locals.userid}`, { - text: form.get('text') - }); - - return {}; -}; - -// If the user has JavaScript disabled, the URL will change to -// include the method override unless we redirect back to /todos -const redirect = { - status: 303, - headers: { - location: '/todos' - } -}; - -export const patch: RequestHandler = async ({ request, locals }) => { - const form = await request.formData(); - - await api('patch', `todos/${locals.userid}/${form.get('uid')}`, { - text: form.has('text') ? form.get('text') : undefined, - done: form.has('done') ? !!form.get('done') : undefined - }); - - return redirect; -}; - -export const del: RequestHandler = async ({ request, locals }) => { - const form = await request.formData(); - - await api('delete', `todos/${locals.userid}/${form.get('uid')}`); - - return redirect; -}; diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..d7ebb6d Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/favicon.png b/static/favicon.png deleted file mode 100644 index 825b9e6..0000000 Binary files a/static/favicon.png and /dev/null differ diff --git a/static/me.png b/static/me.png new file mode 100644 index 0000000..c228461 Binary files /dev/null and b/static/me.png differ diff --git a/static/svelte-welcome.png b/static/svelte-welcome.png deleted file mode 100644 index fe7d2d6..0000000 Binary files a/static/svelte-welcome.png and /dev/null differ diff --git a/static/svelte-welcome.webp b/static/svelte-welcome.webp deleted file mode 100644 index 6ec1a28..0000000 Binary files a/static/svelte-welcome.webp and /dev/null differ