Creating an Alarm App: Exercise 6 | JavaScript Tutorial In Hindi #52

  Рет қаралды 29,856

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 54
@tanbirhossain7
@tanbirhossain7 5 жыл бұрын
This is what we want on KZbin...thanks for doing this. Great work.!
@codingbuddy4876
@codingbuddy4876 4 жыл бұрын
😊
@aakranga7
@aakranga7 4 жыл бұрын
Alarm Clock Exercise solved by validating it with Regular Expression. Thanks Harry Bhai
@Satish_Kumar_Gupta
@Satish_Kumar_Gupta 4 жыл бұрын
Alarm clock exercise 6 solved. Also implemented with regex. Thank you...:)
@haseebkhan1942
@haseebkhan1942 3 жыл бұрын
Exercise Solution: Note this ex divided into 2 parts One is HTML and Second is JS HTML: SET ALARM Enter TIME Choose... Seconds Minutes Hours SET ########################################### JS: /* Name: Haseeb Khan Date: 06-09-2021 Tutorial No: #52 Exercise: 6 Time Stamp: 3:00/6:14 */ //Creating an Alarm App: Exercise 6 console.log(`I'm khan`); //Problem Statement:- // The task you have to do is to create an alarm clock in JavaScript(Use your creativity). The Alarm app should allow the user to set the alarm for a certain time. //Target Alarm SETS Button to add Event Listner let alarmBtn = document.getElementById('alarmBtn'); //Function to executes when the event is call let getTimefromDropDown = () => { //Target all inputs and types let inputVal1 = document.getElementById('inputVal1'); let inputVal2 = document.getElementById('inputVal2'); let dropDownMenu = document.getElementById('dropDownMenu'); //Sets Audio let alarmSound = new Audio('text-sound/alarm.wav'); function selectDropDownValues() { let selectedOpt = dropDownMenu.options[dropDownMenu.selectedIndex].value; return selectedOpt; } //For Seconds if (selectDropDownValues() == 'Seconds') { //Convert into number and multiply by 1000 to convert into miliseconds let secondsValues = Number((inputVal1.value +'.'+ inputVal2.value)*1000); //after the given time this will execute setTimeout(() => { alarmSound.play(); }, secondsValues); } //For Minutes else if (selectDropDownValues() == 'Minutes') { //Convert into number and multiply by 60000 to convert into miliseconds let minutesValues = Number((inputVal1.value +'.'+ inputVal2.value)*60000); //after the given time this will execute setTimeout(() => { alarmSound.play(); }, minutesValues); } //For Hours else if (selectDropDownValues() == 'Hours') { //Convert into number and multiply by (Scientific e notation value : 3.6e+6) to convert into miliseconds let hoursValues = Number((inputVal1.value +'.'+ inputVal2.value)*3.6e+6); //after the given time this will execute setTimeout(() => { alarmSound.play(); }, hoursValues); } //Incase all false else { console.log('Please select right option') } } //Add Event Listner on SET Button alarmBtn.addEventListener('click', getTimefromDropDown)
@harshkhilawala7830
@harshkhilawala7830 5 жыл бұрын
Respected Harry Sir, This is a request from your student that we need a course for "Web Development And Web Designing"...We truly love you Sir and appreciate your hard work.
@gamingretro343
@gamingretro343 3 жыл бұрын
Khatarnak awaz hai
@av1shek_ps
@av1shek_ps 5 жыл бұрын
HTML File code Alarm Clock button{ background-color: blue; color: white; font-weight: 700; box-shadow: 0px 0px 8px red; margin: 3px; padding: 10px; size: 15px; } h1{ color :hotpink; box-shadow: 0px 0px 8px yellow; } Alarm Clock Please choose time. Java script code console.log('Now you are online.'); let body = document.querySelector('body'); var audio = new Audio('Abhi se teri.mp3'); let timebox = document.createElement('input'); timebox.setAttribute('type','time'); body.appendChild(timebox); let btn = document.createElement('button'); btn.innerText = 'Set Alarm'; body.appendChild(btn); let pauseBtn = document.createElement('button'); pauseBtn.innerText = 'Dismiss'; body.appendChild(pauseBtn); var time; btn.addEventListener('click',fun); pauseBtn.addEventListener('click',()=>{audio.pause();}) function fun() {time = timebox.value; // console.log(time,typeof time); // for(key in time) // {console.log(time[key],key);} let currentTime = new Date(); let hours = currentTime.getHours(); let min = currentTime.getMinutes(); let sec = currentTime.getSeconds(); console.log(hours,typeof hours); console.log(min,typeof min); console.log(sec,typeof sec); let alarmHour = Number(time[0]+time[1]); let alarmMinute = Number(time[3]+time[4]); console.log(alarmHour,typeof alarmHour); console.log(alarmMinute,typeof alarmMinute); var delay = 0; if(alarmHour>hours) { if(alarmMinute >= min) delay = (alarmHour - hours)*3600 + (alarmMinute - min)*60; else delay = (alarmHour - hours - 1)*3600 + (alarmMinute*60) + (60 - min)*60; console.log(delay) } else if(alarmHour == hours) { if(alarmMinute >= min) { delay = (alarmMinute - min)*60; } else { delay = 86400 - (min - alarmMinute)*60; } console.log(delay); } else { if(alarmMinute >= min) delay = 86400 -((hours - alarmHour - 1)*3600 + (min*60) + (60 - alarmMinute)*60); else{ delay = 86400 - ((hours - alarmHour)*3600 + (min - alarmMinute)*60) } console.log(delay); } setTimeout(()=>{ audio.play(); },delay*1000); }
@amankhan-lx9dg
@amankhan-lx9dg 4 жыл бұрын
node js per playlist lao Harry bhai or react per bi we want ❤️
@karthikjoshi6386
@karthikjoshi6386 3 жыл бұрын
I used regex for alarm ie using regular expression I compare current date and given date by user if both values are same I play the audio using test() function of regex pls confirm this way is correct or not
@sandeeppandey6493
@sandeeppandey6493 5 жыл бұрын
Aap ko jaan ker kushi hogi bhai ki mane khud ki color theme banai hai vs code me.
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
oh that's great, can I see your code
@i_am_shakaib
@i_am_shakaib 5 жыл бұрын
Harry bhi love you.
@AaravDecodes
@AaravDecodes 5 жыл бұрын
Sir data structure please...college me kuch samjh nhi aa rha
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
ap reema thareja ki book se start kro usse apko basics sab clear ho jayega. Or agar programming ka shok h to books padhne ki aadat dal lo. Bina book ke aap kisi bhi chiz ko sirf top view dekh sakte h but deep knowledge ke liye books padhna hi hota h kisi bhi field me ye general criteria h. DS & Algo ko master krne me saalo lgte h but basics 3-4 months me kar sakte ho.
@AaravDecodes
@AaravDecodes 5 жыл бұрын
@@rednoodlestudio9973 thanks sir
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
@@AaravDecodes welcome bro)
@AaravDecodes
@AaravDecodes 5 жыл бұрын
@@rednoodlestudio9973 please tell best book for python also
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
@@AaravDecodes you can start with python crash course. for learning syntax and stuff you can look up python cheat sheets on google. hope that helps
@princesukhala7106
@princesukhala7106 2 жыл бұрын
done done again
@numan.expert564
@numan.expert564 5 жыл бұрын
Nice sir g
@ranaumar8208
@ranaumar8208 5 жыл бұрын
Sir apna server bazaar se buy karke usa website se connect kaise karein please make video
@ripusudansoni3366
@ripusudansoni3366 5 жыл бұрын
Harry sir please make videos on Android studio please I humbly request to you sir.
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
before diving into android studio you should have a clear cut understanding of android stack since in order to create apps that actually do something meaningful you need to know how kernel works. Or if you just wanna create apps that display information like whatsapp status etc then you can jump directly into android studio else have a clear concept of android stack and then probably start development.
@ashutosh-pandit
@ashutosh-pandit 5 жыл бұрын
Please make full series of C++
@RohanDasRD
@RohanDasRD 5 жыл бұрын
WILL Try to solve the exercise bhai
@Saifalipalla
@Saifalipalla 5 жыл бұрын
Bhai tu javascrip ke bhot sare videos dalta h to acchi language kons i h javascript or pythone. Plz reply
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
bro language is just a medium. Aap kya krna chahte ho uspe depend krta h. baki sare languages me logic same hi lgta bas syntax thoda alag hota matlab ki likhne ka tarika. python ek multipurpose language h usse ap desktop application, web application, data science, ai, ml kuch bhi kar sakte h. JavaScript web development me jyada use hoti h both backend and frontend. Bas fark ye hota h ke python ke liye machine learning vgerah ke alag alag frameworks available h to kaam asan ho jata h.
@Saifalipalla
@Saifalipalla 5 жыл бұрын
@@rednoodlestudio9973 thank bhai Very helpful
@rednoodlestudio9973
@rednoodlestudio9973 5 жыл бұрын
@@Saifalipalla you're welcome bro, or koi doubt ho to aap puch sakte ho
@AtulSharma-jr1mn
@AtulSharma-jr1mn 5 жыл бұрын
Sir, In python how to make drop-down search box and table. And how to connect two files in python and convert them in .exe. Please make a video to show us the correct way.
@abhinashmallick8895
@abhinashmallick8895 5 жыл бұрын
Bro please make a tutorial on kivy
@anuragtawaniya7746
@anuragtawaniya7746 5 жыл бұрын
Bhai java ka course kab aaye ga
@sciencetak6424
@sciencetak6424 5 жыл бұрын
Bhai c++ full course kab layoge
@tanbirhossain7
@tanbirhossain7 5 жыл бұрын
Technology Gyan ke channel me chale Gao...mil jayega
@geetanshverma7294
@geetanshverma7294 5 жыл бұрын
Bhaiya ek question Python se hai mai uski playlist access kar raha huin isliye.. Agar hame list ke kisi particular item se for loop ko start karna ho to kaise karein. Pls help.
@gsrcreations108
@gsrcreations108 5 жыл бұрын
#looping start from 1 index means banana--------- thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"] for i in range(1, len(thislist)): print (i, thislist[i]) or print (thislist[i]) // there many other ways to perform looping through a python list, this is one of them, Hope it will help you. happy coding.
@geetanshverma7294
@geetanshverma7294 5 жыл бұрын
@@gsrcreations108 Thanks It works
@ufufufuf6347
@ufufufuf6347 5 жыл бұрын
O bhai sahab koi insaan itna tej kaise ho sakta hai
@hrithikrudra4292
@hrithikrudra4292 4 жыл бұрын
Sir if I watch all your web dev videos,will it be required to watch this playlist??
@Elderny
@Elderny 3 жыл бұрын
yes lol he taught nothing in web dev playlist
@rupanroy5176
@rupanroy5176 5 жыл бұрын
Sir Kya app python se app banane ka vide banaye
@AmeerHamza-jy5ml
@AmeerHamza-jy5ml 5 жыл бұрын
Node Js Kab lay kar Arhy ho Harry Bhai
@roopali07
@roopali07 5 жыл бұрын
sir how can i take your tutorial source code
@sumsangs9plus302
@sumsangs9plus302 5 жыл бұрын
Es6 maps plzzzz
@youthgamngpatnerz3300
@youthgamngpatnerz3300 5 жыл бұрын
bhai i have a doubt regarding python
@star83138
@star83138 5 жыл бұрын
Haary bhai heart dedoo 🤗🤗 And thank you for videos this is big help for us.
@tarunkoshti1875
@tarunkoshti1875 5 жыл бұрын
Your jarbis is not working There is error in line 37 Please remove this error It say that pyaudio not find Please remove this error This is my third comment
@ganeshbirajdar4382
@ganeshbirajdar4382 3 жыл бұрын
run this command in your terminal - 'pip install pyaudio'
@rahuldixit3661
@rahuldixit3661 2 жыл бұрын
how to add snooze button anybody help
Generators in Javascript | JavaScript Tutorial In Hindi #53
10:20
CodeWithHarry
Рет қаралды 51 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 60 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 38 МЛН
How to use AI Effectively - Prompts, Tips & Tricks🔥
14:30
CodeWithHarry
Рет қаралды 72 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
How to MASTER Javascript FAST in 2023
12:49
Internet Made Coder
Рет қаралды 377 М.
Iterators in JavaScript | JavaScript Tutorial In Hindi #51
15:00
CodeWithHarry
Рет қаралды 55 М.
5 Mistakes Beginner Web Developers Make (Avoid These)
12:09
CodeWithHarry
Рет қаралды 109 М.
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1,1 МЛН
Async/Await in Javascript | JavaScript Tutorial In Hindi #43
13:50
CodeWithHarry
Рет қаралды 232 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 60 МЛН