Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmikaia/interactive-pricing-component
https://github.com/dmikaia/interactive-pricing-component
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dmikaia/interactive-pricing-component
- Owner: DMikaia
- Created: 2024-03-30T06:28:29.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-30T15:43:12.000Z (9 months ago)
- Last Synced: 2024-11-03T07:43:17.693Z (2 months ago)
- Language: TypeScript
- Homepage: https://interactive-pricing-component-blush.vercel.app
- Size: 251 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Frontend Mentor - Interactive pricing component solution
This is a solution to the [Interactive pricing component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/interactive-pricing-component-t0m8PIyY8). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
## 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)
- [Author](#author)## Overview
### The challenge
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Use the slider and toggle to see prices for different page view numbers### Screenshot
![Desktop-version](./public/screenshots/Desktop-version.png)
![Mobile-version](./public/screenshots/Mobile-version.png)
### Links
- Live Site URL: [Add live site URL here](https://dm-interactive-pricing-component.vercel.app/)
## My process
### Built with
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- [Next.js](https://nextjs.org/) - React framework### What I learned
This is how I wrote the money value change depending on the state of the input range, see below:
```js
const [money, setMoney] = useState < string > "16.00";const changeMoneyValue = (e: any) => {
let value = parseFloat(e.target.value);if (value % 1 === 0) {
setMoney(String(value) + ".00");
} else {
setMoney(String(value));
}
};
```## Author
- Frontend Mentor - [@DMikaia](https://www.frontendmentor.io/profile/DMikaia)