Build a Calculator App in HTML, CSS & JavaScript 2022
HTML-код
- Опубликовано: 30 ноя 2022
- Learn how to build a calculator web app in html, css and javascript 2022!
Source code: github.com/TylerPottsDev/yt-j...
// JOIN THE DISCORD SERVER!
/ discord
// BECOME A MEMBER TO UNLOCK MORE CONTENT!
ruclips.net/user/tylerpottsjoin
// MY GEAR FOR CODING AND RUclips
Blue Yeti Microphone: amzn.to/3jr3l7T
Microphone Stand: amzn.to/35B9LMN
Chair: amzn.to/3dWds3F
Thunderbolt Dock: amzn.to/3osBF6u
Monitor: amzn.to/37I8KoR
Screenbar Light: amzn.to/3iFRS7w
All of these products I own and have tested!
// FOLLOW ME ON TWITTER
/ tyler_potts_
// INTERESTED IN GAME DEV?
Game development channel: / muddywolf
// CHECK OUT MY GAME
play.google.com/store/apps/de...
// DO THESE SIMPLE STEPS
LIKE, SUBSCRIBE & SHARE - Хобби
This is by far the best channel with great mini projects for getting better at coding. Tyler Potts is the best.
Great tutorial sir! 💚
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.
Awesome video and great sense of humour too
Thanks for sharing it really helps :-)
22:25 ~ js part
03:32 ~ Html Divs
06:07 ~ Css Start
Very useful. Thanks
remember to include this in your ValidateInput function to prevent users from entering multiple % sign.
if (value == "%" && last_input == "%") {
return false;
}
Very useful, video,, . , ❤. I enjoyed the logics, this is one of the best beginners project
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
i've come across this problem where user can input multiple decimal. i've tried to optimize the validateinput to
if( value == "." && last_input == "." || value == "." && input.lastIndexOf(operators)
Time stamps would have been so much helpful >>>
Thank you very much for your video. How can I save data to localstorage?
I have a few videos on localstorage on my channel! Hopefully they can help.
one thing i noticed is when a decimal is too large, the output goes a little off screen
1 ÷ 0
In,fin,ity
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.
Probaly bugs
when I opened the index htmp it didn't show me the numbers etc.. and when I recheck my code I did exactly the same things, can u help me know where I must've went wrong?
same here
@@Arebamasrura_z i think u should save the files in order to see changes!
How do I delete my account
13:58
I turned 3 minutes into 40 minutes 😂 and this vid is not for slow type people to make😅
20:06
what's ur vscode theme?
F
SynthWave '84
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('');
}
sry mate i cant understand ur code, can u explain it?
press option + ?get ➗