dnd-combat-tracker / src /content.py
Jordancole21's picture
Deploy native Gradio SEO page and tool
901493d verified
Raw
History Blame Contribute Delete
10.6 kB
"""Page copy: how-to, feature overview, worked example, tips, FAQs.
One H1 lives in the hero; every heading here renders as an H2 via section_html.
No AI on this page — all copy describes deterministic tracker behavior.
"""
HOW_TO_HTML = """
<p>This free <strong>DnD combat tracker</strong> runs an entire D&amp;D 5e battle in
your browser — not just the turn order. Add your party and monsters once, and the
tracker keeps initiative sorted, counts rounds, tracks every creature's hit points,
and pins condition markers like Prone, Stunned, and Concentrating exactly where they
belong. There is nothing to install and no account to make; the whole encounter
lives on this page.</p>
<ol>
<li><strong>Add your combatants.</strong> Enter a name, pick a side (PC, Ally, or
Enemy), and set initiative, max HP, and an optional AC. The board re-sorts itself by
initiative every time you add someone — even mid-fight.</li>
<li><strong>Or press "Load Example Encounter."</strong> One click builds a ready-made
goblin ambush — four adventurers, three goblins, and a goblin boss — so you can try
every control before your session starts.</li>
<li><strong>Run the fight.</strong> Hit <em>Next Turn</em> to advance down the
initiative order. When the last combatant finishes, the tracker wraps back to the
top and increments the round counter automatically.</li>
<li><strong>Track damage and conditions as they happen.</strong> Select a combatant,
type a number, and hit Damage or Heal. Toggle any 5e condition on or off with two
clicks. HP always shows as current/max, like 7/12.</li>
<li><strong>Export when the dust settles.</strong> Copy the encounter summary or
download it as Markdown — round, order, HP, and conditions — for your session
notes.</li>
</ol>
"""
HANDLES_HTML = """
<p>Plenty of tools sort initiative and stop there. This tracker manages the whole
fight from "roll initiative" to "the boss drops":</p>
<ul>
<li><strong>Initiative order</strong> — automatically sorted highest to lowest, with
tied rolls kept in the order you added them, so the order never shuffles
unexpectedly mid-combat.</li>
<li><strong>Hit points</strong> — damage and healing clamp cleanly between 0 and max
HP. When a PC hits 0, the tracker marks them <em>Unconscious</em> so you remember
death saves; when an enemy hits 0, it marks them <em>Down</em> and dims their row so
the board reflects the battlefield.</li>
<li><strong>All fifteen 5e conditions, plus Concentrating</strong> — Blinded through
Unconscious, each shown as a chip on the combatant's row. Concentrating is included
because forgotten concentration checks are the most common ruling mistake at real
tables.</li>
<li><strong>Rounds and turns</strong> — a persistent round counter with a clear
"whose turn is it" banner, plus a Back button for when someone realizes they
forgot their bonus action.</li>
<li><strong>Automatic saving in your browser</strong> — the encounter state is
stored locally on your device, so an accidental tab refresh mid-boss-fight does not
wipe the battle. Nothing is uploaded anywhere.</li>
<li><strong>Markdown export</strong> — a clean summary table with one-click copy and
a .md download that drops straight into Obsidian, Notion, or your campaign log.</li>
</ul>
"""
EXAMPLE_HTML = """
<p>Here is what running a real fight in this tracker looks like, using the built-in
example encounter. Press <em>Load Example Encounter</em> above and you can follow
along click for click.</p>
<p><strong>The setup.</strong> Four adventurers — Fenwick Thistledown (initiative
21), Korga Stonefist (18), Sera Brightshield (15), and Maelis the Ember (12) — are
ambushed on the Emberford road by Grubnash the goblin boss (17), a goblin
skirmisher and a goblin archer (tied at 14), and a goblin sneak (9). The tracker
sorts them instantly; the two goblins on 14 stay in the order they were added, so
the order is stable all night.</p>
<p><strong>Round 1.</strong> Fenwick opens on 21 and puts an arrow into the goblin
skirmisher: select the skirmisher, type 5, hit <em>Damage</em> — its HP drops to
2/7. Korga charges on 18. Grubnash acts on 17 and shoulder-checks Korga for 4.
Sera goes on 15, shield-bashes Grubnash for 9 — his HP reads 12/21 — and knocks
him sprawling: two clicks toggle <em>Prone</em> onto his row. The goblins on 14
scatter, Maelis casts on 12 and toggles <em>Concentrating</em> onto herself, and
the sneak skulks on 9. <em>Next Turn</em> wraps to the top: the banner now reads
Round 2, Fenwick's turn.</p>
<p><strong>Round 2.</strong> Fenwick finishes the skirmisher — 3 more damage takes
it to 0/7, and the tracker automatically marks it <em>Down</em> and dims its row.
Grubnash stands from Prone (toggle it back off) and lands a nasty hit on Maelis:
6 damage, and because she is Concentrating, the chip on her row reminds the table
she owes a save. The archer tags Sera for 3.</p>
<p><strong>Round 3.</strong> Korga's greataxe takes Grubnash from 12 to 0 — the
boss row is struck through and marked Down. The archer and sneak fold in the next
two turns, and the fight ends with three rows dimmed. Hit <em>Copy Summary</em>
and the whole result — round 3, final HP, every condition — pastes into your
session notes. Then <em>Reset Encounter</em> restores everyone to full HP for the
rematch, keeping the roster intact.</p>
"""
RULES_HTML = """
<p>A tracker you trust is one whose behavior you can predict. Here is exactly how
this one works:</p>
<ul>
<li><strong>Sort order:</strong> combatants are always sorted by initiative, highest
first. Adding a combatant mid-fight re-sorts the board but keeps the current turn
pointing at the same creature.</li>
<li><strong>Ties:</strong> equal initiatives keep the order you added them in — no
random reshuffling. If your table breaks ties by Dexterity, add the higher-Dex
combatant first, or give one a decimal initiative like 14.5.</li>
<li><strong>At 0 HP:</strong> player characters and allies gain
<em>Unconscious</em> (they are dying and rolling death saves, per 5e rules), while
enemies are marked <em>Down</em> and dimmed — most tables treat monsters at 0 as
dead. Healing anyone above 0 clears both markers automatically.</li>
<li><strong>Why Concentrating is a condition here:</strong> it is not a formal 5e
condition, but a visible Concentrating chip is the cheapest insurance against the
classic mistake — taking damage and forgetting the Constitution save, or stacking
two concentration spells on one caster.</li>
<li><strong>Turns never get skipped:</strong> Down and Unconscious combatants stay
in the order, because unconscious PCs still take death saves on their turn and
enemies can be healed back up. Remove a combatant only when it is truly out of the
fight.</li>
<li><strong>Your data stays with you:</strong> the encounter is saved to your
browser's local storage on your own device. Nothing is sent to a server, there is
no account, and clearing your browser data clears the encounter.</li>
</ul>
"""
FAQS = [
(
"How do you track combat in D&D 5e?",
"You need four things: an initiative order sorted highest to lowest, a "
"round counter, current hit points for every creature, and a way to mark "
"conditions like Prone or Stunned. Most tables juggle this across scratch "
"paper, memory, and someone's phone calculator. This tracker keeps all "
"four in one board: add combatants, press Next Turn to advance, and apply "
"damage or conditions as they happen.",
),
(
"What's the best way to track HP and conditions during a fight?",
"Track current/max HP per creature and update it the moment damage lands "
"— retroactive bookkeeping is where fights fall apart. Conditions work "
"best as visible markers attached to the creature, not a side list. Here, "
"HP shows as 7/12 on each row and conditions appear as chips, so a glance "
"at the board tells you the whole battlefield state.",
),
(
"Does this work for large battles?",
"Yes. There is no practical limit for normal play — the board handles "
"dozens of combatants, and the sort, round counter, and per-creature HP "
"all scale the same way. For big fights, add monsters as numbered entries "
"(Goblin 1, Goblin 2) so the dropdown stays unambiguous; downed enemies "
"dim automatically, which keeps a crowded board readable.",
),
(
"Is my encounter saved?",
"Yes — in your browser's localStorage, on your own device. Refresh the "
"tab mid-fight and the battle comes back exactly where you left it. "
"Nothing is uploaded to any server and no account exists, which also "
"means the encounter won't follow you to a different device or browser.",
),
(
"Can I use this as a player, not just a DM?",
"Absolutely. Players use it to track their own character plus known "
"enemies, to watch concentration, or to run the count for the table so "
"the DM can focus on the monsters. Since nothing requires an account, "
"anyone at the table can have their own copy open.",
),
(
"How is this different from an initiative tracker?",
"An initiative tracker handles turn order only — who goes when. This is "
"a full combat tracker: it runs the whole battle, including hit points, "
"damage and healing, all 5e conditions, automatic down/unconscious "
"marking, and a round counter. If all you want is the fastest possible "
"turn order, use our dedicated D&D Initiative Tracker linked below "
"instead.",
),
(
"Does it support the 2024 rules (5.5e)?",
"Yes. Initiative, rounds, hit points, and the fifteen conditions tracked "
"here are shared between D&D 5e (2014) and the 2024 revision — the "
"condition list is the same in both. The tracker is rules-light on "
"purpose, so it also works fine for most other d20 systems.",
),
]
DISCLAIMER_HTML = (
'<p class="lf-disclaimer">'
"This is an unofficial fan tool. Dungeons &amp; Dragons and D&amp;D are "
"trademarks of Wizards of the Coast LLC. This tool is not affiliated with, "
"endorsed, or sponsored by Wizards of the Coast. The tracker is fully "
"deterministic — no AI is involved — and your encounter is stored only in "
"your own browser. This tool is built and maintained by "
'<a href="https://loreify.ai">Loreify</a>, an AI session-notes app for '
"D&amp;D campaigns.</p>"
)