From 2c57189a4831931d7bd6b28331425928684051c6 Mon Sep 17 00:00:00 2001 From: Sebastian Flick Date: Wed, 15 May 2024 17:18:03 +0200 Subject: [PATCH] add custom modal for info --- src/lib/InfoModal.svelte | 33 +++++++++++++++++++++ src/routes/+layout.svelte | 8 ++++- src/routes/+page.svelte | 61 +++++++++++++++++++++++++++------------ 3 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 src/lib/InfoModal.svelte diff --git a/src/lib/InfoModal.svelte b/src/lib/InfoModal.svelte new file mode 100644 index 0000000..ddcf113 --- /dev/null +++ b/src/lib/InfoModal.svelte @@ -0,0 +1,33 @@ + + + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ef3cf8d..df6bf59 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -3,10 +3,16 @@ import '@fortawesome/fontawesome-free/css/solid.min.css'; import '@fortawesome/fontawesome-free/css/fontawesome.min.css'; import { initializeStores, Modal } from '@skeletonlabs/skeleton'; + import type { ModalComponent } from '@skeletonlabs/skeleton'; + import InfoModal from '$lib/InfoModal.svelte'; + + const modalRegistry: Record = { + info: { ref: InfoModal } + }; initializeStores(); - + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 4fde16c..fc8530b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -29,6 +29,31 @@ `, buttonTextCancel: 'Close' }; + + const atlanticInfo: ModalSettings = { + type: 'component', + component: 'info', + title: 'Black Atlantic', + meta: { + region: 'black-atlantic', + btnClasses: 'btn variant-filled-secondary', + tabs: [ + { + name: 'mood', + label: 'Mood', + content: `

This is the Northern Sea region. This region encompasses texts that are set in countries +bordering the North Sea, the Baltic Sea, parts of the North Atlantic Ocean and the +Norwegian +Sea. For this region, some clear results have been identified. The materiality +of the beaches in these texts are often rocky, shingles, fossils, driftwood +and plastic. +The mood is also characterised +by being contemplative, curious, +and morbid.

` + } + ] + } + }; let svg: SVGElement; @@ -132,46 +157,46 @@ fill="transparent" points="962,1957 1096,2075 1356,2173 1596,2248 2399,2465 2482,2343,2415,2197,2332,2110,2151,2099,2100,2004,2155,1886,2163,1819,2139,1772,2147,1713,2171,1669,2226,1650,2234,1595,2210,1579,1545,1654,1340,1642,1269,1646,1194,1756,1037,1788,989,1862" > - - + + {#if svg?.clientWidth}{/if} + - - + + {#if svg?.clientWidth}{/if} + - - + + {#if svg?.clientWidth}{/if} +