The Timeline App is a multi-stage web development project aimed at building an interactive, accessible, and visually structured application to showcase chronological events. This app will evolve from a semantic HTML skeleton into a fully interactive, accessible React-based single-page application.
Create a semantic and accessible static skeleton for the timeline app using HTML.
- Semantic HTML structure using:
<header>,<nav>,<main>,<section id="timeline">,<article>,<figure>
- Header includes:
- Project logo (
TimelineApp) - A placeholder theme toggle control (π)
- Project logo (
- Nav: Placeholder for future filters.
- Main/Timeline Section: Contains article placeholders for timeline event entries.
- Modal Placeholder: Empty
<div id="modal">reserved for future pop-ups. - Accessibility:
- Proper landmark roles (
role="dialog",aria-hidden, etc.) alttext on placeholder images- Logical content structure using semantic elements
- Proper landmark roles (
A responsive, visually structured layout using Flexbox and CSS Grid. Styled according to design reference.
- Color Palette: Dark blue header/footer, white/light card backgrounds
- Header: Flex layout with logo/title on the left and theme toggle on the right
- Filter Bar: Pill-shaped dropdown selectors with spacing
- Timeline Grid:
- Responsive card layout (1β3 columns depending on screen size)
- Event cards with images, headings, date text, and descriptions
- Footer: Copyright, License Info.
- Responsiveness: Breakpoints at 768px and 1024px
- Variables: CSS variables for colors and themes for easy dark mode support later
The timeline is now fully interactive: events are loaded from a JSON file, rendered dynamically as cards, and detailed information is shown in a modal popup when an event is clicked.
-
Data Source:
events.jsonin the project root contains at least 8 events, each withyear,title,description,imageURL, andcategory.
-
Dynamic Rendering:
script.jsfetches and parsesevents.jsonasynchronously.- The
#timelinesection is populated with event cards generated in JavaScript, each displaying the eventβs image, title, year, and a short description.
-
Interactivity:
- Clicking an event card opens a modal (
#modal) with full event details, including image, year, title, category, and description. - Modal can be closed via a close button or by clicking outside the modal content.
- Accessibility features: modal uses
role="dialog",aria-hidden, and focus management for keyboard navigation.
- Clicking an event card opens a modal (
-
Code Placement:
- All JavaScript logic is in
script.js. - The script is loaded at the end of
<body>inindex.htmlfor optimal performance.
- All JavaScript logic is in
Result:
Timeline events are now loaded dynamically and displayed as interactive cards. Users can view detailed event information in an accessible
Introduce static typing, modular structure, and a TypeScript build process to improve code maintainability and scalability.
-
Setup
- Initialize TypeScript with
tsconfig.jsonset to strict mode. - Organize source files under a new
src/directory.
- Initialize TypeScript with
-
Code Conversion
- Convert
script.jsβsrc/index.ts. - Define interfaces/types for event data structure (
Event,Category, etc.). - Use ES modules by separating logic into:
fetcher.tsβ Responsible for loading event data.renderer.tsβ Handles DOM creation for event cards.modal.tsβ Manages modal open/close logic.
- Convert
-
Build Process
- Add build scripts to
package.jsonusing:tsc(TypeScript compiler) or- A bundler (e.g., Vite, Webpack, Parcel).
- Output compiled JS files into a
dist/folder.
- Add build scripts to
-
Verification
- Test the compiled app in the browser to ensure functionality matches the JavaScript version.
Result:
The project is now type-safe, modular, and ready for scaling into a React application.
Migrate the Timeline App to a modern React single-page application (SPA) with reusable components, state management, and improved developer experience.
-
Project Setup:
- Initialize a new React project using Vite or Create React App.
- Organize source files under
src/with clear separation of components, assets, and styles.
-
Component Structure:
- App: Root component managing global state and layout.
- Header: Logo, theme toggle, and navigation.
- FilterBar: Dropdowns or pills for filtering events by category/year.
- Timeline: Renders a grid/list of
EventCardcomponents. - EventCard: Displays summary info for each event.
- Modal: Shows detailed event info when an event is selected.
- Footer: Copyright.
-
Data Handling:
- Load events from a local JSON file or via fetch.
- Use React state/hooks for managing events, filters, and modal visibility.
-
Interactivity & Accessibility:
- Clicking an event card opens the modal with full details.
- Modal supports keyboard navigation and ARIA roles.
- Filters update the timeline in real time.
-
Styling:
- Reuse and adapt existing CSS, or use CSS Modules or styled-components for scoped styles.
- Maintain responsiveness and dark mode support.
-
Build & Test:
- Ensure the app builds and runs locally.
- Test all interactive features and accessibility.
Result:
The Timeline App is now a modular, maintainable React SPA with reusable components, dynamic rendering,
Ensure the Timeline App is accessible to all users, including those with disabilities, by following best practices for web accessibility (WCAG 2.1 AA).
-
ARIA Roles & Attributes
- Added appropriate ARIA roles and attributes to all interactive elements.
- Used
role="dialog"andaria-modal="true"on the modal, or used the native<dialog>element. - Marked the active timeline marker with
aria-current="step".
-
Focus Management
- Trapped keyboard focus within the modal when it is open.
- Returned focus to the triggering timeline marker when the modal closes.
-
Keyboard Navigation
- Ensured all timeline markers are reachable via Tab and Arrow keys.
- Allowed users to open the modal with Enter/Space and close it with Esc.
-
Color Contrast
- Verified all text and interactive elements meet WCAG AA contrast ratio (β₯4.5:1).
-
Other WCAG Requirements
- Provided visible focus indicators for all interactive elements.
- Ensured all content is accessible with screen readers.
- Used semantic HTML wherever possible.
-
Documentation
- Documented all accessibility features and decisions in
ACCESSIBILITY.md.
- Documented all accessibility features and decisions in
Result:
The Timeline App is now inclusive and usable for everyone, meeting modern accessibility standards and guidelines.
| Task # | Stage | Outcome |
|---|---|---|
| β 1 | HTML | Semantic, accessible skeleton |
| β 2 | CSS | Responsive static layout with Flexbox/Grid |
| β 3 | JavaScript | DOM interaction, events, dynamic timeline |
| β 4 | TypeScript | Strongly typed version of logic and models |
| β 5 | React | Component-based architecture with dynamic rendering |
| β 6 | Accessibility | Audit and improvements for full usability |
js-school-project-Joseph/
βββ public/ # Static assets (favicon, etc.)
βββ src/
β βββ assets/ # Images and static resources
β βββ components/ # React components
β β βββ Header.tsx
β β βββ Header.module.css
β β βββ FilterPanel.tsx
β β βββ FilterPanel.module.css
β β βββ Timeline.tsx
β β βββ Timeline.module.css
β β βββ EventCard.tsx
β β βββ EventCard.module.css
β β βββ EventMarker.tsx
β β βββ EventMarker.module.css
β β βββ EventModal.tsx
β β βββ EventModal.module.css
β β βββ ... # Other UI components
β βββ data/
β β βββ events.json # Timeline event data
β βββ App.tsx # Main app component
β βββ main.tsx # React entry point
β βββ index.css # Global styles and variables
βββ ACCESSIBILITY.md # Accessibility documentation
βββ package.json # Project metadata and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ README.md # Project overview and instructions
- HTML5 β Semantic structure
- CSS3 (Flexbox/Grid) β Responsive layout
- JavaScript (ES6+) β Interactivity
- TypeScript β Strong typing and tooling
- React + Vite β SPA with reusable components
- ARIA & WCAG Guidelines β Accessibility compliance
Current Task: β Task 6 β Accessibility audit and improvements
Developed as part of the JS school project submission: js-school-project-Joseph