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

Поделиться
HTML-код
  • Опубликовано: 2 янв 2025

Комментарии • 135

  • @kumarcodingzone
    @kumarcodingzone 11 месяцев назад +4

    Best Tutorial for Analog clock

  • @asifahmed6568
    @asifahmed6568 10 месяцев назад +3

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

  • @sahirulsekh1734
    @sahirulsekh1734 4 месяца назад +2

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

    • @WebTechTalk
      @WebTechTalk  4 месяца назад

      @@sahirulsekh1734 Thank you so much 🙏

  • @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

  • @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

  • @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.

  • @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 4 месяца назад +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  4 месяца назад

      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.

  • @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.

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

    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

  • @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 😀

  • @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

  • @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

  • @atulchavan2276
    @atulchavan2276 2 года назад +1

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

  • @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

  • @dhanjitkumarsingh7484
    @dhanjitkumarsingh7484 2 года назад +1

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

  • @tanveershah8306
    @tanveershah8306 2 года назад +1

    very good approach sir for analog clock

  • @Shivamashish5236
    @Shivamashish5236 2 года назад +1

    Good one sir 👍🏻👍🏻

  • @Horria-r2b
    @Horria-r2b 8 месяцев назад

    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.

  • @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

  • @lachidong7818
    @lachidong7818 6 месяцев назад

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

    • @WebTechTalk
      @WebTechTalk  6 месяцев назад

      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".

  • @apk_academy
    @apk_academy 5 месяцев назад +1

    Thanks for teaching us

  • @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?

  • @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💕💕💕💓💓💓💓🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰😍😍🥰🥰🥰🥰🥰🥰🥰🥰🥰

  • @SouravCheck
    @SouravCheck 8 месяцев назад

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

    • @WebTechTalk
      @WebTechTalk  8 месяцев назад

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

  • @CoolHandLuke1117
    @CoolHandLuke1117 11 месяцев назад

    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  11 месяцев назад

      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 11 месяцев назад

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

    • @WebTechTalk
      @WebTechTalk  11 месяцев назад

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

    • @CoolHandLuke1117
      @CoolHandLuke1117 11 месяцев назад +1

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

    • @WebTechTalk
      @WebTechTalk  11 месяцев назад +1

      @@CoolHandLuke1117 Sometimes this happens 😂

  • @faizulaleem348
    @faizulaleem348 Год назад +1

    How to preview in Vs code?

    • @WebTechTalk
      @WebTechTalk  Год назад

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

  • @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)

  • @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

  • @OnlyJesusMatters
    @OnlyJesusMatters 2 года назад +1

    Thanks. Works well for me.

  • @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

  • @balogunadenike2680
    @balogunadenike2680 2 года назад +1

    Thank you😇😇

  • @UltimatePowerG0
    @UltimatePowerG0 Год назад +1

    faboulous!

  • @rahulshaw6354
    @rahulshaw6354 2 года назад +1

    Very Nice and Easy Tutorial

  • @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.

  • @sreelakshmisasidharan9541
    @sreelakshmisasidharan9541 4 года назад +1

    Nice explanation 👏👍

  • @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.

  • @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.

  • @balenmohammed1657
    @balenmohammed1657 2 года назад +1

    GREAT JOB BRO

  • @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.

  • @rutvikbhoj4737
    @rutvikbhoj4737 2 года назад +1

    Great ! Thank You!

  • @noor-e-sehar7316
    @noor-e-sehar7316 7 месяцев назад +1

    It's really work

  • @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.

  • @jerade312
    @jerade312 2 года назад +1

    thanks for this bro

  • @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

  • @prakash6485
    @prakash6485 3 года назад

    Very interesting bro

  • @S-Lomar
    @S-Lomar Год назад +1

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

  • @vwpe
    @vwpe 8 месяцев назад +1

    tysm!

  • @abhaykevat3997
    @abhaykevat3997 Год назад +1

    please provide source code

    • @WebTechTalk
      @WebTechTalk  Год назад

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

  • @solohitechnologys.h.t762
    @solohitechnologys.h.t762 3 года назад +1

    9ice 1

  • @hritikkumarshorts1290
    @hritikkumarshorts1290 3 года назад

    can uh plss provide the source code

    • @WebTechTalk
      @WebTechTalk  3 года назад

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

  • @AtSqureTech
    @AtSqureTech 4 месяца назад

    #webtechtalk dear sir plz provide notes

    • @WebTechTalk
      @WebTechTalk  4 месяца назад

      May I know which notes you are expecting?

  • @SouravCheck
    @SouravCheck 7 месяцев назад

    really can't understand, dropping the video.

  • @dr.s.vatchala4571
    @dr.s.vatchala4571 5 месяцев назад

    Pdf