012
LVL 01 — WAVE DEFENDER SESSION 012 DAY 12

TOOLBAR LABELS

🎫 PIXELCRAFT-002
🐛 Bug | 🟢 Beginner | Priority: 🟡 Medium

The toolbar area exists but buttons show empty boxes with no text. The HTML elements need proper content, labels, and semantic structure. The settings panel is empty — add proper sections and form labels.

Acceptance Criteria:
• Toolbar buttons labeled: Upload, Grayscale, Brightness, Contrast, Invert, Crop, Undo, Redo, Export
• Settings panel has section title "Adjustments"
• Each setting has a proper label
CONCEPTS.UNLOCKED
</>
HTML Elements in Depth
Text: <h1>–<h6>, <p>, <span>, <strong>, <em> · Structure: <div>, <section>, <article>, <aside> · Navigation: <nav>, <ul>, <li>, <a> · Interactive: <button>, <input>, <label>, <select> · Media: <img>, <canvas>, <video>, <audio>
🏷
Tags, Attributes, Content
<button id="upload-btn" class="tool-btn" title="Upload image">Upload</button> — the tag (button), attributes (id, class, title), and content (Upload). Three layers that define every element.
Semantic HTML
Using the RIGHT tag for the RIGHT purpose. <nav> for navigation (not <div>), <button> for actions (not <div onclick>), <main> for primary content, <aside> for sidebars.
▣ ▬
Block vs Inline
Block elements (<div>, <p>, <h1>) take full width and stack vertically. Inline elements (<span>, <strong>, <a>) flow within text on the same line.
🔊
Accessibility
Semantic HTML enables screen readers. A <button> is automatically focusable, clickable with keyboard (Enter/Space), and announced by assistive tech. A <div onclick> is invisible to all of that.
🔗
Label → Input Linking
The for attribute on <label> links it to an input's id. Clicking the label focuses the input. This is accessibility for free — built into HTML.
HANDS-ON.TASKS
01
Label Toolbar Buttons

Find the toolbar in index.html — empty buttons with no text. Add labels:

<nav id="toolbar" class="toolbar"> <button id="upload-btn" class="tool-btn" title="Upload image (Ctrl+U)">Upload</button> <button id="grayscale-btn" class="tool-btn" title="Apply grayscale">Grayscale</button> <button id="brightness-btn" class="tool-btn" title="Adjust brightness">Brightness</button> <button id="contrast-btn" class="tool-btn" title="Adjust contrast">Contrast</button> <button id="invert-btn" class="tool-btn" title="Invert colors">Invert</button> <button id="crop-btn" class="tool-btn" title="Crop image">Crop</button> <button id="undo-btn" class="tool-btn" title="Undo (Ctrl+Z)">Undo</button> <button id="redo-btn" class="tool-btn" title="Redo (Ctrl+Y)">Redo</button> <button id="export-btn" class="tool-btn" title="Export image">Export</button> </nav>
Notice: <nav> not <div>. <button> not <div onclick>. The title attribute provides tooltips on hover AND screen reader labels.
02
Structure the Settings Panel
<aside id="settings-panel" class="settings-panel"> <h2>Adjustments</h2> <div class="filter-group"> <label for="brightness">Brightness</label> <input type="range" id="brightness" min="-100" max="100" value="0"> <span id="brightness-value">0</span> </div> <!-- ... more filter groups for Contrast, Saturation, etc. ... --> </aside>

The for="brightness" on the label links to the input's id="brightness". Click the label → the slider gets focus.

03
Add the Canvas Area
<main id="canvas-area" class="canvas-area"> <canvas id="canvas" width="800" height="600"></canvas> </main>

<main> tells the browser and screen readers: "this is the primary content." There should be only one <main> per page.

04
Validate in DevTools

Check DevTools Elements tab — is the structure clean? Does the nesting make sense?

Test semantics: Use the Tab key to navigate through the page. Every <button> and <input> should receive focus with a visible outline. Press Enter or Space on a focused button — it should "click."

If a <div onclick> were used instead, Tab would skip it entirely. This is why semantic HTML matters — it gives you keyboard navigation and screen reader support for free.
05
Close the Ticket
git switch -c feature/PIXELCRAFT-002-toolbar-labels git add src/index.html git commit -m "Add toolbar labels and settings structure (PIXELCRAFT-002)" git push origin feature/PIXELCRAFT-002-toolbar-labels # PR → Review → Merge → Close ticket ✅
CS.DEEP-DIVE

Semantics = meaning attached to structure.

A <button> tells the browser: "this is interactive — make it focusable, make it clickable with keyboard (Enter/Space)." A <div> with an onclick tells nothing — screen readers skip it, keyboards can't reach it.

// The distinction between raw data and
// meaningful structure is fundamental to CS:

Databases       → schemas give data structure with meaning
APIs            → typed responses tell clients
                  what each field is
Programming     → type systems prevent
  languages       misuse of values
HTML            → semantic tags tell browsers
                  what each element is

// Giving data the right structure and meaning
// enables tools to work with it intelligently.
"Semantic Audit"
[A] Navigate PixelCraft using ONLY the keyboard (Tab, Enter, Space). Document which elements are reachable and which are not.
[B] Compare the HTML structure of PixelCraft with a real image editor (Photopea, Canva). What semantic tags do they use?
[C] Add ARIA labels to any elements that need them: aria-label, aria-describedby, role attributes.
REF.MATERIAL
ARTICLE
Mozilla Developer Network
Complete reference of every HTML element grouped by category. Bookmark and use as a lookup table.
HTMLREFERENCEMDN
VIDEO
Web Dev Simplified
When to use section vs article vs div, header vs nav, aside vs main. Clear examples of correct semantic choices.
SEMANTICSACCESSIBILITY
ARTICLE
A11y Project
Practical accessibility checklist for web developers. Use to audit PixelCraft's HTML for common accessibility issues.
ACCESSIBILITYCHECKLIST
VIDEO
Programming with Mosh
Deep dive into forms: input types, labels, placeholders, validation attributes. Essential for the settings panel controls.
FORMSINPUTSLABELS
TOOL
WebAIM
Browser extension that visually overlays accessibility errors on your page. Run it against PixelCraft after your changes.
ACCESSIBILITYTESTING
// LEAVE EXCITED BECAUSE
PixelCraft's structure is solid. Buttons have labels. The settings panel has sections. The HTML is semantic and accessible. You're building a real product.