Skip to content

The "Pricing Component with Toggle" offers a versatile and user-friendly solution for displaying different pricing tiers. With an intuitive toggle feature, users can seamlessly explore additional details, making it a dynamic and engaging element for websites or applications.

Notifications You must be signed in to change notification settings

amrmabdelazeem/pricing-component-with-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Pricing component with toggle solution

This is a solution to the Pricing component with toggle challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

Design preview for the Pricing component with toggle coding challenge

The challenge

Users should be able to:

  • View the optimal layout for the component depending on their device's screen size
  • Control the toggle with both their mouse/trackpad and their keyboard
  • Bonus: Complete the challenge with just HTML and CSS

Screenshot

  • Mobile: mobile

  • Laptop: laptop

  • Active states: active-states

Links

My process

  • Setup local environment for the project.
  • Create the HTML structure with semantic HTML tags, including sections for each pricing tier and the toggle button for plans.
  • Apply styles to the HTML elements, ensuring a visually appealing layout and responsiveness. Use CSS to hide the details of the toggled sections initially.
  • Write JavaScript code to handle the toggle functionality. With the help of jQuery to detect when a user clicks on a toggle button, and dynamically show or hide the corresponding details.
  • Use media queries for different devices to ensure responsive design.
  • Start deploying to live.

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • Media Queries
  • Javascript
  • Jquery
  • DOM

What I learned

I used two background images in the same time and managed to resize and align both differently:

body{
    background-image: url("../images/bg-top.svg"), url("../images/bg-bottom.svg");
    background-size: 25%, 25%;
    background-position: top right, bottom left;
}

Useful resources

Author

About

The "Pricing Component with Toggle" offers a versatile and user-friendly solution for displaying different pricing tiers. With an intuitive toggle feature, users can seamlessly explore additional details, making it a dynamic and engaging element for websites or applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published