Skip to content

Commit

Permalink
Switch from cards to list on website
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Feb 4, 2024
1 parent 0b1a967 commit 9f870c7
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions website/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,34 @@
<Icon class="material-icons" slot="leadingIcon">search</Icon>
</TextField>
</div>
<LayoutGrid>
{#each exercises as exercise}
<Cell>
<Card
>
<div style="padding: 1rem;">
<h2 class="mdc-typography--headline6" style="margin: 0; font-size: 1.3em; display: inline-block;">
{exercise.name}
</h2>
<Set chips={exercise.concepts} let:chip nonInteractive>
<Chip {chip}>
<ChipText>{chip}</ChipText>
</Chip>
</Set>
<h4 class="mdc-typography--subtitle2" style="margin: 0; color: #888">
{exercise.description}
</h4>
</div>
<Actions>
<ActionButtons>
<Button on:click={() => downloadExercise(exercise)} color='secondary'>
<Label>Download</Label>
</Button>
<Button on:click={() => openInNetsBlox(exercise)} color='secondary'>
<Label>Open in NetsBlox</Label>
</Button>
</ActionButtons>
</Actions>
</Card>
</Cell>
{/each}
</LayoutGrid>
<List
twoLine
singleSelection
>
{#each exercises as exercise}
<Item>
<Text>
<PrimaryText>{exercise.name}</PrimaryText>
<SecondaryText>{exercise.description}</SecondaryText>
</Text>
<Meta>
<Set chips={exercise.concepts} let:chip nonInteractive>
<Chip {chip}>
<ChipText>{chip}</ChipText>
</Chip>
</Set>
<IconButton
title="Download"
on:click={() => downloadExercise(exercise)}
class="material-icons">download</IconButton>
<IconButton
title="Open in NetsBlox"
on:click={() => openInNetsBlox(exercise)}
class="material-icons">open_in_new</IconButton>
</Meta>
</Item>
{/each}
</List>
</div>

<script lang="ts">
Expand All @@ -51,6 +47,15 @@
import Icon from '@smui/textfield/icon';
import Chip, {Set, Text as ChipText} from '@smui/chips';
import {onMount} from 'svelte';
import IconButton from '@smui/icon-button';
import List, {
Item,
Graphic,
Meta,
Text,
PrimaryText,
SecondaryText,
} from '@smui/list';
import allExercises from '../exercises.json';
let searchQuery: string = '';
Expand Down

0 comments on commit 9f870c7

Please sign in to comment.