Skip to content

User9511/frontend-mentor-product-preview-card-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Links

Frontend Mentor - Product preview card component solution

This is a solution to the Product preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Screenshot

My process

I began by opening the original design in Adobe Photoshop. I then broke the design down into seperate components using yellow / blue boxes.

This visual aid makees it easy for me to re-create the desktop / mobile design layout in CSS Grid using grid-template-areas.

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Javacsript

What I learned

This was my first time using Javascript in one of my project. I wanted to add an animation to the cart-icon when the Add to cart button was clicked.

I researched online and found that this could be achieved by adding an onclick toggle class:

const checkoutButton = document.getElementById("btn-id")
const cartLogo = document.getElementById("cart-id")

checkoutButton.onclick = function() {
  cartLogo.classList.toggle('rotate');
}

Continued development

I will continue to work on using CSS Grid to control design layouts across multiple devices. I'm also going to work on incorporating more basic Javascript to add some interactivity into my designs.

Useful resources

Author