From 09f593a06235e2541387191d2c70e9935f7956c2 Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 9 May 2026 13:40:58 +0300 Subject: [PATCH 1/3] feat: add lottery generator Adds /generators/lottery/ with configurable range and pick count. Partial Fisher-Yates shuffle guarantees unique draws, results sorted ascending and displayed as numbered balls with clipboard copy. Co-Authored-By: Claude Sonnet 4.6 --- .../generators/LotteryGenerator.astro | 179 ++++++++++++++++++ src/data/generators.ts | 2 +- src/pages/generators/lottery.astro | 63 ++++++ 3 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 src/components/generators/LotteryGenerator.astro create mode 100644 src/pages/generators/lottery.astro diff --git a/src/components/generators/LotteryGenerator.astro b/src/components/generators/LotteryGenerator.astro new file mode 100644 index 0000000..a055a9a --- /dev/null +++ b/src/components/generators/LotteryGenerator.astro @@ -0,0 +1,179 @@ +--- +// Interactive lottery generator — runs on the client via inline script +--- + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+ +
+ +
+
+ + diff --git a/src/data/generators.ts b/src/data/generators.ts index 7579d87..012f729 100644 --- a/src/data/generators.ts +++ b/src/data/generators.ts @@ -33,7 +33,7 @@ export const generators: Generator[] = [ title: 'Lottery', description: 'Draw a set of unique numbers for lottery-style picks.', icon: 'ticket', - status: 'coming-soon', + status: 'live', }, { slug: 'dice', diff --git a/src/pages/generators/lottery.astro b/src/pages/generators/lottery.astro new file mode 100644 index 0000000..a27974f --- /dev/null +++ b/src/pages/generators/lottery.astro @@ -0,0 +1,63 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import LotteryGenerator from '../../components/generators/LotteryGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'lottery')!; +--- + + +
+ + +
+
+ + randify +
+

+ {generator.title} Generator +

+

{generator.description}

+
+ +
+ +
+ +
+ + + +
+
+
From 01ddfc8428a3bd1090678c6b4e499c83158ee597 Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 9 May 2026 13:42:16 +0300 Subject: [PATCH 2/3] feat: add dice generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds /generators/dice/ with configurable count (1–20) and standard RPG sides (d4/d6/d8/d10/d12/d20/d100). Shows individual rolls with colour-coded min/max, running total, and clipboard copy in NdS=total format. Co-Authored-By: Claude Sonnet 4.6 --- src/components/generators/DiceGenerator.astro | 170 ++++++++++++++++++ src/data/generators.ts | 2 +- src/pages/generators/dice.astro | 63 +++++++ 3 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 src/components/generators/DiceGenerator.astro create mode 100644 src/pages/generators/dice.astro diff --git a/src/components/generators/DiceGenerator.astro b/src/components/generators/DiceGenerator.astro new file mode 100644 index 0000000..42543dd --- /dev/null +++ b/src/components/generators/DiceGenerator.astro @@ -0,0 +1,170 @@ +--- +// Interactive dice generator — runs on the client via inline script +--- + +
+
+
+ + +
+
+ +
+ {['4','6','8','10','12','20','100'].map((s) => ( + + ))} +
+
+
+ + + +
+
+ + + + +
+ +
+ +
+
+ + diff --git a/src/data/generators.ts b/src/data/generators.ts index 012f729..ba12ae7 100644 --- a/src/data/generators.ts +++ b/src/data/generators.ts @@ -40,7 +40,7 @@ export const generators: Generator[] = [ title: 'Dice', description: 'Roll one or more dice with any number of sides.', icon: 'dice-6', - status: 'coming-soon', + status: 'live', }, { slug: 'cards', diff --git a/src/pages/generators/dice.astro b/src/pages/generators/dice.astro new file mode 100644 index 0000000..0c505d3 --- /dev/null +++ b/src/pages/generators/dice.astro @@ -0,0 +1,63 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import DiceGenerator from '../../components/generators/DiceGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'dice')!; +--- + + +
+ + +
+
+ + randify +
+

+ {generator.title} Generator +

+

{generator.description}

+
+ +
+ +
+ +
+ + + +
+
+
From d3434bc9287564b34b88ea95acabf2087279e2e3 Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 9 May 2026 13:47:10 +0300 Subject: [PATCH 3/3] feat: add card generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds /generators/cards/ — draws 1–52 cards from a standard 52-card deck. Supports unique draws (Fisher-Yates) and with-replacement mode. Cards rendered as mini playing-card tiles with red suits coloured. Clipboard copy in rank+suit format (e.g. A♠, K♥). Co-Authored-By: Claude Sonnet 4.6 --- src/components/generators/CardGenerator.astro | 187 ++++++++++++++++++ src/data/generators.ts | 2 +- src/pages/generators/cards.astro | 63 ++++++ 3 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 src/components/generators/CardGenerator.astro create mode 100644 src/pages/generators/cards.astro diff --git a/src/components/generators/CardGenerator.astro b/src/components/generators/CardGenerator.astro new file mode 100644 index 0000000..3217ba8 --- /dev/null +++ b/src/components/generators/CardGenerator.astro @@ -0,0 +1,187 @@ +--- +// Interactive card generator — runs on the client via inline script +--- + +
+
+
+ + +
+ +
+ + + +
+
+ + +
+ +
+ +
+
+ + diff --git a/src/data/generators.ts b/src/data/generators.ts index ba12ae7..1a9c824 100644 --- a/src/data/generators.ts +++ b/src/data/generators.ts @@ -47,6 +47,6 @@ export const generators: Generator[] = [ title: 'Card', description: 'Draw a random playing card from a standard deck.', icon: 'square-stack', - status: 'coming-soon', + status: 'live', }, ]; diff --git a/src/pages/generators/cards.astro b/src/pages/generators/cards.astro new file mode 100644 index 0000000..f606a11 --- /dev/null +++ b/src/pages/generators/cards.astro @@ -0,0 +1,63 @@ +--- +import BaseLayout from '../../layouts/BaseLayout.astro'; +import CardGenerator from '../../components/generators/CardGenerator.astro'; +import AdBanner from '../../components/AdBanner.astro'; +import { generators } from '../../data/generators'; + +const generator = generators.find((g) => g.slug === 'cards')!; +--- + + +
+ + +
+
+ + randify +
+

+ {generator.title} Generator +

+

{generator.description}

+
+ +
+ +
+ +
+ + + +
+
+