branalex94 / tip-calculator

A frontendmentor.io challenge to build a tip calculator using React and Vitejs. Responsive and mobile-first workflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - Tip calculator app solution

This is a solution to the Tip calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

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
  • Calculate the correct tip and total cost of the bill per person

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • React - JS library
  • Vite.js - JavaScript bundler

What I learned

I'm really proud of this implementation of SVG icons as components. It made it kind of easy to apply them on the component.

const ICONS = {
  dollar: <Dollar />,
  person: <Person />,
};

<div className="input__icon-container">{ICONS[icon]}</div>;

Continued development

I'm planning on continuosly working on writing cleaner and more optimal code.

Useful resources

  • Css Tricks - This resource helped me remember the correct functionality of flexbox.

Author

About

A frontendmentor.io challenge to build a tip calculator using React and Vitejs. Responsive and mobile-first workflow.


Languages

Language:JavaScript 68.9%Language:CSS 28.5%Language:HTML 2.6%