A Frontend Mentor challenge, built as a practice project to sharpen frontend fundamentals — semantic HTML, modern CSS, and vanilla JS.
Build a responsive URL shortening landing page that integrates a third-party API to shorten links in real time. Users should be able to:
- Shorten any valid URL using the input form
- See a list of shortened links from their current session
- Copy a shortened link to their clipboard in one click
- See error states when submitting an empty or invalid URL
- View an optimal layout on any screen size
- See hover and focus states on all interactive elements
- Semantic HTML5 — landmark elements, proper heading hierarchy, ARIA attributes throughout
- Modern CSS — no preprocessor; native custom properties, nesting,
clamp(),min(),calc(), and@mediarange syntax - Vanilla JavaScript — no frameworks or libraries
- URLVanish API — free URL shortening, no API key required
Every decision started with accessibility rather than bolting it on at the end:
- Semantic landmarks (
<header>,<nav>,<main>,<section>,<footer>) so screen reader users can jump between regions - Logical heading hierarchy —
h1→h2→h3with no skipped levels - The mobile hamburger
<button>managesaria-expandedandaria-controls, and the nav is connected viaid - The URL input uses
aria-describedbywired to the error message paragraph (role="alert",aria-live="polite"), so validation errors announce automatically without focus moving - Decorative images carry
alt=""andaria-hidden="true"so they're fully skipped by assistive technology - Social links carry descriptive
aria-labeltext since their icon images are hidden - Copy buttons include the full short URL in their
aria-labelso each one is distinguishable when there are multiple results
SCSS has been the default for years, but modern CSS handles everything this project needs natively:
- Custom properties for the full design token system (colors, spacing, radii, transitions) — one place to change anything
- Native nesting for BEM block/element relationships without a build step
clamp()for fluid typography that scales between breakpoints without extra media queriesmin()for the container width (width: min(69.375rem, 100% - 3rem)) replacing the old max-width + padding pattern@media (width >= 768px)— modern range syntax instead ofmin-width- Mobile-first — base styles are mobile, desktop is additive
The open/close animation is CSS-only, driven entirely by the [aria-expanded="true"] attribute selector — no extra JS class toggling needed. The nav fade uses opacity + visibility rather than display: none → display: flex, which allows a proper CSS transition on both open and close.
The original challenge suggested cleanuri.com, but it doesn't send CORS headers so browser fetch() calls are blocked. After researching alternatives, URLVanish was the best fit — free, no key needed, and genuinely CORS-friendly.
No build step required — this is plain HTML, CSS, and JS.
git clone https://github.com/brittgalloway/urlAPI.git
cd urlAPIThen open index.html in your browser directly, or use a local dev server:
# VS Code Live Server extension (recommended)
# or with npx:
npx serve .urlAPI/
├── images/
│ ├── bg-boost-desktop.svg
│ ├── bg-boost-mobile.svg
│ ├── bg-shorten-desktop.svg
│ ├── bg-shorten-mobile.svg
│ ├── icon-brand-recognition.svg
│ ├── icon-detailed-records.svg
│ ├── icon-fully-customizable.svg
│ ├── icon-facebook.svg
│ ├── icon-twitter.svg
│ ├── icon-pinterest.svg
│ ├── icon-instagram.svg
│ ├── illustration-working.svg
│ ├── favicon-32x32.png
│ └── logo.svg
├── index.html
├── style.css
├── index.js
└── README.md
- Challenge by Frontend Mentor
- Coded by Brittney Galloway