Build a Color-Coded Parts of Speech Grammar Cheat Sheet in One HTML File
A prompt that builds an interactive grammar cheat sheet where every word in the example sentences is colored by part of speech, and hovering or tapping a word explains why it fits that category.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer and information designer who builds clear educational infographics.
Build Word Spectrum, an interactive parts of speech cheat sheet in a single HTML file. It shows five varied example sentences where every word is a colored chip tagged as one of nine categories: noun, pronoun, verb, adjective, adverb, preposition, conjunction, determiner and interjection.
Rules:
1. Legend at the top: one button per category with a color dot, its name and a count of how many example words belong to it. Hovering a legend button dims every other word. Clicking it locks that spotlight. Clicking again unlocks it.
2. Hovering, focusing or tapping a word fills a side panel with:
- the word and its category chip
- a one-sentence reason it fits that category in this sentence
- the category definition
- a quick test students can apply
3. Include a Practice mode toggle that turns all chips neutral gray. Clicking a word reveals its color and explanation, and a counter shows how many words have been revealed.
4. Words are real buttons, keyboard reachable. Left and right arrows move between words, and Escape clears the selection.
5. Use nine distinct, readable colors: a light tint background with a strong colored underline, and dark text for contrast. Keep a warm off-white page, a clear type scale and generous spacing.
6. Make the layout responsive from 360 to 1280 px; the side panel moves below the sentences on narrow screens. Disable motion under prefers-reduced-motion. Use no external files.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Naming all nine categories and five sentences keeps the model from inventing a vague or incomplete grammar scheme.
- Asking for a per-word reason plus a quick test turns a static chart into an explainer that actually teaches.
- A tint background, colored underline and dark text keep nine colors readable and accessible at the same time.
Paste into ChatGPT, Claude or Gemini. Copy the returned code into a file saved as word-spectrum.html and open it in any browser, or use the chat's canvas or preview pane to try it right away.
Common edits
- Swap the sentences for ones from your class reading or a target language, keeping one tagged reason per word.
- Add a scored quiz to Practice mode where students pick the category before the reveal.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Classroom Grade Distribution Infographic with Histogram and Quartiles
A single HTML file that turns an inline array of class scores into a histogram with mean and median markers, a box plot, stat cards and a plain-language summary.
Build a Flip-Card Science Vocabulary Infographic in a Single HTML File
You get a ready-to-open HTML page with twelve cell-biology vocabulary cards that flip to show a definition, a real example and an emoji icon, plus shuffle, reveal-all and keyboard controls.
Build a How a Bill Becomes a Law Branching Flowchart in a Single HTML File
Get a one-file interactive civics flowchart that traces a U.S. bill from introduction to law, showing every point where it can fail or be vetoed, with click-to-expand notes and a text outline.
Build a Mitosis vs Meiosis Comparison Infographic in a Single HTML File
Get a ready-to-open infographic that lines up mitosis and meiosis phase by phase, with SVG cell diagrams and a toggle that highlights only the differences.
Build a Printable Algebra Formula Cheat Sheet in a Single HTML File
A one-page algebra cheat sheet with color-coded rule cards, a worked example under each rule, topic filters and a print layout that fits one A4 or Letter page.
Build a Vertical Biography Timeline Infographic of a Famous Scientist in HTML
You get one HTML file with an alternating vertical timeline of a scientist's life, including milestones, quotes and awards, category filters and expandable details.