From 9a5b85f32f23f75b4f5d428f5a8a16fcce43acf8 Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 9 May 2026 14:07:22 +0300 Subject: [PATCH] feat: add coin flip, list picker, uuid/token generators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Coin flip: slider 1–20 coins, heads/tails display with H/T count summary - List picker: textarea input, configurable pick count, unique or with-replacement, Ctrl+Enter shortcut - UUID/Token: UUID v4 via crypto, hex and base64 modes with configurable byte length, up to 20 at once Co-Authored-By: Claude Sonnet 4.6 --- src/components/GeneratorCard.astro | 3 + src/components/generators/CoinGenerator.astro | 136 +++++++++++++ src/components/generators/ListGenerator.astro | 174 ++++++++++++++++ src/components/generators/UuidGenerator.astro | 185 ++++++++++++++++++ src/data/generators.ts | 21 ++ src/pages/generators/coin.astro | 40 ++++ src/pages/generators/list.astro | 40 ++++ src/pages/generators/uuid.astro | 40 ++++ 8 files changed, 639 insertions(+) create mode 100644 src/components/generators/CoinGenerator.astro create mode 100644 src/components/generators/ListGenerator.astro create mode 100644 src/components/generators/UuidGenerator.astro create mode 100644 src/pages/generators/coin.astro create mode 100644 src/pages/generators/list.astro create mode 100644 src/pages/generators/uuid.astro diff --git a/src/components/GeneratorCard.astro b/src/components/GeneratorCard.astro index c2a8823..b301bdb 100644 --- a/src/components/GeneratorCard.astro +++ b/src/components/GeneratorCard.astro @@ -17,6 +17,9 @@ const icons: Record = { ticket: ``, 'dice-6': ``, 'square-stack': ``, + 'circle-dollar-sign': ``, + 'list': ``, + 'fingerprint': ``, }; --- diff --git a/src/components/generators/CoinGenerator.astro b/src/components/generators/CoinGenerator.astro new file mode 100644 index 0000000..1e43b88 --- /dev/null +++ b/src/components/generators/CoinGenerator.astro @@ -0,0 +1,136 @@ +--- +// Interactive coin flip generator — runs on the client via inline script +--- + +
+
+
+ + 1 +
+ +
+ 120 +
+
+ +
+
+ + + + +
+ +
+ +
+
+ + diff --git a/src/components/generators/ListGenerator.astro b/src/components/generators/ListGenerator.astro new file mode 100644 index 0000000..c3faec1 --- /dev/null +++ b/src/components/generators/ListGenerator.astro @@ -0,0 +1,174 @@ +--- +// Interactive list picker — runs on the client via inline script +--- + +
+
+
+ + +
+ +
+
+ + +
+ +
+
+ + + +
+
+ + +
+ +
+ +
+
+ + diff --git a/src/components/generators/UuidGenerator.astro b/src/components/generators/UuidGenerator.astro new file mode 100644 index 0000000..945f5d4 --- /dev/null +++ b/src/components/generators/UuidGenerator.astro @@ -0,0 +1,185 @@ +--- +// Interactive UUID / token generator — runs on the client via inline script +--- + +
+
+
+ +
+ {[ + { value: 'uuid', label: 'UUID v4' }, + { value: 'hex', label: 'Hex' }, + { value: 'base64', label: 'Base64' }, + ].map(({ value, label }) => ( + + ))} +
+
+ +
+ +
+ + +
+
+
+ +
+
+ + +
+ +
+ +
+
+ + diff --git a/src/data/generators.ts b/src/data/generators.ts index 1a9c824..257eda7 100644 --- a/src/data/generators.ts +++ b/src/data/generators.ts @@ -49,4 +49,25 @@ export const generators: Generator[] = [ icon: 'square-stack', status: 'live', }, + { + slug: 'coin', + title: 'Coin Flip', + description: 'Flip one or more coins and see heads or tails.', + icon: 'circle-dollar-sign', + status: 'live', + }, + { + slug: 'list', + title: 'List Picker', + description: 'Paste a list of items and pick random winners.', + icon: 'list', + status: 'live', + }, + { + slug: 'uuid', + title: 'UUID / Token', + description: 'Generate UUIDs, hex tokens, or random base64 strings.', + icon: 'fingerprint', + status: 'live', + }, ]; diff --git a/src/pages/generators/coin.astro b/src/pages/generators/coin.astro new file mode 100644 index 0000000..f60389d --- /dev/null +++ b/src/pages/generators/coin.astro @@ -0,0 +1,40 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import CoinGenerator from '../../components/generators/CoinGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'coin')!; +--- + + +
+ +
+
+ + randify +
+

{generator.title}

+

{generator.description}

+
+
+
+ +
+
+
diff --git a/src/pages/generators/list.astro b/src/pages/generators/list.astro new file mode 100644 index 0000000..7804085 --- /dev/null +++ b/src/pages/generators/list.astro @@ -0,0 +1,40 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import ListGenerator from '../../components/generators/ListGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'list')!; +--- + + +
+ +
+
+ + randify +
+

{generator.title}

+

{generator.description}

+
+
+
+ +
+
+
diff --git a/src/pages/generators/uuid.astro b/src/pages/generators/uuid.astro new file mode 100644 index 0000000..49a8e87 --- /dev/null +++ b/src/pages/generators/uuid.astro @@ -0,0 +1,40 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import UuidGenerator from '../../components/generators/UuidGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'uuid')!; +--- + + +
+ +
+
+ + randify +
+

{generator.title}

+

{generator.description}

+
+
+
+ +
+
+