A modern, responsive frontend for the Advanced URL Shortener, built in 4 progressive phases using HTML, CSS, and JavaScript.
| Phase | Feature | Status |
|---|---|---|
| Phase 1 | Landing Page (Hero + Features) | β Complete |
| Phase 2 | Shorten URL Form + Result Display | β Complete |
| Phase 3 | Analytics Dashboard UI | β Complete |
| Phase 4 | URL History + QR Code Display | β Complete |
File: frontend/index.html + frontend/css/style.css
- Hero section β headline, subheadline, CTA button ("Shorten a URL")
- Features section β 6 feature cards (Fast, Secure, Analytics, Custom Alias, QR Code, Expiry)
- How It Works β 3-step visual flow
- Footer β links and branding
- Dark glassmorphism theme
- Gradient purple/blue palette
- Smooth scroll animations
- Fully responsive (mobile + desktop)
File: frontend/shorten.html + frontend/js/shorten.js
- Input form β long URL field + optional custom alias + TTL selector
- Shorten button β with loading spinner
- Result card β shows generated short URL with:
- One-click copy button
- Share button
- Link to QR code
- Validation β URL format check before submit
- Error handling β rate limit / alias taken messages
Uses localStorage to simulate the C++ backend (Base62 encoding in JS).
File: frontend/analytics.html + frontend/js/analytics.js
- Stats cards β Total URLs, Total Clicks, Top URL, Cache Hit Rate
- Top URLs table β sortable by clicks, with short code + destination
- Click trend chart β bar chart using Canvas API (no external libs)
- Live refresh β auto-updates every 5 seconds
File: frontend/history.html + frontend/js/history.js
- History table β all shortened URLs with creation time, TTL, click count
- Expiry indicator β green (active) / red (expired) badge
- QR Code modal β click any URL to see its QR code (generated via Canvas)
- Delete button β remove URLs from history
- Search/filter β filter history by short code or destination
frontend/
βββ index.html # Phase 1 β Landing page
βββ shorten.html # Phase 2 β URL shortener form
βββ analytics.html # Phase 3 β Analytics dashboard
βββ history.html # Phase 4 β URL history + QR
βββ css/
β βββ style.css # Shared design system
βββ js/
βββ shorten.js # Phase 2 logic
βββ analytics.js # Phase 3 logic
βββ history.js # Phase 4 logic
Simply open any HTML file in a browser β no build step required:
# Open landing page
start frontend/index.html
# Or use a local server for best experience
npx serve frontend/| Token | Value |
|---|---|
| Primary | #7c3aed (purple) |
| Accent | #06b6d4 (cyan) |
| Background | #0f0f1a (dark navy) |
| Surface | rgba(255,255,255,0.05) (glass) |
| Font | Inter (Google Fonts) |
| Border radius | 12px |
| Animation | 0.3s ease transitions |