mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Testing see more see less.
This commit is contained in:
parent
462b0b5310
commit
d21729e3a2
2 changed files with 10 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ export type GameType = {
|
|||
max_playtime: number;
|
||||
min_age: number;
|
||||
description: string;
|
||||
description_preview: string;
|
||||
players: string;
|
||||
playtime: string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<script lang="ts">
|
||||
import type { GameType } from '$lib/types';
|
||||
import { Checkbox, NumberInput } from 'carbon-components-svelte';
|
||||
import type { boolean } from 'zod';
|
||||
// import { enhance } from "$lib/form";
|
||||
|
||||
export let game: GameType;
|
||||
let seeMore: boolean = false;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
@ -19,7 +21,13 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="description">
|
||||
{@html game?.description}
|
||||
{#if seeMore}
|
||||
{@html game?.description}
|
||||
<button on:click={() => (seeMore = !seeMore)}>See Less -</button>
|
||||
{:else}
|
||||
{@html game?.description_preview}
|
||||
<button on:click={() => (seeMore = !seeMore)}>See More +</button>
|
||||
{/if}
|
||||
<div>
|
||||
<p>Price: {game?.price}</p>
|
||||
<p>Year Published: {game?.year_published}</p>
|
||||
|
|
|
|||
Loading…
Reference in a new issue