An open API service indexing awesome lists of open source software.

https://github.com/harisdev-netizen/stats-preview-card

This is a solution to the "Stats Preview Card Component" challenge on Frontend Mentor.
https://github.com/harisdev-netizen/stats-preview-card

css css-flexbox frontend-mentor frontendmentor-challenge html-css-javascript html5

Last synced: 4 months ago
JSON representation

This is a solution to the "Stats Preview Card Component" challenge on Frontend Mentor.

Awesome Lists containing this project

README

        

# Frontend Mentor - Stats preview card component

![Design preview for the Stats preview card component coding challenge](./design/desktop-preview.jpg)

## Welcome! 👋

Thanks for checking out this front-end coding challenge.

This is a solution to the [Stats preview card component](https://www.frontendmentor.io/challenges/stats-preview-card-component-8JqbgoU62). Frontend Mentor challenges help you improve frontend coding skills by building realistic projects.

## Table of Contents

- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screens](#screens)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)

## Overview

### The challenge

Your users should be able to:

- View the optimal layout for the component depending on their device's screen size

### Screens

#### Desktop Preview
![Screenshot](./assets/images/Desktop%20Preview.png)

#### Mobile Preview
![Screenshot](./assets/images/Mobile%20Preview.png)

### Links

- Solution URL: [GitHub Repository](https://github.com/harisdev-netizen/stats-preview-card)
- Live Site URL: [Live Preview](https://community-subscription.netlify.app/)

## My process

### Built with

- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Responsive design with media queries

### What I learned

1. **Google Fonts Setup:**
Successfully integrated Inter and Lexend Deca fonts from Google using `@import`, enhancing the typography's style and readability across the design.

2. **Custom CSS Variables:**
Created reusable color and typography variables using `:root` for primary, secondary, accent, and text colors, along with font-family variables. This allowed for easier customization and theme management.

3. **Flexbox for Layout Structure:**
Utilized Flexbox in the `.insights-section` and `.content-wrapper` classes to easily align and distribute content both horizontally and vertically. This approach helped achieve a clean, centered layout across different viewports.

4. **Typography Styling:**
Applied various typography settings, such as font-weight and line-height, using the imported Inter and Lexend Deca fonts to create visual hierarchy, particularly for headings, paragraphs, and stats.

5. **Image Overlay:**
Implemented a semi-transparent purple overlay on the image using `::after`.

6. **Opacity Adjustments:**
Applied different levels of opacity to text and backgrounds, such as setting `75%` opacity for detailed paragraphs and the image overlay, contributing to a balanced and modern visual hierarchy.

7. **Spacing and Gaps:**
Managed consistent spacing using margin and gap properties, particularly in the `.stats` section, providing enough breathing space between elements and improving readability.

**Have fun building!** 🚀