Commit Graph
39 Commits
Author SHA1 Message Date
emil bb62d7310e test: add Vitest + 30 dice-engine tests
- Install vitest and @vitest/coverage-v8
- Add test scripts to package.json
- Create vitest.config.ts
- Add 30 comprehensive tests for parseDiceNotation, rollDice,
  rollAdvantage, buildNotation, isAdvancedNotation
- Fix isAdvancedNotation regex to detect ro (reroll once)
2026-05-10 21:12:08 +03:00
emil 3750cd2cc6 feat: add PWA support with offline caching
- Generate 192x192, 512x512 and Apple touch icons from favicon.svg
- Add web app manifest (manifest.json)
- Add service worker with network-first for HTML, cache-first for assets
- Register SW in BaseLayout
- Add theme-color meta and apple-touch-icon link
2026-05-10 21:06:19 +03:00
emil 56ab3f6952 refactor: extract shared client utilities
- Add src/lib/client/clipboard.ts with CopyFeedback class
- Add src/lib/client/validation.ts with createErrorDisplay and isInteger
- Add src/lib/client/animations.ts with popElement
- Refactor NumberGenerator, LotteryGenerator, PasswordGenerator,
  ListGenerator, CardGenerator, CoinGenerator, UuidGenerator,
  WheelSpinner to use shared utilities
- Leave DiceGenerator and ColorGenerator untouched (complex patterns)
2026-05-10 20:56:33 +03:00
emil f1ba82735b refactor: i18n routing, shared GeneratorLayout, analytics component, content collections
- Add Astro native i18n routing (prefixDefaultLocale: false)
- Introduce GeneratorLayout to deduplicate all generator pages
- Enrich generator data with pageTitle, ruPageTitle, howTo/whenTo arrays
- Make EN and RU generator pages identical using @/ path aliases
- Extract analytics (Yandex Metrika + Top.Mail.Ru) into Analytics.astro
- Move tracker IDs to src/data/config.ts, inject via define:vars
- Migrate generator metadata to Content Collections (src/content/generators/*.json)
- Add Zod schema with .strict() validation in src/lib/generator-schema.ts
- Update CLAUDE.md with new conventions
2026-05-10 20:42:05 +03:00
emil 195c2deb54 Merge branch 'main' of github.com:emil28092005/Randify.pro 2026-05-10 18:10:10 +03:00
emil 8f562d4319 feat: add VK (Top.Mail.Ru) pixel tracking 2026-05-10 18:09:35 +03:00
Emil Shanaty ef2aeb5345 feat(dice): full notation engine with kh/kl/dh/dl, exploding dice, reroll, presets, roll history, adv/disadv toggle
- Inline dice engine: XdY±Z, keep/drop (4d6dl1), exploding (3d6!), penetrating (!p), reroll (r1, ro1, r<3)
- Notation input with real-time validation and bidirectional sync with controls
- Advantage/Disadvantage toggle with smart disable when count>1 or keep/drop present
- 6 presets: Attack, Damage, Fireball, Sneak Attack, Stat Roll (4d6dl1), Savage Strike (2d6!)
- Roll history with dropped strikethrough, explosion chains, reroll arrows
- Updated SEO title/description and When-to-use blocks (EN+RU)
2026-05-10 01:23:50 +03:00
emilandClaude Sonnet 4.6 2168b88407 Reorder generators: dice 2nd, wheel 3rd (priority trio)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:19:54 +03:00
emilandClaude Sonnet 4.6 7c5f67eab8 Upgrade Dice Generator: notation input, advantage/disadvantage, history, D&D presets
Adds XdY+Z notation parsing with bidirectional sync, 3-way advantage/disadvantage
toggle, last-10 roll history in sessionStorage, and D&D quick presets (Attack,
Damage, Fireball, Sneak Attack, Stat Roll). Updates SEO meta and SeoBlock content
in both EN and RU pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:18:16 +03:00
emilandClaude Sonnet 4.6 b3069f5374 Update CLAUDE.md to reflect current bilingual architecture
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:00:13 +03:00
emilandClaude Sonnet 4.6 be6a0d712f Fix Russian generator pages: use individual pages instead of dynamic route
The dynamic [slug].astro imported all 10 generator components, causing Astro
to bundle all their scripts into every Russian page. Scripts then crashed
trying to find DOM elements that don't exist on the page.

Each Russian generator page now imports only its own component, matching
the English page structure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:57:11 +03:00
emilandClaude Sonnet 4.6 65e42e7d44 Add Russian language version of the site
- New i18n system: src/i18n/translations.ts with en/ru translation objects
- LanguageSwitcher component (fixed top-right EN/RU toggle)
- BaseLayout updated with lang prop, hreflang links, auto-redirect for Russian browsers
- All 10 generator components updated to use T.* translations
- GeneratorCard updated to show ruTitle/ruDescription and link to /ru/ routes
- SeoBlock updated with translated section headers
- New /ru/ home page and /ru/generators/[slug] dynamic route (all 10 generators)
- Russian SEO content (howTo/whenTo) for all generator pages
- English pages explicitly pass lang="en"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:49:57 +03:00
emilandClaude Sonnet 4.6 76d9233faa feat: remove Update wheel button, wheel updates automatically on input
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:10:20 +03:00
emilandClaude Sonnet 4.6 6e540fdb12 feat: wheel auto-updates on textarea input with 300ms debounce
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:08:41 +03:00
emilandClaude Sonnet 4.6 e72312f23f fix: confetti uses position:fixed to prevent page layout expansion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:06:37 +03:00
emilandClaude Sonnet 4.6 3863eb214e feat: add Spin the Wheel generator
Canvas-based wheel with 8-color palette, ease-out cubic spin animation,
deterministic winner calculation, confetti burst on result, copy to clipboard.
Supports 2–24 custom items with live textarea update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 16:03:30 +03:00
emilandClaude Sonnet 4.6 f0ed8304b6 feat: add Yandex Metrika counter to all pages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 15:30:52 +03:00
emilandClaude Sonnet 4.6 2ba1b53ba8 feat: randomise ad banner between Yandex app and Yandex Browser offers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 15:10:51 +03:00
emilandClaude Sonnet 4.6 70eac59eb8 fix: move SEO text blocks below ad banner on generator pages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 15:04:44 +03:00
emilandClaude Sonnet 4.6 57f1a8d705 seo: add How to use / When to use text blocks to all generator pages
Each page now has a subtle text section with keyword-rich content
for search engine indexing, without disrupting the tool UX.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 15:03:28 +03:00
emilandClaude Sonnet 4.6 80a39035d3 seo: add sitemap, robots.txt and optimised page titles/descriptions
- @astrojs/sitemap generates sitemap-index.xml at build time
- robots.txt points crawlers to the sitemap
- generators.ts extended with seoTitle and seoDescription per generator
- All generator pages now use seoTitle/seoDescription for <title> and <meta description>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:54:29 +03:00
emilandClaude Sonnet 4.6 af64203e17 fix: show single tile ad banner per generator page instead of three
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:43:02 +03:00
emilandClaude Sonnet 4.6 fe5bb4f39c feat: replace ad placeholders with Yandex app referral banners
Leaderboard shows horizontal layout with logo, text and CTA button.
Tile/rectangle show vertical layout. All link to Yandex referral URL with rel=sponsored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:40:00 +03:00
emil 71b5f68064 chore: add site verification meta tag 2026-05-09 14:35:43 +03:00
emil ddcae5094a chore: add Yandex site verification file 2026-05-09 14:17:56 +03:00
emil 3d9b9ca498 ci: trigger deploy after SSH key fix 2026-05-09 14:13:10 +03:00
emilandClaude Sonnet 4.6 ff40720df2 fix: use printf to preserve SSH key newlines in deploy workflow
echo strips trailing newlines from multiline secrets, breaking PEM format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:10:23 +03:00
Emil Shanaty c1badc3eec Merge pull request #3 from emil28092005/dev
feat: coin flip, list picker, uuid/token generators
2026-05-09 14:09:12 +03:00
emilandClaude Sonnet 4.6 9a5b85f32f feat: add coin flip, list picker, uuid/token generators
- 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 <noreply@anthropic.com>
2026-05-09 14:07:22 +03:00
emilandClaude Sonnet 4.6 c4c900232e ci: add GitHub Actions deploy workflow
On push to main: builds Astro, deploys dist/ to reg.ru via rsync over SSH.
Requires DEPLOY_KEY, DEPLOY_HOST, DEPLOY_USER secrets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:01:28 +03:00
Emil Shanaty a64bede6bd Merge pull request #2 from emil28092005/dev
feat: lottery, dice, card generators
2026-05-09 13:49:02 +03:00
emilandClaude Sonnet 4.6 d3434bc928 feat: add card generator
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 <noreply@anthropic.com>
2026-05-09 13:47:10 +03:00
emilandClaude Sonnet 4.6 01ddfc8428 feat: add dice generator
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 <noreply@anthropic.com>
2026-05-09 13:42:16 +03:00
emilandClaude Sonnet 4.6 09f593a062 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 <noreply@anthropic.com>
2026-05-09 13:40:58 +03:00
Emil Shanaty 9772f04f23 Merge pull request #1 from emil28092005/feat/password-generator
feat: add password generator
2026-05-09 13:36:38 +03:00
emilandClaude Sonnet 4.6 c3a3693016 chore: update package-lock.json after npm install
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:35:59 +03:00
emilandClaude Sonnet 4.6 3b7b1382b4 feat: add password generator
Adds /generators/password/ with length slider (4–64), uppercase/lowercase/digits/symbols toggles, guaranteed character-type coverage, Fisher-Yates shuffle, and clipboard copy. Sets password status to live in the generator catalog. Also adds CLAUDE.md with project architecture notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:32:35 +03:00
emil28092005 6a8630a00d Add colours generator. 2026-05-09 13:30:43 +03:00
emil28092005 b1db390c06 Initial commit 2026-05-09 01:57:12 +03:00