mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-17 16:38:31 +00:00
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
---
|
|
import { getMyPatterns } from './list.json';
|
|
|
|
import { Content } from '../../../../my-patterns/README.md';
|
|
import HeadCommon from '../../components/HeadCommon.astro';
|
|
|
|
const myPatterns = await getMyPatterns();
|
|
|
|
const { BASE_URL } = import.meta.env;
|
|
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
|
---
|
|
|
|
<head>
|
|
<HeadCommon />
|
|
</head>
|
|
<body class="bg-slate-800">
|
|
{
|
|
Object.keys(myPatterns).length === 0 && (
|
|
<div class="prose prose-invert p-2">
|
|
<Content />
|
|
</div>
|
|
)
|
|
}
|
|
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2 p-2 select-none">
|
|
{
|
|
Object.entries(myPatterns).map(([name, tune]) => (
|
|
<a
|
|
class="rounded-md bg-slate-900 hover:bg-slate-700 cursor-pointer relative"
|
|
href={`${baseNoTrailing}/#${btoa(tune as string)}`}
|
|
>
|
|
<div class="absolute w-full h-full flex justify-center items-center">
|
|
<span class="bg-slate-800 p-2 rounded-md text-white">{name}</span>
|
|
</div>
|
|
<img src={`${baseNoTrailing}/swatch/${name}.png/`} />
|
|
</a>
|
|
))
|
|
}
|
|
</div>
|
|
</body>
|