Skip to content

seanbuckle/interactive-rating-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Rating | Dynamic Feedback Component ⭐️

A high-performance, responsive feedback component featuring a seamless state transition between rating selection and "Thank You" confirmation. Built with a focus on Type-Safe DOM manipulation and modular SCSS.

📸 Preview

Interactive rating card featuring a dark theme, circular numeric selectors, and a vibrant orange submit button.

🚀 Technical Highlights

  • Logic Engine: TypeScript ensures strict type-safety for DOM element selection and event handling.
  • State Management: Dynamic UI updates handled via JavaScript/TypeScript to transition between the rating and success states without a page reload.
  • Styling Architecture: Modular SCSS following the BEM (Block Element Modifier) methodology for component encapsulation.
  • Modern CSS: Utilises CSS Grid for circular button alignment and Flexbox for centring layout distribution.
  • Accessibility: ARIA-compliant interactive states and high-contrast hover/active feedback for improved user experience.

🏗️ Architectural Overview

1. Type-Safe State Transitions

Unlike static components, this interactive piece relies on robust logic to handle user input:

  • Dynamic DOM Swapping: Implemented a logic layer that listens for submission, captures the selected value, and injects it into the "Thank You" state while toggling component visibility.
  • Input Validation: TypeScript ensures the submission handler only executes when a valid rating has been selected, preventing empty or erroneous states.
  • Event Delegation: Optimised event listeners to handle rating selections with minimal performance overhead.

2. Scalable Style System (BEM + SCSS)

The visual architecture is engineered for integration and performance:

  • BEM Methodology: Encapsulates styles within the .rating-card block, preventing style "leakage" when used within larger applications.
  • Hover & Active States: Custom-engineered transitions for the rating circles, providing clear visual affordance and immediate feedback to user interaction.
  • Mobile-First Responsiveness: Utilises a fluid layout approach that gracefully scales the card dimensions and typography for mobile and desktop viewports.

3. Structural Precision & UX

  • Layout Engine: Leveraging CSS Grid to manage the 1-through-5 rating scale, ensuring perfect circular geometry and spacing.
  • Contrast & Legibility: Designed to meet WCAG standards for text and interactive element contrast, ensuring usability across various lighting conditions.

🛠️ Built With

TYPESCRIPT SASS

🔗 Live Implementation

🏁 Installation & Development

To run this project locally:

  1. Clone the repository:
git clone https://github.com/seanbuckle/interactive-rating-component.git
  1. Navigate to the directory:
cd interactive-rating-component
  1. Open the project: Simply open index.html in your preferred browser.

👨‍💻 Author

Sean Buckle

Frontend Mentor Profile LinkedIn

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


Note: This project was built as a solution to a Frontend Mentor challenge.

About

A type-safe, interactive rating component built with TypeScript, SCSS (BEM), and Semantic HTML5. Features dynamic state transitions, mobile-first responsiveness, and full WCAG accessibility compliance.

Topics

Resources

License

Stars

Watchers

Forks

Contributors