Skip to content

Commit 3098b92

Browse files
committed
improve history styling a bit
1 parent d2e32ea commit 3098b92

2 files changed

Lines changed: 42 additions & 38 deletions

File tree

src/lib/history/HistoricalShow.svelte

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<svelte:element
8888
this={href ? 'a' : 'div'}
8989
class:card={!onlyTimes}
90-
class="inline-block limit p-3 m-2 hidden-link relative"
90+
class="inline-flex flex-col limit p-3 m-2 hidden-link relative"
9191
{href}
9292
id={show.name}
9393
class:highlight={!onlyTimes && page.url.hash === '#' + show.name}
@@ -156,21 +156,26 @@
156156
{/if}
157157
</div>
158158
{/if}
159-
<h3>{showDate.toLocaleDateString(getDateFormatLocale())}</h3>
159+
<h3 class="mb-0!">
160+
{showDate.toLocaleDateString(getDateFormatLocale())}
161+
</h3>
160162
{#if !(withThumbnail && thumbnail) && show.metadata?.isCurrentlyLive}
161163
<div class="inline-block absolute top-3 right-3">
162164
<Live />
163165
</div>
164166
{/if}
165-
{#if show.metadata.title}
166-
<h4>{show.metadata.title}</h4>
167-
{/if}
167+
<div class="grow flex min-h-10 items-center justify-center">
168+
{#if show.metadata.title}
169+
<h4>{show.metadata.title}</h4>
170+
{/if}
171+
</div>
168172
{/if}
169173
<span class="hidden">name date (for debugging purposes): {show.name}</span>
170174
<hr />
171-
<div class="inline-block mr-2">
172-
<h4>Pre Show</h4>
173-
<span class="time">
175+
<div>
176+
<div class="inline-block mr-2">
177+
<h4>Pre Show</h4>
178+
<span class="time">
174179
{#if preShowStart}
175180
{preShowStart.toLocaleTimeString(undefined, {
176181
timeStyle: 'short',
@@ -180,8 +185,8 @@
180185
<span class="opacity-50"> N/A </span>
181186
{/if}
182187
</span>
183-
-
184-
<span class="time">
188+
-
189+
<span class="time">
185190
{#if mainShowStart}
186191
{mainShowStart.toLocaleTimeString(undefined, {
187192
timeStyle: 'short',
@@ -191,16 +196,16 @@
191196
<span class="opacity-50"> N/A </span>
192197
{/if}
193198
</span>
194-
<br />
195-
{#if preShowLength}
196-
{preShowLength}
197-
{:else}
198-
<span class="opacity-50"> N/A </span>
199-
{/if}
200-
</div>
201-
<div class="inline-block ml-2">
202-
<h4>Main Show</h4>
203-
<span class="time">
199+
<br />
200+
{#if preShowLength}
201+
{preShowLength}
202+
{:else}
203+
<span class="opacity-50"> N/A </span>
204+
{/if}
205+
</div>
206+
<div class="inline-block ml-2">
207+
<h4>Main Show</h4>
208+
<span class="time">
204209
{#if mainShowStart}
205210
{mainShowStart.toLocaleTimeString(undefined, {
206211
timeStyle: 'short',
@@ -210,20 +215,21 @@
210215
<span class="opacity-50"> N/A </span>
211216
{/if}
212217
</span>
213-
-
214-
<span class="time">
218+
-
219+
<span class="time">
215220
{#if showEnd}
216221
{showEnd.toLocaleTimeString(undefined, { timeStyle: 'short', hour12: getTimePreference() })}
217222
{:else}
218223
<span class="opacity-50"> N/A </span>
219224
{/if}
220225
</span>
221-
<br />
222-
{#if mainShowLength}
223-
{mainShowLength}
224-
{:else}
225-
<span class="opacity-50"> N/A </span>
226-
{/if}
226+
<br />
227+
{#if mainShowLength}
228+
{mainShowLength}
229+
{:else}
230+
<span class="opacity-50"> N/A </span>
231+
{/if}
232+
</div>
227233
</div>
228234
<hr />
229235
{#if onTime && onTimeDistance}
@@ -246,6 +252,7 @@
246252
</svelte:element>
247253

248254
<style>
255+
@reference "#app.css";
249256
.thumbnail-space {
250257
width: min(28.5rem, 95vw);
251258
aspect-ratio: 16 / 9;
@@ -254,9 +261,9 @@
254261
255262
img,
256263
.fake-img {
264+
@apply rounded-base;
257265
width: min(28.5em, 95vw);
258266
object-fit: cover;
259-
border-radius: var(--theme-rounded-base);
260267
aspect-ratio: 16 / 9;
261268
}
262269

src/routes/history/+page.svelte

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
let pageIndex = 0;
33
</script>
44
<script lang="ts">
5-
import { run } from 'svelte/legacy';
6-
75
import HistoricalShow from "$lib/history/HistoricalShow.svelte";
86
import { browser, dev } from "$app/environment";
97
import HistoryRecords from "$lib/history/HistoryRecords.svelte";
@@ -32,7 +30,7 @@
3230
let view = $state((data.history.viewType ?? 0)+"");
3331
3432
let first = $state(true);
35-
run(() => {
33+
$effect(() => {
3634
if(first) {
3735
first = false;
3836
} else if(browser) {
@@ -76,15 +74,15 @@
7674

7775
<br>
7876

79-
<a href="/search" class="btn preset-tonal-primary border border-primary-500">
77+
<a href="/search" class="btn preset-tonal-primary border border-primary-500 text-white rounded-2xl">
8078
<Search/>
8179

8280
Search for Shows
8381
</a><br>
8482

8583
<br>
86-
<div class="flex flex-col items-center gap-4">
87-
<SegmentedControl value={view} onValueChange={(details) => (view = details.value)} name="justify">
84+
<div class="flex flex-col items-center gap-4 mb-2">
85+
<SegmentedControl value={view} onValueChange={(details) => (view = details.value ?? "0")} name="justify">
8886
<SegmentedControl.Control>
8987
<SegmentedControl.Indicator />
9088
<SegmentedControl.Item value="0">
@@ -114,9 +112,8 @@
114112
</SegmentedControl.Control>
115113
</SegmentedControl>
116114
</div>
117-
<br>
118115

119-
<div class="inline-block"
116+
<div class="inline-flex flex-wrap justify-center"
120117
class:thumbnail-inline={view === "0"}
121118
class:thumbnail-list={view === "1"}
122119
class:old-layout={view === "2"}
@@ -140,7 +137,7 @@
140137

141138
<LazyLoad>
142139
{#each countTo(20) as i}
143-
<LoadingHistoricalShow withThumbnail={view < 2}/>
140+
<LoadingHistoricalShow withThumbnail={Number(view) < 2}/>
144141
{/each}
145142
</LazyLoad>
146143

0 commit comments

Comments
 (0)