diff --git a/src/lib/components/Gallery.svelte b/src/lib/components/Gallery.svelte index a310444..fd07a6d 100644 --- a/src/lib/components/Gallery.svelte +++ b/src/lib/components/Gallery.svelte @@ -14,7 +14,8 @@
@@ -22,10 +23,18 @@ diff --git a/src/lib/components/Icon.svelte b/src/lib/components/Icon.svelte index 74aba40..bc7097a 100644 --- a/src/lib/components/Icon.svelte +++ b/src/lib/components/Icon.svelte @@ -22,7 +22,7 @@ /** Load the icon from the `$lib/icons` folder. */ async function loadIcon(mdi: string) { if (mdi === mdiOld) return; - path = (await import(`$lib/icons/${mdi}.js`)).default; + path = (await import(`$lib/icons/${mdi}.ts`)).default; } diff --git a/src/lib/components/Photo.svelte b/src/lib/components/Photo.svelte index 1202138..9e567aa 100644 --- a/src/lib/components/Photo.svelte +++ b/src/lib/components/Photo.svelte @@ -17,8 +17,10 @@ /** The click handler for the image. */ async function clickHandler(event: MouseEvent) { - event.preventDefault(); console.log('click', event); + if (!event.shiftKey && !event.ctrlKey) { + event.preventDefault(); + } } /** The right click handler for the image. */ @@ -50,10 +52,10 @@ - +
- {title} + {title} {author}
@@ -67,25 +69,34 @@ position: relative; height: fit-content; border-radius: 10px; - overflow: hidden; - min-width: 28.125em } figure { - width: 28.125em; - height: 18.75em; + width: var(--image-width, 28.125em); + height: var(--image-height, 18.75em); background-color: rgba(0,0,0,.25); background-image: linear-gradient(rgba(0,0,0,.125), rgba(0,0,0,.25)), var(--image); background-position: center; background-size: cover; + overflow: hidden; + border-radius: 10px; + } + + picture { + position: relative; } img { position: absolute; - width: 28.125em; - height: 18.75em; + width: var(--image-width, 28.125em); + height: var(--image-height, 18.75em); object-fit: contain; top: 0; + border-radius: 10px; + overflow: hidden; + clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); + transform: scale(1.001); + transition: transform .5s cubic-bezier(.23,.13,.45,.97), clip-path .5s cubic-bezier(.23,.13,.45,.97); } figcaption { @@ -94,7 +105,7 @@ bottom: 0; left: 0; width: 100%; - padding: 1em; + padding: 1.5em; opacity: 0; transition: opacity .5s; z-index: 1; @@ -102,8 +113,9 @@ pointer-events: none; } - b { + strong { font-size: 1.25em; + letter-spacing: .05em; } cite { @@ -120,17 +132,31 @@ left: 0; width: 100%; height: 100%; - background-color: rgba(0,0,0,.5); - color: inherit; + background-color: transparent;; + color: transparent; text-decoration: none; - opacity: 0; - transition: opacity .5s; + transition: background-color .5s, color .5s; justify-content: center; align-content: center; + border-radius: 10px; + overflow: hidden; } - li:hover :is(figcaption, a) { + a:focus { + outline: 2px solid var(--main-text-color); + } + + li:hover img { + transform: scale(1.25); + } + + li:hover figcaption { opacity: 1; } + li:hover a { + background-color: rgba(0,0,0,.75); + color: inherit; + } + diff --git a/src/lib/data/language.ts b/src/lib/data/language.ts index 58ac23f..c66f17c 100644 --- a/src/lib/data/language.ts +++ b/src/lib/data/language.ts @@ -5,6 +5,7 @@ export const language: Writable = writable('de'); const translations: Record> = { de: { 'gallery': 'Galerie', + 'gallery-description': 'Fotogalerie von Luca Bosin', 'album': 'Album', 'albums': 'Alben', 'photo': 'Foto', @@ -19,9 +20,13 @@ const translations: Record> = { 'open-name': '{0} öffnen', 'download': 'Herunterladen', 'download-all': 'Alle herunterladen', + 'author': 'Autor', + 'authors': 'Autoren', + 'license': 'Lizenz', }, en: { 'gallery': 'Gallery', + 'gallery-description': 'Photo gallery by Luca Bosin', 'album': 'Album', 'albums': 'Albums', 'photo': 'Photo', @@ -36,6 +41,9 @@ const translations: Record> = { 'open-name': 'Open {0}', 'download': 'Download', 'download-all': 'Download all', + 'author': 'Author', + 'authors': 'Authors', + 'license': 'License', } }; diff --git a/src/lib/styles/base.css b/src/lib/styles/base.css index 4641a38..3d7f007 100644 --- a/src/lib/styles/base.css +++ b/src/lib/styles/base.css @@ -1,12 +1,30 @@ :root { --main-text-color: #1a1a1a; --main-bg-color: #fff; + + --interactive-color: var(--main-text-color); + + --interactive-text-color: var(--main-text-color); + --interactive-text-hover-color: var(--main-bg-color); + --interactive-bg-color: #d4d4d4; + --interactive-bg-hover-color: var(--main-text-color); + + --primary-color: #1a1a1a; } @media screen and (prefers-color-scheme: dark) { :root { --main-text-color: #e7e7e7; - --main-bg-color: #1a1a1a; + --main-bg-color: #181818; + + /* --interactive-color: var(--main-text-color); */ + + /* --interactive-text-color: var(--main-text-color); */ + --interactive-text-hover-color: #fff; + --interactive-bg-color: #272727; + --interactive-bg-hover-color: #353535; + + /* --primary-color: #1a1a1a; */ } } @@ -16,7 +34,7 @@ border: 0; box-sizing: border-box; font-size: 1em; - font-family: 'Roboto', 'Open Sans', sans-serif; + font-family: 'Poppins', sans-serif; } html, @@ -28,7 +46,7 @@ body, } body { - font-family: sans-serif; + font-family: 'Poppins', sans-serif; background-color: var(--main-bg-color); color: var(--main-text-color); } diff --git a/src/routes/[slug]/[[timestamp]]/+page.svelte b/src/routes/[slug]/[[timestamp]]/+page.svelte index f15d801..f51e45f 100644 --- a/src/routes/[slug]/[[timestamp]]/+page.svelte +++ b/src/routes/[slug]/[[timestamp]]/+page.svelte @@ -4,17 +4,13 @@ import Header from '$lib/components/Header.svelte'; import Gallery from '$lib/components/Gallery.svelte'; import type { PageData } from './$types'; + import Footer from '$lib/components/Footer.svelte'; export let data: PageData; -
-

- Description: {#if data.album.description}{$strf(data.album.description)}{:else}no description{/if}
- Authors: {#if data.album.authors}{Array.isArray(data.album.authors) ? data.album.authors.join(', ') : data.album.authors}{:else}unknown author{/if}
- Sorting Date: {data.album.date}
- License: {data.album.license}
-

+
+