@@ -6,18 +6,36 @@ import { anim } from "#scripts/anim.svelte.ts";
66import { display_date } from " #scripts/utils" ;
77import { 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
1014interface 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 ()} ;
0 commit comments