This is a solution to the Interactive rating component challenge on Frontend Mentor.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Select and submit a number rating
- See the "Thank you" card state after submitting a rating
- See animated transition between states
- React - JS library
- Vite - Build tool
- Framer Motion - Animation library
- CSS Modules
- Mobile-first workflow
- Semantic HTML5
- CSS Custom Properties
- Flexbox
- Implementing mobile-first responsive design:
.card {
/* Mobile styles first */
padding: var(--spacing-16);
/* Tablet and up */
@media (min-width: 768px) {
padding: var(--spacing-32);
}
}
- Adding animations with Framer Motion:
<AnimatePresence mode='wait'>
<motion.div
variants={cardVariants}
initial='initial'
animate='animate'
exit='exit'
>
{/* Card content */}
</motion.div>
</AnimatePresence>