An open API service indexing awesome lists of open source software.

https://github.com/ayokanmi-adejola/multi-step-form

A Responsive, and accessible multi-step form implementation featuring responsive design, real-time validation, and WCAG 2.1 AA compliance. Built with vanilla JavaScript, modern CSS, and semantic HTML as part of Frontend Mentor challenge.
https://github.com/ayokanmi-adejola/multi-step-form

css3 google-fonts html5 mobile-first-workflow vanilla-js

Last synced: 8 months ago
JSON representation

A Responsive, and accessible multi-step form implementation featuring responsive design, real-time validation, and WCAG 2.1 AA compliance. Built with vanilla JavaScript, modern CSS, and semantic HTML as part of Frontend Mentor challenge.

Awesome Lists containing this project

README

          

# Multi-Step Form Application

![Design preview for the Multi-step form coding challenge](preview.jpg)

**A responsive, and accessible multi-step form implementation**

[![Frontend Mentor](https://img.shields.io/badge/Frontend%20Mentor-Challenge-blue?style=for-the-badge)](https://www.frontendmentor.io/challenges/multistep-form-YVAnSdqQBJ)
[![HTML5](https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge&logo=html5&logoColor=white)](https://developer.mozilla.org/en-US/docs/Web/HTML)
[![CSS3](https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge&logo=css3&logoColor=white)](https://developer.mozilla.org/en-US/docs/Web/CSS)
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)

---

## ๐ŸŽฏ Overview

This project is a comprehensive implementation of a multi-step subscription form, developed as part of the Frontend Mentor coding challenge. It demonstrates advanced front-end development skills including responsive design, form validation, state management, and accessibility best practices.

### Challenge Requirements

The application successfully implements all required functionality:

- โœ… **Sequential Navigation** - Complete each step of the form sequence
- โœ… **Bidirectional Flow** - Navigate back to previous steps to update selections
- โœ… **Dynamic Summary** - Real-time summary generation with order confirmation
- โœ… **Responsive Design** - Optimal layout across all device screen sizes
- โœ… **Interactive States** - Comprehensive hover and focus states for all elements
- โœ… **Form Validation** - Robust client-side validation with user-friendly error messages
- โœ… **Accessibility Compliance** - WCAG 2.1 AA standards implementation

## โœจ Features

### ๐Ÿš€ Core Functionality
- **Progressive Form Flow** - Intuitive step-by-step user journey with validation gates
- **State Persistence** - Maintains user selections across navigation and browser sessions
- **Real-time Validation** - Immediate feedback with contextual error messaging
- **Dynamic Pricing Engine** - Automatic price calculations based on billing preferences
- **Interactive Summary** - Comprehensive order review with modification capabilities
- **Smooth Animations** - Polished transitions and micro-interactions

### ๐ŸŽจ User Experience
- **Professional UI Design** - Clean, modern interface following design system principles
- **Responsive Layout** - Seamless experience across desktop, tablet, and mobile devices
- **Interactive Elements** - Comprehensive hover, focus, and active states
- **Loading States** - Smooth transitions between form steps
- **Error Handling** - User-friendly validation with clear recovery paths

### โ™ฟ Accessibility Excellence
- **WCAG 2.1 AA Compliance** - Meets international accessibility standards
- **Keyboard Navigation** - Full functionality without mouse interaction
- **Screen Reader Support** - Comprehensive ARIA implementation
- **Focus Management** - Logical tab order and visible focus indicators
- **Color Accessibility** - High contrast ratios and color-blind friendly design
- **Semantic Markup** - Proper HTML structure for assistive technologies

### ๐Ÿ“ฑ Technical Implementation
- **Vanilla JavaScript** - No external dependencies for optimal performance
- **Modern CSS** - Custom properties, flexbox, and grid layouts
- **Progressive Enhancement** - Works without JavaScript for basic functionality
- **Cross-browser Compatibility** - Tested across all modern browsers
- **Performance Optimized** - Minimal bundle size with efficient rendering

## ๐Ÿ› ๏ธ Technology Stack

| Frontend | Styling | Tooling | Standards |
|----------|---------|---------|-----------|
| ![HTML5](https://img.shields.io/badge/HTML5-E34F26?style=flat-square&logo=html5&logoColor=white) | ![CSS3](https://img.shields.io/badge/CSS3-1572B6?style=flat-square&logo=css3&logoColor=white) | ![Git](https://img.shields.io/badge/Git-F05032?style=flat-square&logo=git&logoColor=white) | ![W3C](https://img.shields.io/badge/W3C-005A9C?style=flat-square&logo=w3c&logoColor=white) |
| ![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=flat-square&logo=javascript&logoColor=black) | ![Google Fonts](https://img.shields.io/badge/Google%20Fonts-4285F4?style=flat-square&logo=google-fonts&logoColor=white) | ![VS Code](https://img.shields.io/badge/VS%20Code-007ACC?style=flat-square&logo=visual-studio-code&logoColor=white) | ![WCAG](https://img.shields.io/badge/WCAG%202.1-AA-green?style=flat-square) |

### Core Technologies
- **HTML5** - Semantic markup with accessibility attributes
- **CSS3** - Modern styling with custom properties and responsive design
- **JavaScript ES6+** - Class-based architecture with modern syntax
- **Ubuntu Font Family** - Professional typography from Google Fonts

### Development Approach
- **Mobile-First Design** - Responsive breakpoints starting from 375px
- **Progressive Enhancement** - Core functionality works without JavaScript
- **Component Architecture** - Modular, reusable code patterns
- **Performance-First** - Optimized for speed and efficiency

## ๐Ÿ—๏ธ Architecture & Implementation

### JavaScript Architecture
```javascript
class MultiStepForm {
// State management with persistent data
// Event-driven navigation system
// Real-time validation engine
// Dynamic pricing calculations
}
```

### CSS Methodology
- **Custom Properties** - Consistent design tokens and theming
- **BEM-inspired Naming** - Scalable and maintainable class structure
- **Mobile-First Responsive** - Adaptive layouts for all screen sizes
- **Component-Based Styles** - Reusable and modular CSS patterns

### Key Implementation Features
- **Form State Management** - Persistent data across navigation
- **Validation Engine** - Real-time feedback with regex patterns
- **Accessibility Layer** - ARIA attributes and keyboard navigation
- **Animation System** - Smooth transitions and micro-interactions
- **Error Handling** - Comprehensive user feedback mechanisms

## ๐Ÿ“ Project Structure

```
multi-step-form-main/
โ”œโ”€โ”€ ๐Ÿ“„ index.html # Semantic HTML structure with accessibility
โ”œโ”€โ”€ ๐ŸŽจ styles.css # Comprehensive CSS system with design tokens
โ”œโ”€โ”€ โšก script.js # Modern JavaScript with class-based architecture
โ”œโ”€โ”€ ๐Ÿ“‹ test-checklist.md # Quality assurance testing guidelines
โ”œโ”€โ”€ ๐Ÿ“– README.md # Comprehensive project documentation
โ”œโ”€โ”€ ๐ŸŽฏ assets/
โ”‚ โ”œโ”€โ”€ ๐Ÿ”ค fonts/ # Ubuntu font family (Regular, Medium, Bold)
โ”‚ โ””โ”€โ”€ ๐Ÿ–ผ๏ธ images/ # Optimized SVG icons and background graphics
โ”œโ”€โ”€ ๐ŸŽจ design/ # Frontend Mentor design references
โ”‚ โ”œโ”€โ”€ desktop-design-*.jpg # Desktop layout specifications
โ”‚ โ””โ”€โ”€ mobile-design-*.jpg # Mobile layout specifications
โ””โ”€โ”€ ๐Ÿ“‹ style-guide.md # Design system specifications
```

### File Organization
- **Separation of Concerns** - HTML structure, CSS presentation, JavaScript behavior
- **Asset Optimization** - Compressed images and efficient font loading
- **Documentation** - Comprehensive guides for development and testing
- **Design References** - Complete visual specifications for implementation

## ๐Ÿš€ Getting Started

### Prerequisites
- **Modern Web Browser** - Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- **No Build Tools Required** - Pure vanilla implementation
- **No External Dependencies** - Self-contained application

### Quick Start
```bash
# Clone the repository
git clone https://github.com/Ayokanmi-Adejola/multi-step-form.git

# Navigate to project directory
cd multi-step-form

# Open in browser
open index.html
# or
start index.html # Windows
```

### Development Setup
```bash
# For development with live server
npx live-server .

# Or use VS Code Live Server extension
# Right-click index.html โ†’ "Open with Live Server"
```

### User Journey
1. **๐Ÿ“ Personal Information** - Enter name, email, and phone number with real-time validation
2. **๐Ÿ“‹ Plan Selection** - Choose subscription tier (Arcade/Advanced/Pro) and billing cycle
3. **๐ŸŽฏ Add-ons** - Select optional services to enhance the experience
4. **๐Ÿ“Š Summary Review** - Confirm selections with dynamic pricing calculation
5. **โœ… Confirmation** - Complete the process with success feedback

## ๐Ÿ” Implementation Details

### Form Validation System
```javascript
// Real-time validation with comprehensive error handling
validateField(fieldName) {
// Email regex validation
// Phone number format checking
// Required field validation
// Custom error messaging
}
```

#### Validation Rules
| Field | Requirements | Error Handling |
|-------|-------------|----------------|
| **Name** | Required, 2+ characters | Real-time feedback |
| **Email** | Valid format, required | Regex pattern matching |
| **Phone** | Valid format, required | International format support |
| **Plan** | One selection required | Visual error indicators |
| **Add-ons** | Optional selections | Dynamic pricing updates |

### State Management
- **Persistent Data** - Form state maintained across navigation
- **Local Storage** - Optional browser storage for session persistence
- **Validation State** - Error states preserved during navigation
- **Dynamic Updates** - Real-time price calculations and UI updates

### Pricing Engine
```javascript
// Dynamic pricing calculation
calculateTotal() {
const planPrice = this.planPrices[plan][billing];
const addonTotal = addons.reduce((sum, addon) =>
sum + this.addonPrices[addon][billing], 0);
return planPrice + addonTotal;
}
```

## ๐ŸŒ Browser Support

| Browser | Version | Status |
|---------|---------|--------|
| ![Chrome](https://img.shields.io/badge/Chrome-90+-4285F4?style=flat-square&logo=google-chrome&logoColor=white) | 90+ | โœ… Fully Supported |
| ![Firefox](https://img.shields.io/badge/Firefox-88+-FF7139?style=flat-square&logo=firefox&logoColor=white) | 88+ | โœ… Fully Supported |
| ![Safari](https://img.shields.io/badge/Safari-14+-000000?style=flat-square&logo=safari&logoColor=white) | 14+ | โœ… Fully Supported |
| ![Edge](https://img.shields.io/badge/Edge-90+-0078D4?style=flat-square&logo=microsoft-edge&logoColor=white) | 90+ | โœ… Fully Supported |
| ![Mobile](https://img.shields.io/badge/Mobile-iOS%2FAndroid-green?style=flat-square) | Latest | โœ… Optimized |

## โ™ฟ Accessibility

### WCAG 2.1 AA Compliance
- **Color Contrast** - All text meets 4.5:1 contrast ratio requirements
- **Keyboard Navigation** - Full functionality accessible via keyboard
- **Screen Readers** - Comprehensive ARIA labels and live regions
- **Focus Management** - Logical tab order and visible focus indicators
- **Semantic HTML** - Proper heading hierarchy and landmark regions

### Accessibility Features
```html


```

## ๐Ÿš€ Performance

### Optimization Metrics
- **First Contentful Paint** - < 1.5s
- **Largest Contentful Paint** - < 2.5s
- **Cumulative Layout Shift** - < 0.1
- **Time to Interactive** - < 3.5s

### Performance Features
- **Minimal Dependencies** - Zero external JavaScript libraries
- **Optimized Assets** - Compressed images and efficient font loading
- **Efficient DOM** - Minimal reflows and optimized event handling
- **CSS Optimization** - Custom properties and efficient selectors

## ๐Ÿงช Testing

### Quality Assurance
- **Cross-browser Testing** - Verified across all major browsers
- **Responsive Testing** - Tested on multiple device sizes
- **Accessibility Testing** - Screen reader and keyboard navigation verified
- **Performance Testing** - Lighthouse scores optimized
- **User Testing** - Validated user experience flows

### Test Coverage
- โœ… Form validation scenarios
- โœ… Navigation flow testing
- โœ… Responsive breakpoint verification
- โœ… Accessibility compliance checks
- โœ… Error handling validation

## ๐Ÿ”ฎ Future Enhancements

### Planned Features
- **Backend Integration** - API connectivity for real form submissions
- **Payment Processing** - Stripe/PayPal integration for actual transactions
- **User Accounts** - Registration and login functionality
- **Data Persistence** - Cloud storage for user preferences
- **Analytics** - User behavior tracking and optimization

### Technical Improvements
- **Progressive Web App** - Offline functionality and app-like experience
- **Advanced Animations** - Enhanced micro-interactions and transitions
- **Internationalization** - Multi-language support
- **Dark Mode** - Alternative color scheme implementation
- **Advanced Validation** - Server-side validation integration

## ๐Ÿ“š Learning Outcomes

### Technical Skills Developed
- **Modern JavaScript** - ES6+ features, class-based architecture, async programming
- **Advanced CSS** - Custom properties, responsive design, accessibility considerations
- **Form UX** - Multi-step flows, validation patterns, error handling
- **Accessibility** - WCAG compliance, screen reader optimization, keyboard navigation
- **Performance** - Optimization techniques, efficient DOM manipulation

### Professional Skills
- **Project Planning** - Requirements analysis, technical specification
- **Code Quality** - Clean code principles, documentation, testing
- **User Experience** - Design implementation, usability considerations
- **Problem Solving** - Debugging, optimization, cross-browser compatibility

### Development Guidelines
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## ๐Ÿ™ Acknowledgments

- **Frontend Mentor** - For providing the design challenge and community
- **Ubuntu Font Team** - For the beautiful typography
- **Web Accessibility Initiative** - For WCAG guidelines and best practices
- **MDN Contributors** - For comprehensive web development documentation

---

## ๐Ÿ‘ค Author

- Frontend Mentor - [Ayokanmi Adejola](https://www.frontendmentor.io/profile/Adejola-Ayokanmi)