Skip to content

Commit c139b15

Browse files
committed
feat(museum): Enhance museum page layout and add external URLs
1 parent 6922cd5 commit c139b15

2 files changed

Lines changed: 95 additions & 35 deletions

File tree

frontend/src/routes/museum/[slug]/+page.server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export async function load({ params: { slug } }) {
99
* @type {{
1010
* slug: string,
1111
* uri: string,
12+
* url: string | undefined,
1213
* name: string,
1314
* type: string,
1415
* description: string,

frontend/src/routes/museum/[slug]/+page.svelte

Lines changed: 94 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,52 +24,111 @@
2424

2525
<article>
2626
<header>
27-
<hgroup>
28-
<h1>
29-
{museum.name}
30-
<small class="badge">{museum.type}</small>
31-
</h1>
32-
<p class="description">
33-
{museum.description}
34-
</p>
35-
<a href={museum.uri} target="museum">
36-
View in current site <LucideExternalLink />
37-
</a>
38-
{#if museum.url}
39-
<a href={museum.url} target="museum">{museum.url} <LucideExternalLink /></a>
27+
<h1>
28+
{museum.name}
29+
</h1>
30+
31+
<section class="description">
32+
{#if museum.description}
33+
<p>
34+
{museum.description}
35+
</p>
4036
{/if}
41-
</hgroup>
42-
</header>
4337

44-
<section>
45-
<h2>Location</h2>
46-
{@render address(museum.location)}
47-
{#if museum.location.geo}
48-
{@const geo = museum.location.geo}
49-
{@const lngLat = [geo.lon, geo.lat]}
50-
<MapLibre center={lngLat} zoom={7} class="map" standardControls style={config.mapStyle}>
51-
<DefaultMarker {lngLat}>
52-
<Popup offset={[0, -10]}>
53-
<div class="popup">
54-
<h3>{museum.name}</h3>
55-
{@render address(museum.location)}
56-
</div>
57-
</Popup>
58-
</DefaultMarker>
59-
</MapLibre>
60-
{/if}
61-
</section>
38+
<ul class="links">
39+
<li>
40+
<a href={museum.uri} target="museum">
41+
View in current site <LucideExternalLink />
42+
</a>
43+
</li>
44+
{#if museum.url}
45+
<li>
46+
<a href={museum.url} target="museum">{museum.url} <LucideExternalLink /></a>
47+
</li>
48+
{/if}
49+
</ul>
50+
</section>
51+
52+
<section class="location">
53+
<h2>Location</h2>
54+
{@render address(museum.location)}
55+
{#if museum.location.geo}
56+
{@const geo = museum.location.geo}
57+
{@const lngLat = [geo.lon, geo.lat]}
58+
<MapLibre center={lngLat} zoom={7} class="map" standardControls style={config.mapStyle}>
59+
<DefaultMarker {lngLat}>
60+
<Popup offset={[0, -10]}>
61+
<div class="popup">
62+
<h3>{museum.name}</h3>
63+
{@render address(museum.location)}
64+
</div>
65+
</Popup>
66+
</DefaultMarker>
67+
</MapLibre>
68+
{/if}
69+
</section>
70+
</header>
6271

63-
<section>
72+
<section class="inscriptions">
6473
<h2>Inscriptions</h2>
6574
<InscriptionTable {inscriptions} />
6675
</section>
6776
</article>
6877

6978
<style>
70-
header a {
79+
article header {
80+
border-left: var(--border-size-1) solid var(--border-color);
81+
border-right: var(--border-size-1) solid var(--border-color);
82+
height: 100%;
83+
overflow-y: auto;
84+
margin-top: 0;
85+
padding-inline: var(--size-4);
86+
padding-top: 0;
87+
top: 0;
88+
}
89+
90+
header h1,
91+
section.location h2 {
92+
border-bottom: var(--border-size-1) solid var(--border-color);
93+
max-inline-size: none;
94+
padding-block: var(--size-4);
95+
text-align: center;
96+
}
97+
98+
h1 {
99+
font-size: var(--font-size-fluid-1);
100+
}
101+
102+
h2 {
103+
text-align: left !important;
104+
}
105+
106+
p {
107+
max-inline-size: none;
108+
}
109+
110+
ul.links {
111+
list-style: none;
112+
padding-inline-start: 0;
113+
padding-top: var(--size-4);
114+
}
115+
116+
ul.links li {
117+
padding-inline-start: 0;
118+
}
119+
120+
ul.links a {
71121
align-items: center;
72122
display: inline-flex;
123+
font-size: var(--font-size-1);
73124
gap: var(--size-2);
74125
}
126+
127+
address {
128+
padding-block: var(--size-4);
129+
}
130+
131+
section.inscriptions h2 {
132+
padding-block: var(--size-4);
133+
}
75134
</style>

0 commit comments

Comments
 (0)