https://github.com/all-my-frontend-mini-projects/pricing-component-with-toggle_frontend_project
Explore different pricing plans seamlessly with this interactive pricing component. Users can view the optimal layout for the component depending on their device's screen size and control the toggle between monthly and annual plans using both mouse/trackpad and keyboard. The challenge is completed using only HTML and CSS.
https://github.com/all-my-frontend-mini-projects/pricing-component-with-toggle_frontend_project
css design-to-website frontend-project html mern-stack nextjs nodejs reactjs responsive vanilla-javascript
Last synced: 12 months ago
JSON representation
Explore different pricing plans seamlessly with this interactive pricing component. Users can view the optimal layout for the component depending on their device's screen size and control the toggle between monthly and annual plans using both mouse/trackpad and keyboard. The challenge is completed using only HTML and CSS.
- Host: GitHub
- URL: https://github.com/all-my-frontend-mini-projects/pricing-component-with-toggle_frontend_project
- Owner: all-my-frontend-mini-projects
- License: bsd-3-clause
- Created: 2024-01-27T05:24:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T10:06:53.000Z (over 1 year ago)
- Last Synced: 2025-03-24T16:41:19.746Z (over 1 year ago)
- Topics: css, design-to-website, frontend-project, html, mern-stack, nextjs, nodejs, reactjs, responsive, vanilla-javascript
- Language: CSS
- Homepage: https://pricing-component-project.netlify.app/
- Size: 313 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pricing Component with Toggle
## Explore different pricing plans seamlessly with this interactive pricing component.
## Table of contents
- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screenshot](#screenshot)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)
- [Continued development](#continued-development)
- [Useful resources](#useful-resources)
- [Author](#author)
- [Acknowledgments](#acknowledgments)
## Overview
### The challenge
Explore different pricing plans seamlessly with this interactive pricing component. Users can view the optimal layout for the component depending on their device's screen size and control the toggle between monthly and annual plans using both mouse/trackpad and keyboard. The challenge is completed using only HTML and CSS.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
### Screenshot

### Links
- Solution URL: [GitHub Repository](https://github.com/SartHak-0-Sach/Pricing-component-with-toggle_frontend_project)
- Live Site URL: [Live Site](https://pricing-component-project.netlify.app/)
## My process
### Built with
- HTML5
- CSS3
You will find all the required assets in the `/design` folder. The assets are already optimized.
There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
### What I learned
In this project I got to learn so much when it comes to implementation of ideas into code as what approaches one feels could work might not work in real-time and might have bugs to it so all a developer can do in such situations is to remember what he/she was taught, follow best practices and prevent copying code from anywhere else and try debug it on your own in order to learn. Like following snippet took me hours to write because of some hidden bugs being encountered which was then later found out to be some typo in HTML document.
```js
const toggle = document.getElementById('pricing');
const anually = document.querySelectorAll('.anually');
const monthly = document.querySelectorAll('.monthly');
toggle.addEventListener('change', handleToggle);
function handleToggle(e) {
if (e.target.checked) {
anually.forEach(element => element.setAttribute('hidden', true));
monthly.forEach(element => element.removeAttribute('hidden'));
} else {
anually.forEach(element => element.removeAttribute('hidden'));
monthly.forEach(element => element.setAttribute('hidden', true));
}
}
```
### Continued development
The continuously learning journey of a programmer never ends. This project made me realize that there are many concepts that I need to work upon including fundamentals like flex-box and its properties, to more complex concepts like working with fetch and async await in javascript. These areas are some that I think I need to work more upon in the upcoming future as they highlight some of the most significant regions of web development that are important for every developer to know of.
These key points mentioned here will help me grow accountable and consistent towards improving at writing good quality code and be a successful full stack developer one day.
### Useful resources
- [Harkirat Singh course notes](https://github.com/SartHak-0-Sach/harkirat-singh-course_code_and_notes) - I have added notes of all lectures along with code and lecture insights of all weeks along with bonus lectures to help you all as much as I can.
- [My development code and notes](https://github.com/SartHak-0-Sach/cwh-web-dev-playlist_code_and_notes) - These are my notes that I made while working on my development skills in initial days and did these courses. Make sure to star the repository if you like it.β¨π«
- [MDN documentation hover state for CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) - This is an amazing article which helped me finally understand hover states. I'd recommend it to anyone still learning this concept.
## Author
Sarthak Sachdev
- Website - [Sarthak Sachdev](https://itsmesarthak.netlify.app/)
- LeetCode - [@sarthak_sachdev](https://leetcode.com/u/sarthak_sachdev/)
- Twitter - [@sarthak_sach69](https://www.twitter.com/sarthak_sach69)
## Acknowledgments
I feel like the solutions provided on the website and the continuous doubt solving by industry experts on discord for free is something that is unmatched by anyone else and need to be acknowledged for their efforts in improving me as a developer by suggesting the best practices in your respective tech stack.
## Got feedback for me?
I love receiving feedback! I am always looking to improve my code and take up new innovative ideas to work upon. So if you have anything you'd like to mention, please email 'hi' at saarsaach30[at]gmail[dot]com.
If you liked this project make sure to spread the word and share it with all your friends.
**Happy coding!** βΊοΈπ