How wesbos/javascript30 works
1. This repository is not a single application; it is a curated set of 30 independent mini-projects from the JavaScript30 challenge. Each numbered folder is a self-contained demo with its own HTML/CSS/JS and its own browser runtime boundary.
2. The top-level structure is intentionally repetitive: most exercises include an index-START.html and an index-FINISHED.html so the same lesson can be viewed as an unfinished scaffold or a completed solution. A few projects also include separate style.css and script files when the lesson needs more structure.
3. There is no shared backend, build system, or app shell connecting the lessons. The repository behaves like a static workshop library: open a folder, load the HTML in a browser, and the page runs entirely client-side.
4. The main architectural pattern across the repo is direct DOM manipulation. Event listeners on keyboard, mouse, scroll, click, drag, and form events drive nearly all behavior, with state kept in local JavaScript variables or simple browser storage rather than in a central framework store.
5. Several lessons are browser-API driven and therefore have distinct runtime boundaries:
- media/audio demos use the <audio> and <video> elements plus playback controls,
- canvas and drawing demos use the HTML5 Canvas API,
- camera, microphone, and speech exercises use getUserMedia, speech recognition, or related browser permissions,
- geolocation uses the browser location API,
- persistence exercises use localStorage.
6. Some folders include extra assets that are part of the feature boundary, not just decoration. Examples include sound files in the Drum Kit, a video file in Custom Video Player and webcam-related audio in Webcam Fun, and third-party helper scripts like cornify.js for the secret key-sequence demo.
7. The data flow in most projects is simple and one-way: user input or browser sensor events enter through the DOM/API, JavaScript transforms or routes that input, and the page updates visuals, audio, or text immediately. A few exercises introduce local state that feeds back into rendering, such as timers, checked-item ranges, or persisted preferences.
8. The repo contains multiple “algorithmic” lessons that do not rely on a rich UI. Array/Cardio, sorting, reducing, reference/copying, and time-aggregation exercises are mostly pure JavaScript logic wrapped in minimal HTML output, so they form a separate subsystem from the interactive UI demos.
9. CSS is sometimes a first-class part of the lesson rather than just styling. Several folders demonstrate layout, transitions, sticky behavior, CSS variables, flexbox, or scroll-linked effects, so the visual layer is often an active participant in the architecture instead of a passive skin.
10. The package.json files that appear in a few folders indicate lightweight local tooling for browser-based features, not a monorepo build pipeline. Those folders likely need a simple dev server or dependency setup to make permissioned APIs and live media streams work reliably in the browser.
11. The root readme.md is mostly documentation and curation. It links out to the challenge, community solutions, and alternate implementations, but it does not participate in runtime behavior.
12. For an architecture diagram, the most accurate top-level shape is: a documentation/index layer at the root, then 30 isolated static-demo modules underneath, each composed of HTML entrypoint plus optional CSS, JS, and media assets, all executed directly in the browser and connected only by shared tutorial intent rather than shared code.
Main entry points: 04 - Array Cardio Day 1/index-FINISHED.html Array cardio · readme.md readme · 02 - JS and CSS Clock/index-FINISHED.html Clock & variables · 24 - Sticky Nav/index-FINISHED.html Nav effects
Components 18
Root docs
Documentation and curation at the repository root.
- readme · Curates the challenge and links the workshop together, but does not participate in runtime behavior.
readme.md - Workshop set · A curated library of 30 isolated browser demos with no shared app shell or backend.
Interactive demos
Static browser mini-projects built around DOM events and visual interaction.
- HTML entrypoints · Each lesson is loaded directly from a folder via index HTML, usually with START and FINISHED variants.
- DOM events · Direct event listeners and local state drive most lessons: keyboard, mouse, click, scroll, drag, and forms.
- CSS behavior · In several lessons CSS is active behavior, not just styling: layout, transitions, sticky positioning, and variables.
- Clock & variables · Representative lessons where CSS variables and time-based DOM updates coordinate a live UI.
02 - JS and CSS Clock/index-FINISHED.html - Nav effects · Representative lessons for sticky navigation, link highlighting, and scroll-linked behavior.
24 - Sticky Nav/index-FINISHED.html
Browser APIs
Lessons centered on media, sensors, speech, location, canvas, and storage APIs.
- Drum Kit · Keyboard-driven playback mapped to sound assets in a self-contained demo.
01 - JavaScript Drum Kit/index-FINISHED.html - Canvas draw · HTML5 Canvas interactions for drawing and visual feedback.
08 - Fun with HTML5 Canvas/index-FINISHED.html - Video player · Custom playback controls layered over a local video asset.
11 - Custom Video Player/index.html - Webcam Fun · Permissioned webcam and media-stream exercise with live capture and effects.
19 - Webcam Fun/index.html - Speech demos · Speech detection and synthesis lessons built on browser speech APIs.
20 - Speech Detection/index-FINISHED.html - Geolocation · Browser location API lesson for sensor-driven state and display.
21 - Geolocation/index-FINISHED.html - LocalStorage · Client-side persistence lesson using browser storage to retain state.
15 - LocalStorage/index-FINISHED.html - Whack A Mole · Timer- and state-driven browser game with repeated local interactions.
30 - Whack A Mole/index-FINISHED.html
Algorithmic lessons
JavaScript exercises focused on data transformation and language behavior.
- Array cardio · Pure JavaScript data manipulation lessons wrapped in minimal HTML output.
04 - Array Cardio Day 1/index-FINISHED.html - Refs vs copy · Language-behavior lesson focused on object and array reference semantics.
14 - JavaScript References VS Copying/index-FINISHED.html - Sort and reduce · Algorithmic lessons on sorting strings and aggregating time values.
17 - Sort Without Articles/index-FINISHED.html
Connections 17
- readme → Workshop set: curates · The root documentation frames the repository as a workshop collection.
- Workshop set → HTML entrypoints: organizes · Each numbered folder exposes direct browser entrypoints, usually START and FINISHED variants.
- HTML entrypoints → DOM events: drives · Most demos attach event listeners and update the page in response to user input.
- HTML entrypoints → CSS behavior: pairs with · Some lessons use CSS as part of the mechanism, not just the skin.
- DOM events → Drum Kit: example · Keyboard events trigger audio playback.
- DOM events → Video player: example · Input handling controls media playback and UI state.
- DOM events → Whack A Mole: example · Clicks and timers drive game flow.
- CSS behavior → Clock & variables: example · CSS variables and live DOM updates combine for the clock lesson.
- CSS behavior → Nav effects: example · Sticky and scroll-linked behavior is central to the navigation lessons.
- Workshop set → Canvas draw: includes · Canvas-based drawing is one of the distinct browser-API boundaries in the set.
- Workshop set → Webcam Fun: includes · Some lessons require permissioned media streams and live capture.
- Workshop set → Speech demos: includes · Speech recognition and synthesis form another browser-API subsystem.
- Workshop set → Geolocation: includes · Location-based exercises depend on the browser geolocation API.
- Workshop set → LocalStorage: includes · Persistence lessons keep state in localStorage.
- Workshop set → Array cardio: includes · Several lessons are mostly algorithmic JavaScript with minimal UI.
- Array cardio → Refs vs copy: adjacent · Reference/copying is part of the same language-behavior exercise cluster.
- Array cardio → Sort and reduce: adjacent · Sorting and time aggregation belong to the pure-data lesson cluster.