|
1 |
| -# Frontend Mentor - Calculator app |
| 1 | +# Frontend Mentor - Calculator app solution |
2 | 2 |
|
3 |
| - |
| 3 | +This is a solution to the [Calculator app challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/calculator-app-9lteq5N29). Frontend Mentor challenges help you improve your coding skills by building realistic projects. |
4 | 4 |
|
5 |
| -## Welcome! 👋 |
| 5 | +## Table of contents |
6 | 6 |
|
7 |
| -Thanks for checking out this front-end coding challenge. |
| 7 | +- [Overview](#overview) |
| 8 | + - [The challenge](#the-challenge) |
| 9 | + - [Screenshot](#screenshot) |
| 10 | + - [Links](#links) |
| 11 | +- [My process](#my-process) |
| 12 | + - [Built with](#built-with) |
| 13 | + - [What I learned](#what-i-learned) |
| 14 | + - [Continued development](#continued-development) |
| 15 | + - [Useful resources](#useful-resources) |
| 16 | +- [Author](#author) |
8 | 17 |
|
9 |
| -[Frontend Mentor](https://www.frontendmentor.io) challenges help you improve your coding skills by building realistic projects. |
| 18 | +## Overview |
10 | 19 |
|
11 |
| -**To do this challenge, you need a good understanding of HTML, CSS and JavaScript.** |
| 20 | +### The challenge |
12 | 21 |
|
13 |
| -## The challenge |
14 |
| - |
15 |
| -Your challenge is to build out this calculator app and get it looking as close to the design as possible. |
16 |
| - |
17 |
| -You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go. |
18 |
| - |
19 |
| -Your users should be able to: |
| 22 | +Users should be able to: |
20 | 23 |
|
21 | 24 | - See the size of the elements adjust based on their device's screen size
|
22 | 25 | - Perform mathematical operations like addition, subtraction, multiplication, and division
|
23 | 26 | - Adjust the color theme based on their preference
|
24 | 27 | - **Bonus**: Have their initial theme preference checked using `prefers-color-scheme` and have any additional changes saved in the browser
|
25 | 28 |
|
26 |
| -Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel. |
27 |
| - |
28 |
| -## Where to find everything |
29 |
| - |
30 |
| -Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design. |
31 |
| - |
32 |
| -The designs are in JPG static format. Using JPGs will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`. |
33 |
| - |
34 |
| -If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can [subscribe as a PRO member](https://www.frontendmentor.io/pro). |
35 |
| - |
36 |
| -You will find all the required assets in the `/images` folder. The assets are already optimized. |
37 |
| - |
38 |
| -There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts. |
39 |
| - |
40 |
| -## Building your project |
41 |
| - |
42 |
| -Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps: |
43 |
| - |
44 |
| -1. Initialize your project as a public repository on [GitHub](https://github.com/). Creating a repo will make it easier to share your code with the community if you need help. If you're not sure how to do this, [have a read-through of this Try Git resource](https://try.github.io/). |
45 |
| -2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below. |
46 |
| -3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles. |
47 |
| -4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content. |
48 |
| -5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`. |
49 |
| -6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on. |
50 |
| - |
51 |
| -## Deploying your project |
52 |
| - |
53 |
| -As mentioned above, there are many ways to host your project for free. Our recommend hosts are: |
54 |
| - |
55 |
| -- [GitHub Pages](https://pages.github.com/) |
56 |
| -- [Vercel](https://vercel.com/) |
57 |
| -- [Netlify](https://www.netlify.com/) |
| 29 | +### Screenshot |
58 | 30 |
|
59 |
| -You can host your site using one of these solutions or any of our other trusted providers. [Read more about our recommended and trusted hosts](https://medium.com/frontend-mentor/frontend-mentor-trusted-hosting-providers-bf000dfebe). |
| 31 | + |
60 | 32 |
|
61 |
| -## Create a custom `README.md` |
| 33 | +### Links |
62 | 34 |
|
63 |
| -We strongly recommend overwriting this `README.md` with a custom one. We've provided a template inside the [`README-template.md`](./README-template.md) file in this starter code. |
| 35 | +- Solution URL: [GitHub page](https://github.com/gpend/calc-app) |
| 36 | +- Live Site URL: [live site](https://gpend.github.io/calc-app/) |
64 | 37 |
|
65 |
| -The template provides a guide for what to add. A custom `README` will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like. |
| 38 | +## My process |
66 | 39 |
|
67 |
| -Once you've added your information to the template, delete this file and rename the `README-template.md` file to `README.md`. That will make it show up as your repository's README file. |
| 40 | +### Built with |
68 | 41 |
|
69 |
| -## Submitting your solution |
| 42 | +- Semantic HTML5 markup |
| 43 | +- CSS custom properties |
| 44 | +- Flexbox |
| 45 | +- Mobile-first workflow |
| 46 | +- [jquery](https://jquery.com/) - JS library |
70 | 47 |
|
71 |
| -Submit your solution on the platform for the rest of the community to see. Follow our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) for tips on how to do this. |
| 48 | +### What I learned |
72 | 49 |
|
73 |
| -Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community. |
| 50 | +- css variables |
| 51 | +- css transitions and animation |
| 52 | +- adding multiple listeners |
74 | 53 |
|
75 |
| -## Sharing your solution |
| 54 | +### Code I'm proud of |
76 | 55 |
|
77 |
| -There are multiple places you can share your solution: |
| 56 | +```js |
| 57 | +pushables.forEach(btn => { |
| 58 | + btn.addEventListener('click', (event) => { |
| 59 | + calculate( event.target.innerText ); |
| 60 | + }) |
| 61 | +}) |
| 62 | +``` |
78 | 63 |
|
79 |
| -1. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack). |
80 |
| -2. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor**, including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around. |
81 |
| -3. Share your solution on other social channels like LinkedIn. |
82 |
| -4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you've learned. Great platforms to write on are [dev.to](https://dev.to/), [Hashnode](https://hashnode.com/), and [CodeNewbie](https://community.codenewbie.org/). |
| 64 | +### Continued development |
83 | 65 |
|
84 |
| -We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback. |
| 66 | +This was a fun challenge and a good introduction to some interesting concepts that I plan to work on and refine in the future. |
85 | 67 |
|
86 |
| -The more specific you are with your questions the more likely it is that another member of the community will give you feedback. |
| 68 | +- css animations |
| 69 | +- draggable elements |
| 70 | +- multiple themes |
87 | 71 |
|
88 |
| -## Got feedback for us? |
| 72 | +### Useful resources |
89 | 73 |
|
90 |
| -We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io. |
| 74 | +- [Building a Magical 3D Button](https://www.joshwcomeau.com/animation/3d-button/) - This awesome tutorial helped me build the buttons. |
| 75 | +- [16 segment font](https://www.dafont.com/16-segments.font) - This is a must have font for a calculator of this caliber. |
91 | 76 |
|
92 |
| -This challenge is completely free. Please share it with anyone who will find it useful for practice. |
| 77 | +## Author |
93 | 78 |
|
94 |
| -**Have fun building!** 🚀 |
| 79 | +- Greg Pendleton - [gpendleton.me](https://gpendleton.me) |
| 80 | +- Frontend Mentor - [@gpend](https://www.frontendmentor.io/profile/gpend) |
| 81 | +- Github - [gpend](https://github.com/gpend) |
0 commit comments