Build a Calculator App in HTML, CSS & JavaScript 2022

Build a Calculator App in HTML, CSS & JavaScript 2022

Tyler Potts

1 год назад

63,044 Просмотров

Learn how to build a calculator web app in html, css and javascript 2022!

Source code: https://github.com/TylerPottsDev/yt-js-calculator-2022

// JOIN THE DISCORD SERVER!
https://discord.gg/BYGkHuGWAe

// BECOME A MEMBER TO UNLOCK MORE CONTENT!
https://www.youtube.com/tylerpotts/join

// MY GEAR FOR CODING AND YOUTUBE
Blue Yeti Microphone: https://amzn.to/3jr3l7T
Microphone Stand: https://amzn.to/35B9LMN
Chair: https://amzn.to/3dWds3F
Thunderbolt Dock: https://amzn.to/3osBF6u
Monitor: https://amzn.to/37I8KoR
Screenbar Light: https://amzn.to/3iFRS7w

All of these products I own and have tested!

// FOLLOW ME ON TWITTER
https://twitter.com/tyler_potts_

// INTERESTED IN GAME DEV?
Game development channel: https://youtube.com/c/muddywolf

// CHECK OUT MY GAME
https://play.google.com/store/apps/details?id=com.TylerPottsDev.BananaToss

// DO THESE SIMPLE STEPS
LIKE, SUBSCRIBE & SHARE

Тэги:

#webdev #javascript #css #sass #scss #js #vuejs #vue #reactjs #website_development #website_design #app_dev #app #app_design #app_development #mobile_app #native #web_developer #app_developer #developer #programmer
Ссылки и html тэги не поддерживаются


Комментарии:

Welson
Welson - 12.11.2023 20:17

remember to include this in your ValidateInput function to prevent users from entering multiple % sign.

if (value == "%" && last_input == "%") {
return false;
}

Ответить
Welson
Welson - 12.11.2023 05:59

In case nobody noticed, if the first number is 0 then the calculation will be completely wrong, for example 021 + 2 will return 19 when it should be 23. Make sure to correct the typo in the "PerpareInput" function that he wrote then just replace the entire PrepareInput function with this

function PrepareInput(input) {
// Replace percentages with their decimal equivalent
let preparedInput = input.replace(/%/g, "/100");

// Split the input into individual tokens
let tokens = preparedInput.match(/(\d+\.\d+|\d+|\S)/g) || [];

// Process each token to remove leading zeros in numbers
for (let i = 0; i < tokens.length; i++) {
if (!isNaN(tokens[i]) && tokens[i][0] === '0' && tokens[i].length > 1 && tokens[i][1] !== '.') {
tokens[i] = tokens[i].replace(/^0+/, '');
}
}

return tokens.join('');
}

Ответить
S-Lomar
S-Lomar - 01.11.2023 14:57

💞💞💞💞💞💞💞💓💓💓💓💕💓💓💓💓💓💓💓💕💓💓💕💓💓💓💓💓💓💓💓💓💓💓💓💓 well done

Ответить
Kapuramani Soren
Kapuramani Soren - 29.09.2023 06:41

Thanks for sharing it really helps :-)

Ответить
Fatin Fuyad
Fatin Fuyad - 28.09.2023 03:30

Very useful, video,, . , ❤. I enjoyed the logics, this is one of the best beginners project

Ответить
kawieo Mto
kawieo Mto - 30.08.2023 12:45

Time stamps would have been so much helpful >>>

Ответить
Kuku Nase
Kuku Nase - 25.06.2023 22:50

Awesome video and great sense of humour too

Ответить
Saga Ibrahim
Saga Ibrahim - 21.06.2023 20:18

one thing i noticed is when a decimal is too large, the output goes a little off screen

Ответить
Muhamad Hamid
Muhamad Hamid - 26.05.2023 15:38

Use toLocaleString() function on input, it will separate the result number with comma

Ответить
Susana Fernandez
Susana Fernandez - 22.04.2023 05:39

it didn't work for me .. i mean the timer is not working ... neither in my local laptop nor in the server .. wonder why ... because i just downloaded the whole folder from github and tested it.

Ответить
splxvfx
splxvfx - 07.04.2023 19:12

for the css part, when i clicked ctrl+s to save it and i went to my html file thingy, i didnt see anything save

Ответить
Web Programming Tutorials Video for Biggners
Web Programming Tutorials Video for Biggners - 18.03.2023 19:13

Very useful. Thanks

Ответить
Евгений Малый
Евгений Малый - 07.03.2023 15:22

Thank you very much for your video. How can I save data to localstorage?

Ответить
Silvia
Silvia - 05.03.2023 08:28

just use live server in vs-Code to see live preview of your code .

Ответить
Codehal
Codehal - 10.02.2023 21:27

Great tutorial sir! 💚

Ответить
Lemuel Lacanlale
Lemuel Lacanlale - 12.01.2023 14:42

what's ur vscode theme?

Ответить
Lily
Lily - 05.01.2023 05:01

press option + ?get ➗

Ответить
Ayodeji Theo
Ayodeji Theo - 24.12.2022 07:45

This is by far the best channel with great mini projects for getting better at coding. Tyler Potts is the best.

Ответить
Jerry Zamostny
Jerry Zamostny - 01.12.2022 14:44

I've learned so much from this video and the todo list video! I had a question on how to store those tasks from your todo vid. Hopefully you got the email.

Ответить