Skip to content

Commit 0bc4475

Browse files
committed
sup
1 parent fc35985 commit 0bc4475

6 files changed

Lines changed: 186 additions & 77 deletions

File tree

src/parts/loves/block.game.svelte

Lines changed: 106 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,36 @@ import { anim } from "#scripts/anim.svelte.ts";
66
import { display_date } from "#scripts/utils";
77
import { type GameData } from "#sup/loves/games/games";
88
9+
import { onMount } from "svelte";
10+
import { slide } from "svelte/transition";
11+
import { expoInOut } from "svelte/easing";
12+
913
1014
interface Props {
1115
game: GameData;
16+
invert?: boolean
1217
}
1318
14-
let { game }: Props = $props();
19+
let { game, invert = false }: Props = $props();
20+
21+
22+
let open = $state(false);
23+
24+
onMount(() => {
25+
requestAnimationFrame(() => {
26+
if (invert) {
27+
open = !open;
28+
}
29+
});
30+
});
1531
1632
</script>
1733

1834

1935
<button class="block-game {game.state} {game._style}"
36+
class:open
2037
id={game.shard}
38+
onclick={() => { open = !open; }}
2139
{@attach anim}
2240
>
2341
<div class="content">
@@ -42,27 +60,39 @@ let { game }: Props = $props();
4260
{/if}
4361
</div>
4462

45-
<div class="inner">
46-
{#if game.date}
47-
<p class="date">
48-
{display_date(game.date)}
49-
</p>
50-
51-
<span class="separator"> × </span>
52-
{/if}
53-
54-
<p class="state {game.state}">
55-
{game.state.toUpperCase()}
56-
</p>
57-
</div>
63+
<div class="sep"></div>
5864

59-
<div class="lower">
60-
<ul class="genres">
61-
{#each game.genres ?? [] as genre}
62-
<li> {genre} </li>
65+
{#if open}
66+
<div class="lower desc" transition:slide={{ duration: 800, easing: expoInOut }}>
67+
{#each game.desc as block}
68+
<p> {@html block} </p>
6369
{/each}
64-
</ul>
65-
</div>
70+
</div>
71+
72+
{:else}
73+
<div class="lower" transition:slide={{ duration: 800, easing: expoInOut }}>
74+
<div class="inner">
75+
{#if game.date}
76+
<p class="date">
77+
{display_date(game.date)}
78+
</p>
79+
80+
<span class="separator"> × </span>
81+
{/if}
82+
83+
<p class="state {game.state}">
84+
{game.state.toUpperCase()}
85+
</p>
86+
</div>
87+
88+
<ul class="genres">
89+
{#each game.genres ?? [] as genre}
90+
<li> {genre} </li>
91+
{/each}
92+
</ul>
93+
</div>
94+
95+
{/if}
6696
</div>
6797

6898
</div>
@@ -78,21 +108,27 @@ let { game }: Props = $props();
78108
flex-grow: 1;
79109
max-width: 32rem;
80110
padding: 1rem 1.5rem;
111+
font-size: unset;
81112
background: none;
82113
border: none;
114+
outline: none;
83115
transition: #{trans()};
84116
@include shear-card($interactive: true);
85117
@include anim-block;
86118
87-
&:hover {
88-
cursor: auto;
119+
&:hover, &:focus-visible {
120+
cursor: pointer;
89121
opacity: 1 !important;
90122
91123
.inner p {
92124
color: $col-text;
93125
}
94126
}
95127
128+
&.open {
129+
max-width: 40rem;
130+
}
131+
96132
&.wishlist::before {
97133
border: 1px solid rgb(white, 42%);
98134
}
@@ -117,6 +153,10 @@ let { game }: Props = $props();
117153
transform: none;
118154
opacity: 1;
119155
}
156+
157+
.block-game.open & {
158+
padding: 0 1rem;
159+
}
120160
}
121161
122162
@@ -142,7 +182,6 @@ let { game }: Props = $props();
142182
flex-flow: column nowrap;
143183
justify-content: space-between;
144184
align-items: start;
145-
gap: 0.5rem;
146185
}
147186
148187
@@ -155,7 +194,7 @@ let { game }: Props = $props();
155194
156195
h3 {
157196
@include font-ui;
158-
font-size: 200%;
197+
font-size: 150%;
159198
font-weight: normal;
160199
color: $col-text;
161200
text-align: start;
@@ -167,32 +206,61 @@ let { game }: Props = $props();
167206
168207
p.love {
169208
min-width: max-content;
170-
font-size: 150%;
209+
font-size: 125%;
171210
}
172211
}
173212
174-
.inner {
175-
flex-grow: 1;
176-
width: 100%;
177-
display: flex;
178-
flex-flow: row wrap;
179-
gap: 0.5rem;
180-
@include separator;
181213
214+
.sep {
215+
width: 69%;
216+
height: 1px;
217+
margin: 0.25rem 0 0.75rem;
218+
background: rgb(white, 10%);
219+
}
220+
221+
222+
.lower.desc {
182223
p {
183-
@include font-tech;
184-
font-size: 100%;
224+
padding-left: 0.2em;
225+
margin-bottom: 0.5em;
226+
@include font-ui;
227+
font-size: 75%;
228+
font-weight: 300;
185229
color: $col-text-deut;
230+
text-align: left;
186231
transition: #{trans()};
187232
188-
&.wishlist { color: #f190f1 !important; }
189-
&.active { color: #40f190 !important; }
190-
&.opportunistic { color: #c7c7ff !important; }
233+
.block-game:where(:hover, :focus-visible) & {
234+
color: $col-text;
235+
}
191236
}
192237
}
193238
194239
.lower {
240+
.inner {
241+
flex-grow: 1;
242+
width: 100%;
243+
margin-bottom: 0.5em;
244+
display: flex;
245+
flex-flow: row wrap;
246+
gap: 0.5rem;
247+
font-size: 75%;
248+
@include separator;
249+
250+
p {
251+
margin: 0;
252+
@include font-tech;
253+
color: $col-text-deut;
254+
transition: #{trans()};
255+
256+
&.wishlist { color: #f190f1 !important; }
257+
&.active { color: #40f190 !important; }
258+
&.opportunistic { color: #c7c7ff !important; }
259+
}
260+
}
261+
195262
ul.genres {
263+
padding: 0 0.2rem;
196264
display: flex;
197265
flex-flow: row wrap;
198266
justify-content: start;
@@ -202,7 +270,7 @@ let { game }: Props = $props();
202270
li {
203271
padding: 0 0.5em;
204272
@include font-fun;
205-
font-size: 150%;
273+
font-size: 120%;
206274
color: $col-text;
207275
@include shear-card();
208276
transition: #{trans()};

src/parts/music/block.track.listen.svelte

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ let { track, invert = false }: Props = $props();
2525
2626
let open = $state(false);
2727
28-
let self: HTMLElement;
29-
3028
onMount(() => {
3129
requestAnimationFrame(() => {
3230
if (invert) {
@@ -42,7 +40,6 @@ onMount(() => {
4240
class:shrink={track.name.length > 20}
4341
class:open
4442
id={track.shard}
45-
bind:this={self}
4643
onclick={() => { open = !open; }}
4744
{@attach anim}
4845
>
@@ -81,15 +78,11 @@ onMount(() => {
8178

8279
<div class="sep"></div>
8380

84-
{#if open && track.desc}
81+
{#if open}
8582
<div class="lower" transition:slide={{ duration: 800, easing: expoInOut }}>
86-
{#if Array.isArray(track.desc)}
87-
{#each track.desc as block}
88-
<p> {@html block} </p>
89-
{/each}
90-
{:else}
91-
<p> {@html track.desc} </p>
92-
{/if}
83+
{#each track.desc as block}
84+
<p> {@html block} </p>
85+
{/each}
9386
</div>
9487

9588
{:else}
@@ -127,9 +120,9 @@ onMount(() => {
127120
max-width: 60rem;
128121
padding: 1rem 1.5rem 1rem 3rem;
129122
font-size: unset;
130-
background: unset;
131-
border: unset;
132-
outline: unset;
123+
background: none;
124+
border: none;
125+
outline: none;
133126
transition: #{trans()};
134127
@include shear-card($interactive: true, $glow: true);
135128
@include anim-block;
@@ -144,10 +137,6 @@ onMount(() => {
144137
100% { filter: brightness(100%); }
145138
}
146139
}
147-
148-
&:hover .lower p {
149-
color: $col-text;
150-
}
151140
}
152141
153142
.content {
@@ -182,6 +171,7 @@ img {
182171
align-items: start;
183172
}
184173
174+
185175
.upper {
186176
width: 100%;
187177
@@ -228,13 +218,15 @@ img {
228218
}
229219
}
230220
221+
231222
.sep {
232223
width: 69%;
233224
height: 1px;
234225
margin: 0.5rem 0 1rem;
235226
background: rgb(white, 10%);
236227
}
237228
229+
238230
.lower {
239231
p {
240232
margin-bottom: 0.5em;
@@ -244,6 +236,10 @@ img {
244236
color: $col-text-deut;
245237
text-align: left;
246238
transition: #{trans()};
239+
240+
.block-track-listen:where(:hover, :focus-visible) & {
241+
color: $col-text;
242+
}
247243
}
248244
249245
p.discovered {

src/routes/(sup)/sup/loves/+page.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import Adventure from "#parts/special/adventure.svelte";
5858
"icons/games/manifold-garden.png",
5959
"icons/games/master-duel.webp",
6060
"icons/games/phigros.webp",
61+
"icons/games/outer-wilds.jpg",
6162
]}
6263
aspect="square"
6364
/>
@@ -129,10 +130,13 @@ import Adventure from "#parts/special/adventure.svelte";
129130
capt="best of the internet"
130131
picts={[
131132
"icons/youtube/3b1b.jpg",
133+
"icons/youtube/grian.jpg",
132134
"icons/youtube/in-the-mix.jpg",
133135
"icons/youtube/kevin-fang.jpg",
134136
"icons/youtube/kevinu.jpg",
137+
"icons/youtube/no-boilerplate.jpg",
135138
]}
139+
aspect="square"
136140
/>
137141

138142
<LinkCard

0 commit comments

Comments
 (0)