Creating a Basic Analog Clock with HTML, CSS, and JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 135

  • @kumarcodingzone
    @kumarcodingzone 11 หลายเดือนก่อน +4

    Best Tutorial for Analog clock

    • @WebTechTalk
      @WebTechTalk  11 หลายเดือนก่อน

      Thank you.

  • @asifahmed6568
    @asifahmed6568 10 หลายเดือนก่อน +3

    Absolutely amazing video and concisely explained. Thank you for sharing your knowledge with us

    • @WebTechTalk
      @WebTechTalk  10 หลายเดือนก่อน

      Thank you so much.

  • @sahirulsekh1734
    @sahirulsekh1734 3 หลายเดือนก่อน +2

    You explained very simply. Thank you. Keep it up...

    • @WebTechTalk
      @WebTechTalk  3 หลายเดือนก่อน

      @@sahirulsekh1734 Thank you so much 🙏

  • @tanveershah8306
    @tanveershah8306 2 ปีที่แล้ว +1

    very good approach sir for analog clock

  • @apk_academy
    @apk_academy 5 หลายเดือนก่อน +1

    Thanks for teaching us

    • @WebTechTalk
      @WebTechTalk  5 หลายเดือนก่อน

      Thank you

  • @spencerhepworth6435
    @spencerhepworth6435 2 ปีที่แล้ว +2

    How did you run the calculations to know exactly where to place the numbers within the clock?

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      It is purely kind of trial and error. I inspect it and adjust the position and found the top, right and left values.

  • @balenmohammed1657
    @balenmohammed1657 2 ปีที่แล้ว +1

    Thanks a lot I got benefit from your Channel keep going and we are waiting for more projects in JavaScript

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว +1

      Another one interesting javascript program coming up soon 😀

  • @caracolinhos09
    @caracolinhos09 2 ปีที่แล้ว +2

    I put that code on the point , that 240 px on top and left but the point goes left , out of the clock, doesn´t stay in the midle , it just go to the midle if I put a value of 960 px on the left.

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      Could you please compare your code with mine. Here is my code.
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

  • @atulchavan2276
    @atulchavan2276 2 ปีที่แล้ว +1

    Thanks Mam..
    now it's working...

  • @khushbookhatwani9573
    @khushbookhatwani9573 2 ปีที่แล้ว +2

    also in rotate you have done transform rotate(second +deg ).I am little confused is deg a variable or constatnt in this

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว +1

      deg is the unit. We have to give that inside rotate. deg means degree. Eg: transform: rotate(60deg)

  • @jodimccarthy7235
    @jodimccarthy7235 3 หลายเดือนก่อน +1

    Could we add code to run the clock faster or slower - I wish to create an alternate reality that has time that runs a bit faster - a specific value 5 points past the decimal point

    • @WebTechTalk
      @WebTechTalk  3 หลายเดือนก่อน

      This clock is using the current system time and so we cannot make it run fast or slower. We may need to change the core logic.

  • @rahulshaw6354
    @rahulshaw6354 2 ปีที่แล้ว +1

    Very Nice and Easy Tutorial

  • @ifeomablessing9578
    @ifeomablessing9578 2 ปีที่แล้ว +6

    This is the best tutorial so far, it is so explanatory and the codes are very simple compared to some complex ones. you took time to explain the left and top values. I am subscribing right away

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว +1

      Thank you very much. Your valuable comment motivates me a lot.

    • @mdanas0007
      @mdanas0007 2 ปีที่แล้ว +2

      Exactly bro there are many videos but they are complex for no reason.
      This is one is by far the best i have got.

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      @@mdanas0007 Thank you :)

    • @ossama_shaalan
      @ossama_shaalan ปีที่แล้ว +1

      ​@@WebTechTalkI have an important question for me . Can I put the time from other countries in example Tokyo ar London

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      @@ossama_shaalan You can use the UI logic but in the place where you are getting the current time, you need to get the time from server or you need to add the relative GMT hours

  • @suneelkumar-ju8up
    @suneelkumar-ju8up ปีที่แล้ว +1

    Hi I'm facing issue with respect to my project work and the client is expecting for performance improvement, in angular 12 I am getting blocked for the project .

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      There are many ways by which you can improve the performance in angular applications. Follow the best practices and see whether you need to concentrate more on the web vitals part or API side. In UI side, you can think about implementing caching of static resources, text compression, etc

  • @ЕвгенийГончаров-ъ2я
    @ЕвгенийГончаров-ъ2я ปีที่แล้ว +1

    hi, friend! i have a problem. When my second line is going to 12 pm, it make return back but have to go ahead in circle. What can i do for resolve this problem.

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      Please compare your code with mine.
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

    • @ЕвгенийГончаров-ъ2я
      @ЕвгенийГончаров-ъ2я ปีที่แล้ว +1

      @@WebTechTalk thanks, I've found mistake. My program is working

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      @@ЕвгенийГончаров-ъ2я Super

  • @Horria-r2b
    @Horria-r2b 7 หลายเดือนก่อน

    Mam kia ya clock user screen pr kis trha lga skty??? Have any idea plz give me

    • @WebTechTalk
      @WebTechTalk  7 หลายเดือนก่อน

      Sorry I didn't understand your question.

  • @wulja
    @wulja 10 หลายเดือนก่อน +1

    You did a great job. Could you give me a advice on how to fetch a PC-time from Windows and translate it to analog clock on the webpage so clock shows the time what its currently on your PC?

    • @WebTechTalk
      @WebTechTalk  10 หลายเดือนก่อน

      Hi this video is explaining how to show the PC time only (client time). To show server time we need a backend server.

  • @dhanjitkumarsingh7484
    @dhanjitkumarsingh7484 2 ปีที่แล้ว +1

    Thank you so much sir. I really understand and able to make it. 💞

  • @therisingsun9745
    @therisingsun9745 2 ปีที่แล้ว +2

    it was really beautiful bro ...loved it.

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      Thank you 😀

    • @therisingsun9745
      @therisingsun9745 2 ปีที่แล้ว +1

      @@WebTechTalk bro if you want you can teach me js, i will pay you.

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      I will be starting the Javascript Series soon. Don't worry

  • @Shivamashish5236
    @Shivamashish5236 2 ปีที่แล้ว +1

    Good one sir 👍🏻👍🏻

  • @OnlyJesusMatters
    @OnlyJesusMatters 2 ปีที่แล้ว +1

    Thanks. Works well for me.

  • @SouravCheck
    @SouravCheck 7 หลายเดือนก่อน

    Please write the commands also which you used for preview and other things so that we can follow along

    • @WebTechTalk
      @WebTechTalk  7 หลายเดือนก่อน

      Sure. I will do this in future videos. I don't remember whether I have used any command in this video.

  • @Gvloves
    @Gvloves 9 หลายเดือนก่อน

    How to open the preview in vs code , and also m following your steps but it's not working properly,

    • @WebTechTalk
      @WebTechTalk  9 หลายเดือนก่อน +1

      There are many extensions available. Eg: Live Preview. I used that. You can compare your code with mine. Check this repo for my code: github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

    • @Gvloves
      @Gvloves 9 หลายเดือนก่อน

      @@WebTechTalk thank you very much it's really helpful

  • @EhllenQuezada
    @EhllenQuezada 7 หลายเดือนก่อน

    What software are you using for this?

    • @WebTechTalk
      @WebTechTalk  7 หลายเดือนก่อน

      For recording and editing?

  • @lachidong7818
    @lachidong7818 5 หลายเดือนก่อน

    how did you do the math to add up top left ?

    • @WebTechTalk
      @WebTechTalk  5 หลายเดือนก่อน

      I believe you are asking about the position values to place the hour numbers in the clock. That is totally trial and error. I have already tried and while recording I used those values. That is why I have mentioned that "I have also found the right values".

  • @sreelakshmisasidharan9541
    @sreelakshmisasidharan9541 4 ปีที่แล้ว +1

    Nice explanation 👏👍

  • @mdtamzilsubhani7340
    @mdtamzilsubhani7340 ปีที่แล้ว +6

    Bro all good but not functioning JavaScript

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว +2

      You can compare your code with mine bro.
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

  • @NATE-dq2uo
    @NATE-dq2uo ปีที่แล้ว +1

    I like this vid and I tried it
    I just want to know how to move the HOUR HAND?

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      Every second I am getting the current time and calculating the position of each hands. For example: Hour hand logic is d.getHours() * 30 + Math.round(minute / 12)

  • @novakvelimirovic9865
    @novakvelimirovic9865 2 ปีที่แล้ว +1

    Expression expected, and ';' expected. is errors i get when i type this index file

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      Please compare your code with mine.
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

  • @rabbad7228
    @rabbad7228 ปีที่แล้ว

    Plz how you wrote fast html code in the first

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      This is called Emmet. I think VSCode by default support this. There are also some extensions available. You can search for HTML Boilerplate, HTML Snippets

    • @rabbad7228
      @rabbad7228 ปีที่แล้ว

      @@WebTechTalk i mean did you wrote a one letter in short way and press enter?

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      @@rabbad7228 Yes, in VS Code if you type html:5 and press enter it will create the boilerplate code

  • @UltimatePowerG0
    @UltimatePowerG0 ปีที่แล้ว +1

    faboulous!

  • @balenmohammed1657
    @balenmohammed1657 2 ปีที่แล้ว +1

    GREAT JOB BRO

  • @dhanush_gh
    @dhanush_gh 2 ปีที่แล้ว +2

    Thank you so much, but you should have also showed how to get perfect number for hour placement (like example- hour 9 : top 235px, left 45px )? , Other than that awesome video 😊👍🏽👍🏽

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว +1

      Those numbers I got it from the inspect window only. I adjusted by placing them randomly and took the values.

    • @S-Lomar
      @S-Lomar ปีที่แล้ว

      And how to earn on it💕💕💕💓💓💓💓🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰😍😍🥰🥰🥰🥰🥰🥰🥰🥰🥰

  • @rutvikbhoj4737
    @rutvikbhoj4737 2 ปีที่แล้ว +1

    Great ! Thank You!

  • @faizulaleem348
    @faizulaleem348 ปีที่แล้ว +1

    How to preview in Vs code?

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      You can use some extensions like LiveServer. There are many.

  • @khushbookhatwani9573
    @khushbookhatwani9573 2 ปีที่แล้ว +1

    can anybody explain the logic elaborately of math.round(minutes/12)

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      That is to add precision. When the time is 3PM, the hour hand will be exactly in 3. But when the time is 3:40PM, the hour hand will be somewhere between 3 and 4. So, to add that precision I am just adding that. If you see, I have multiplied seconds and minutes by 6 and hours by 30. That is because, the entire dial is going to be 360 degree. There are 60 seconds and so 360/60 = 6. Same for minute hand. But for hour, we have to divide the dial into 12 parts, that means 360/12 = 30. Plus the precision which is (minutes * 30) / 360 = minutes / 12. And then finally I am rounding that to the nearest number. Hope it is clear.

  • @noor-e-sehar7316
    @noor-e-sehar7316 6 หลายเดือนก่อน +1

    It's really work

    • @WebTechTalk
      @WebTechTalk  6 หลายเดือนก่อน

      Nice 🙂

  • @CoolHandLuke1117
    @CoolHandLuke1117 10 หลายเดือนก่อน

    I can't get the hands to move. Everything is in there exactly like you have. Not sure why they aren't moving.

    • @WebTechTalk
      @WebTechTalk  10 หลายเดือนก่อน

      Please check for any JavaScript error in the browser console. Or, you can compare with my code. My code is available in the git.

    • @CoolHandLuke1117
      @CoolHandLuke1117 10 หลายเดือนก่อน

      @@WebTechTalk Correct. Is there anything else needed like a special JSON or anthing to be linked?

    • @WebTechTalk
      @WebTechTalk  10 หลายเดือนก่อน

      @@CoolHandLuke1117 No. Please check this repo for code. github.com/freelancer-surender/Misc

    • @CoolHandLuke1117
      @CoolHandLuke1117 10 หลายเดือนก่อน +1

      @@WebTechTalk You are not going to believe this..I forgot my in javascript 😝. Thank you so much for troubleshooting with me

    • @WebTechTalk
      @WebTechTalk  10 หลายเดือนก่อน +1

      @@CoolHandLuke1117 Sometimes this happens 😂

  • @jerade312
    @jerade312 2 ปีที่แล้ว +1

    thanks for this bro

  • @balogunadenike2680
    @balogunadenike2680 2 ปีที่แล้ว +1

    Thank you😇😇

  • @KhwaishSaini-b3b
    @KhwaishSaini-b3b 3 หลายเดือนก่อน

    Is this Clock is responsive or not??

    • @WebTechTalk
      @WebTechTalk  3 หลายเดือนก่อน +1

      I think I have not applied code to make this responsive.

  • @khushbookhatwani9573
    @khushbookhatwani9573 2 ปีที่แล้ว +1

    Also i am unable to open source code given in one of the comment by you

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      Please use this link
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

  • @prakash6485
    @prakash6485 3 ปีที่แล้ว

    Very interesting bro

  • @Deveshhmaheshwari
    @Deveshhmaheshwari ปีที่แล้ว

    what was the logic of hours *30 when hours are only 24? why not *24 or *12

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      The clock dial is totally 360 degrees. So, 360 divided by 12 hours gives us 30 degrees for each hour. That is why 30.

  • @aima-111
    @aima-111 2 ปีที่แล้ว +1

    Where is the code link?

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      You can get the code from this repo.
      github.com/freelancer-surender/Misc

  • @burakfurkantenekeci7285
    @burakfurkantenekeci7285 2 ปีที่แล้ว +3

    Great work bro. But how you calculated the left and top values of hours?

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว +1

      Thanks bro. Those left, right and top values are approximate values. Got it by trial and error adjustment. For example, if you see the dial width is 500px, so, to place 12 in the center, we need to use 250px minus some width for the text size. So 235px is what it came right. But for 6, 240px is fine because it is a single digit. Like that I found for all hours.

    • @deslyatekendaya8671
      @deslyatekendaya8671 2 ปีที่แล้ว +1

      @@WebTechTalk please can I have the code snippet?

    • @deslyatekendaya8671
      @deslyatekendaya8671 2 ปีที่แล้ว +2

      @@WebTechTalk I want to add letters outside the clock that link to words from instance outside the 12 I put AB ,A stands for about us and B stands for book now...

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      @@deslyatekendaya8671 Sure. You can get it from this location.
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      @@deslyatekendaya8671 Sorry. I didn't understand your requirement clearly. If you want to add more text outside the clock, you can add a wrapper and position that relatively.

  • @b1studio648
    @b1studio648 4 หลายเดือนก่อน

    are you teaching or speedrunning it? why dont u make it a bit slow?

    • @WebTechTalk
      @WebTechTalk  4 หลายเดือนก่อน

      @@b1studio648 yes my initial days videos are fast. Sorry.

  • @suneelkumar-ju8up
    @suneelkumar-ju8up 2 ปีที่แล้ว +2

    Hi your videos are interesting, can you make a common repository where we can have references for the concepts dt u delivered

    • @WebTechTalk
      @WebTechTalk  2 ปีที่แล้ว

      You can get it from this repo.
      github.com/freelancer-surender/Misc

  • @vwpe
    @vwpe 8 หลายเดือนก่อน +1

    tysm!

    • @WebTechTalk
      @WebTechTalk  8 หลายเดือนก่อน

      Thank you 👍

  • @S-Lomar
    @S-Lomar ปีที่แล้ว +1

    💕💕💕🤣😍😍🥰🥰🥰🥰🥰🥰🥰🥰💓💕💕💕💕💕💕💕💕💕💕 thank you for sharing your experience

  • @solohitechnologys.h.t762
    @solohitechnologys.h.t762 3 ปีที่แล้ว +1

    9ice 1

  • @abhaykevat3997
    @abhaykevat3997 ปีที่แล้ว +1

    please provide source code

    • @WebTechTalk
      @WebTechTalk  ปีที่แล้ว

      You can get it from here
      github.com/freelancer-surender/Misc/tree/main/Analog%20Clock

  • @AtSqureTech
    @AtSqureTech 4 หลายเดือนก่อน

    #webtechtalk dear sir plz provide notes

    • @WebTechTalk
      @WebTechTalk  4 หลายเดือนก่อน

      May I know which notes you are expecting?

  • @hritikkumarshorts1290
    @hritikkumarshorts1290 3 ปีที่แล้ว

    can uh plss provide the source code

    • @WebTechTalk
      @WebTechTalk  3 ปีที่แล้ว

      Yes sure. github.com/freelancer-surender/analog-clock

  • @SouravCheck
    @SouravCheck 7 หลายเดือนก่อน

    really can't understand, dropping the video.

    • @WebTechTalk
      @WebTechTalk  7 หลายเดือนก่อน

      Sorry to hear that

  • @dr.s.vatchala4571
    @dr.s.vatchala4571 5 หลายเดือนก่อน

    Pdf