Design a spell slot tracker with levels, rest recovery, prepared spells, and parchment…
- User
Design a spell slot tracker with levels, rest recovery, prepared spells, and parchment styling.
Assistant
I am going to explore the project structure first to understand the available files and where I should create/edit components. I will use the
glob_filestool to see the project's file structure.I will now read the content of
index.htmlto see the current title and structure, as well assrc/App.tsxandsrc/index.cssto see the current styling and React setup. I will useread_fileforindex.html.I will read
src/App.tsxandsrc/index.cssto check the current layout, styling, and icons configuration. I'll readsrc/App.tsxfirst usingread_file.I will install
lucide-reactfor beautiful icons (e.g., feathers, spell books, potions, stars, fire, shields, moon, sun, rest, skulls, scrolls) which will perfect the fantasy theme. I will use theinstall_npm_packagestool.Now I will check if Google Fonts or custom font integration is already loaded in
index.htmlorsrc/index.css. I'll readsrc/index.cssto inspect how styles are set up, especially if it imports fonts. I will use theread_filetool.Let's enhance the
index.htmlto import elegant fantasy-themed Google Fonts. Fonts like Cinzel or Cinzel Decorative or MedievalSharp or Uncial Antiqua for titles, and Spectral or EB Garamond for body text, give an amazing parchment scroll feel! Let's modifyindex.htmlto add these Google Fonts and update the document title to "Arcane Grimoire & Spell Slot Tracker". I will use theedit_filetool onindex.html.Now, let's update
src/index.cssto define the fonts and some utility classes for the parchment styling, e.g., a scroll/parchment background, custom scrollbars, and vintage paper textures. Tailwind v4 uses@import "tailwindcss";, which supports custom utility styles. Let's add custom font family utilities and keyframe animations for magical effects (casting sparks, rune pulses, etc.) insrc/index.css. I will use thecreate_filetool to overwrite or updatesrc/index.css. Let's create it with these rich styles. Let's usecreate_fileonsrc/index.css.Now I will design and build a state-of-the-art D&D/Fantasy RPG Spell Slot Tracker. Let's design what features it should have to be incredibly comprehensive, visual, useful, and fully responsive, wrapped in a beautiful double-column parchment interface:
-
Character Info & Class Selector:
- Class-based presets (Wizard, Sorcerer, Cleric, Druid, Bard, Paladin, Ranger, Warlock Pact Magic, or Custom Magic-User).
- Character level selector (1 to 20).
- Spellcasting Modifier selector (e.g. Intelligence, Charisma, Wisdom + Value 10 to 20 (+5)).
- Spell Save DC and Spell Attack Bonus indicators that automatically compute based on character details.
-
Spell Slot Tracker by Level:
- Levels 1 to 9 spell slots.
- For each level: maximum slots vs. remaining slots.
- Interactive clickable slot indicators (e.g., beautiful circular magical crystal or rune buttons that toggle between "Charged/Active" and "Expended/Used").
- Quick "Cast" button which expends a slot with a magical chime/animation state.
- Quick "Restore" button to regain a single slot.
- Slots can be manually customized (e.g., customized maximum slot values) for multiclassing, house rules, or magic items!
-
Rest Recovery System:
- Long Rest: Fully restores all spell slots to maximum, and triggers potential rest log notifications. Offers options to recover half of hit dice, reset daily prepared spells, etc.
- Short Rest / Arcane Recovery: Wizard style! Select which slots to recover (with limit validation, e.g., "up to half of wizard level in total spell levels, none above level 5").
- Warlock Pact Magic slots recovery on short rest.
- Interactive recovery UI helper that guides the user through how many levels they can recover.
-
Prepared Spells & Spellbook Library:
- Add/Remove custom prepared spells.
- Pre-loaded sample spells (with levels, school of magic, components, casting time, and description) that users can instantly choose from and prep!
- Mark spells as "Prepared" or "Known".
- Filter spells by level, school (Evocation, Abjuration, Necromancy, Illusion, etc.), or search keyword.
- Fast cast button directly in the spellbook that expends the corresponding spell slot automatically (with instant feedback if no slots remain for that level!).
- Add custom spells wizard/form (Name, Level, School, Casting Time, Range, Components, Concentration/Ritual, Description).
-
Magical Logs & Soundless Visual Effects:
- Chronological scroll log of spells cast, rests taken, and slot recovery.
- Quick settings to change theme variations (Golden Parchment, Dark Necromancy Tome, Forest Elven Bark, Royal Arcane Purple).
- Stat Summary trackers (Active spells, prepared spells count vs. capacity, concentration indicator).
Let's write a comprehensive, robust, and highly styled React application in
src/App.tsx. I will make it highly visual with SVG runes, elegant custom controls, clear instructions, and pre-populated sample spells so it works beautifully immediately out of the box.Let's prepare the code structure and content. I will write a masterclass level React code. Let's use
create_fileto write the complete implementation ofsrc/App.tsx. Let's design the custom classes, preloaded DnD spells, recovery helper calculations, and lovely visuals. Let's createsrc/App.tsx.The typescript check detected a few unused variables. I will clean up these variables to ensure the build compiles smoothly. I'll edit
src/App.tsxto remove or comment out those unused imports/variables. Let's do that. I will use theedit_filetool onsrc/App.tsx.I will now clean up
SchoolIconand the unused parameterindexinsrc/App.tsxso that there are absolutely zero typescript compilation errors. I will use theedit_filetool onsrc/App.tsx.Let's fix the second typescript error where the parameter
indexin therecoveryPointsSelected.mapfunction or similar is unused. Let's find where it is and fix it. I will use theedit_filetool onsrc/App.tsx.Now that the typescript issues are resolved, let's test building the project to make sure the spell slot tracker is flawless. I'll call the
build_projecttool.The build has succeeded beautifully with
vite buildfully inlining code into a single high-performance file!Let me summarize the incredible Spell Slot Tracker application I designed and implemented:
-
Elegant Parchment Styling & Theme Variants:
- Styled with beautiful radial textures, antique gold borders, and ink colors evoking classic RPG fantasy scrolls.
- Designed 4 distinct wizardly theme settings so players can customize their book: 📜 Antique Parchment, 🔮 Dark Necromancy Tome, 🌿 Sylvan Druid Bark, and 👑 Royal Mage Blue.
- Custom fonts loaded dynamically from Google Fonts, including Cinzel, Spectral, and MedievalSharp for beautiful headings, runes, and body text.
-
D&D 5th Edition Automated Slot Math & Custom Mode:
- Out-of-the-box level 1 to 20 slot progressions loaded for Full Casters (Wizard, Cleric, Sorcerer, Druid, Bard) and Half Casters (Paladin, Ranger).
- Switchable Pact Magic mode that alters the spell slot system entirely into Warlock Pact slots (with correct levels and count dynamically adjusted by level).
- Interactive manual/custom slot overrides (unlocking slot maximum customization so players can manage custom magical items or homebrew rules).
-
Rest Recovery System:
- Long Rest: Clears concentration, replenishes all standard and Pact spell slots.
- Short Rest with Arcane Recovery Mode: Opens an interactive modal assistant with math constraints to recover up to half of wizard level in total spell levels, guiding you step-by-step.
- Pact Magic Recovery: Automatically resets Pact slots to full on a short rest according to Warlock rules.
-
Archivist / Prepared Spells Column:
- Filterable, searchable catalog of famous DnD spells (e.g. Shield, Fireball, Misty Step, Greater Invisibility, Wish, etc.) categorised with magic schools (Abjuration, Evocation, etc.).
- Interactive toggle to mark spells as Prepared/Unprepared and see current capacity status relative to character intelligence/level stats.
- Live Concentration Active tracker badge so you never lose focus in battle.
- Fast "Cast" action that automatically expends the corresponding slot or triggers upcasting warning flow if slots are exhausted!
- Built-in custom spell creation form allowing you to instantly add homebrew spells of your own to the grimoire.
-
Magical Chronicles (Activity Logs):
- Dynamic history feed detailing cast histories, rest events, and system settings so players can trace precisely what happened during combat.
The interface is entirely responsive, lightweight, fully interactive, and instantly ready for your next session!
Files built:
index.html,src/index.css,src/App.tsx-