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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Word Spectrum, a color-coded parts of speech cheat sheet.

Five example sentences show every word as a tinted chip. Hover, tap or Tab onto a word and the side panel explains why it's a noun, verb, adverb and so on. It also gives a quick test to check yourself.

Hover a legend key to spotlight one category, or click it to lock the spotlight. Turn on Practice mode to gray everything out, guess each word's role, then tap to reveal. Use the arrow keys to step through words.

Written by AI from this prompt. Your results will vary.

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 in Infographics