Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
andyluss committed Jan 3, 2025
1 parent b48a6ae commit b39b845
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/cards/HomeCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface Props {
height: string;
}
const { width = "100px", height = "100px" } = Astro.props;
const { width = "128px", height = "128px" } = Astro.props;
---

<div class="card">
Expand Down
33 changes: 13 additions & 20 deletions src/cards/LevelCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
import type { Collection, Level, LevelItem, Tag } from "../utils/content";
interface Props {
level: Level;
levels: LevelItem[];
collection: Collection;
tag?: Tag;
width?: string;
height?: string;
level: Level;
levels: LevelItem[];
collection: Collection;
tag?: Tag;
width?: string;
height?: string;
}
const {
level,
levels,
collection,
tag,
width = "256px",
height = "128px",
level,
levels,
collection,
tag,
width = "256px",
height = "128px",
} = Astro.props;
---

<ul class="card list-none p-0 m-0 flex flex-wrap">
<ul class="list-none p-0 m-0 flex flex-wrap" style={{width, height}}>
{
levels.map(([lvl, count]) => (
<li
Expand All @@ -39,10 +39,3 @@ const {
))
}
</ul>

<style define:vars={{ width, height }}>
.card {
width: var(--width);
height: var(--height);
}
</style>
33 changes: 13 additions & 20 deletions src/cards/TagCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
import type { Collection, Level, Tag, TagItem } from "../utils/content";
interface Props {
tag: Tag;
tags: TagItem[];
collection: Collection;
level?: Level;
width?: string;
height?: string;
tag: Tag;
tags: TagItem[];
collection: Collection;
level?: Level;
width?: string;
height?: string;
}
const {
tag,
tags,
collection,
level,
width = "512px",
height = "128px",
tag,
tags,
collection,
level,
width = "512px",
height = "128px",
} = Astro.props;
---

<ul class="card list-none p-0 m-0 flex flex-wrap">
<ul class="card list-none p-0 m-0 flex flex-wrap" style={{width, height}}>
{
tags
.sort((a, b) => b[1] - a[1])
Expand All @@ -41,10 +41,3 @@ const {
))
}
</ul>

<style define:vars={{ width, height }}>
.card {
width: var(--width);
height: var(--height);
}
</style>

0 comments on commit b39b845

Please sign in to comment.