Giter VIP home page Giter VIP logo

product-preview-card-component's Introduction

Frontend Mentor - Product preview card component

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

Table of contents

Overview

As the second mini project on Frontend Mentor, it was a good challenge to learn more on CSS! I'm so excited to share it with you.

The challenge

The challenge is to build out this product preview card component and get it looking as close to the design as possible.

As well as making it responsive for small phones, I tried to make it good looking for large screens as well. The page is based on mobile-first workflow and it is responsive for different screen sizes. Another challenge was keeping the HTML semantic, and the CSS clean.

Screenshot

Mobile Preview Desktop Preview

Links

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Font Awesome - For shopping cart icon

What I learned

Using Font Awesome icons inside the button:

<button class="add-button">
  <i class="fa-solid fa-cart-shopping"></i> Add to Cart
</button>

Switching images based on the device screen size:

<picture>
  <source
    media="(min-width: 768px)"
    srcset="./images/image-product-desktop.jpg"
  />
  <img
    class="image"
    src="./images/image-product-mobile.jpg"
    alt="product image"
    width="340"
    height="240"
  />
</picture>

Continued development

Since I learned a lot on this project, I'm looking forward to trying more challenges from Frontend Mentor.

Useful resources

  • Font Awesome - Font Awesome is the internet's icon library.
  • Google Fonts - Google Fonts is a library of more than 1,400 open source font families and APIs for convenient use via CSS and Android.
  • Device Frame - Generate beautiful 3D device scenes to showcase your app UI.

Author

product-preview-card-component's People

Contributors

ohsorrow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.