Skip to content

An interactive and responsive article preview component with share features built with HTML, CSS, and JavaScript. Created as part of a Frontend Mentor challenge.

License

Notifications You must be signed in to change notification settings

CodingWithJiro/frontend-mentor-article-preview-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Article Preview Component

HTML5 CSS3 JavaScript Frontend Mentor Visual Studio Code Git GitHub Netlify PerfectPixel Image → Code Semantic HTML Accessible Responsive Layout Mobile First Dark Mode Dynamic Content Google Lighthouse

Netlify Status Status Learning Path Views

A Interactive and Responsive Shareable Article Preview From a Fictional Author

Mobile Preview (375x812) Desktop Preview (1440x960)
Mobile Desktop
Mobile Desktop

This project is a fully interactive article preview where users can share said article via Facebook, Twitter, or Pinterest, toggle between light and dark mode, and experience a responsive, accessible design across all screen sizes.

Created as part of the building challenges from Frontend Mentor.


Overview

The component is built with semantic HTML5, modern CSS, and vanilla JavaScript modules to handle dynamic behavior.

The main focus was creating an accessible and mobile-first layout with theme toggling and working social share links while also respecting user preferences.


Features

  • Responsive layout (mobile-first, scales up to desktop).
  • Light/dark theme toggle
  • Share to Facebook, Twitter, and Pinterest with pre-filled content
  • Made sure site still works in prefers-reduced-motion
  • Accessible interactive elements which uses ARIA attributes (aria-expanded, aria-label, aria-hidden)
  • Added a simple keyboard support (Escape key closes share links if opened)
  • Pixel-perfect implementation with PerfectPixel

What I Learned

  • I learned how to utlize more ARIA attributes in HTML5 for better accessibility
  • First time learning that I can't normally target ::after elements with JavaScript
  • Using matchMedia for reduced motion checks
  • Gained more experience in managing component state with ARIA attributes
  • Getting more comfortable in writing modular JavaScript (import/export) for cleaner code separation.
  • How to generate social share links dynamically for multiple platforms using encodeURIComponent() in JavaScript.

Tech Used

  • HTML5
  • CSS3
  • JavaScript
  • Git
  • GitHub
  • Netlify

Design Reference & Tools

  • JPG design image
  • PerfectPixel

How to Run

  1. Clone the repository
  2. Open index.html in your browser

Live Demo

Or you can check out the live website here


Performance Report

A Google Lighthouse audit was conducted on the final version of this project. You can view the full report here.


Author

Created by Elmar Chavez

Month/Year: August 2025

Journey: 5th month of learning frontend web development.

About

An interactive and responsive article preview component with share features built with HTML, CSS, and JavaScript. Created as part of a Frontend Mentor challenge.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published