Javascript Clock | CSS Neumorphism Working Analog Clock UI Design

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • Enroll My Course : Next Level CSS Animation and Hover Effects
    www.udemy.com/...
    Another Course : Build Complete Real World Responsive Websites from Scratch
    www.udemy.com/...
    ------------------
    Join Our Channel Membership And Get Source Code Everyday
    Join : / @onlinetutorialsyt
    ------------------
    In this video i'll teach you how to create a working analog clock using html css & javascript with css neumorphism effect ui design.
    ------------------
    Source Code : / css-neumorphism-36809024
    ------------------
    Also Watch This : Working Analog Clock Using Html5 CSS3 & Javascript
    • Working Analog Clock U...
    Toggle Between Dark and Light Mode using CSS & Javascript | CSS Neumorphism Working Analog Clock
    • Toggle Between Dark an...
    ------------------
    Also wwtch thie : Toggle Between Dark and Light Mode using CSS & Javascript | CSS Neumorphism Working Analog Clock
    • Toggle Between Dark an...
    Clock.png Image Download Url : drive.google.c...
    ------------------
    Please LIKE our Facebook page for daily updates...
    / online-tutorial-html-c...

Komentáře • 511

  • @OnlineTutorialsYT
    @OnlineTutorialsYT  Před 4 lety +162

    Hey all...
    Use this ` sign instead of this '
    This is wrong
    hr.style.transform = 'rotateZ(${hh+(mm/12)}deg)';
    This is right
    hr.style.transform = `rotateZ(${hh+(mm/12)}deg)`;

  • @saulosouza5494
    @saulosouza5494 Před 4 lety +212

    Both clocks are nice. But I think the black one is the best.

  • @OnlineTutorialsYT
    @OnlineTutorialsYT  Před 4 lety +4

    Download Source Code : www.patreon.com/posts/css-neumorphism-36809024

    • @parkjiji6701
      @parkjiji6701 Před 4 lety

      Omg thank you so much for the code source , really it's help us alot

    • @shubbhumourya
      @shubbhumourya Před 4 lety +2

      My clock is not working 😣

    • @shubbhumourya
      @shubbhumourya Před 4 lety +2

      I have same copy your code but it still not working

    • @HORIZON-lz3pp
      @HORIZON-lz3pp Před 4 lety

      ​@@shubbhumourya Its `` - above tab button and not apostrophees ' '!

    • @HORIZON-lz3pp
      @HORIZON-lz3pp Před 4 lety

      @@shubbhumourya Its `` - above tab button and not apostrophees ' '!

  • @OnlineTutorialsYT
    @OnlineTutorialsYT  Před 4 lety +5

    Also watch this awesome working Calculator UI video
    czcams.com/video/BuZtAqk5LIY/video.html

  • @victorschweitz3506
    @victorschweitz3506 Před 4 lety +8

    I like the black one the most. But a cool opportunity would be to have the white one as day time and then the time is for example 20 o'clock, it turns into the dark version. Another idea would be to have a toggle button so you can toggle between the two modes.

  • @shamiul_islam
    @shamiul_islam Před 2 lety +3

    Amazing!
    It's really impressive how much we can do with CSS and JS nowadays.

  • @jsnmad
    @jsnmad Před 4 lety +6

    This is just a new fresh style of delivering technical content. I love it. It was both entertaining, to the point and informative.

  • @KanhaiyaJoy
    @KanhaiyaJoy Před 4 lety +4

    Mujhe kuch samajh nahi aaya Lekin dekhne me bahoot Maja aaya
    🤔🤔😀 LOVE you sir.....!!!!!

  • @themalicraft979
    @themalicraft979 Před 4 lety +13

    Amazing! I think there is something nice that you could add: A transition of the transform at: .hr, .mn, .sc {..., transition: transform 500ms ease;}

    • @peybro
      @peybro Před 4 lety +1

      Looks smooth but at 60 they will go left wise and not right :D

    • @suyashdhumal3
      @suyashdhumal3 Před 3 lety +3

      @@peybro Yeah I was also going to say the same thing. :)

  • @Floranilol
    @Floranilol Před 2 lety +3

    Really cool project, and finishable in 30 mins! It's a 9 out of 10 for me

  • @rahulchakraborty8916
    @rahulchakraborty8916 Před 3 lety +3

    Great work brother. Thanks a bunch for such a small and effective software creation. Lastly, thanks a bunch for poviding us the source code for free!!

    • @shahriarhossain9525
      @shahriarhossain9525 Před 3 lety

      Where is the source code? Could you please help me? I got stuck at a point. Would you like to check the code of the project?

  • @tanaysheth8601
    @tanaysheth8601 Před 3 lety

    Black one is best because it is the one which attracted viewers 😍😍

  • @CHITUS
    @CHITUS Před 2 lety +4

    Great work, as always! Please do a tutorial on Customised Pre-Loaders.

  • @TimersAndMore
    @TimersAndMore Před 4 lety +1

    Nice and clean tutorial.
    I love the border of the white clock above the border of the gray/black clock. But i love the colors of the gray/black clock.

  • @beerka5265
    @beerka5265 Před 4 lety +2

    its more than just clocks, thats piece of art, i suppose

  • @Funminotaur
    @Funminotaur Před 4 lety +48

    the intro sounds like a mixed version of another one bites the dust.

    • @gustanobreza
      @gustanobreza Před 4 lety

      Lolololololo
      It's really

    • @_Xyr
      @_Xyr Před 4 lety

      no shet sherlock

    • @satyamsovan123
      @satyamsovan123 Před 3 lety +1

      i was just about to comment this. but you know, another bites the dust ! 😂

  • @rhymekidstv
    @rhymekidstv Před 4 lety +3

    Thank you bro. I have seen few videos online about clock. I was desperately waiting for yours. Your method is so clear and easy to understand. Thank you bro.

  • @randomguy5922
    @randomguy5922 Před 4 lety +1

    it was so beautiful.............and the knowledge u have...just mind blowing.

  • @gambo2003
    @gambo2003 Před 4 lety +3

    Wow masterpiece 🙏what a knowledge respect maestro ✊

  • @cabdifataaxkhadar3157
    @cabdifataaxkhadar3157 Před 2 lety

    Thanks you brother, I actually love this triturial coding
    I am from somalia 🇸🇴

  • @BLACK-hl4ic
    @BLACK-hl4ic Před 4 lety +3

    Out of course but interesting & amazing.
    👍👍👍👍Good one

  • @thealoogamer
    @thealoogamer Před 3 lety +2

    I think it will be better if you explain everything in these projects

  • @jokerff5429
    @jokerff5429 Před 4 lety

    this is the most helpful channel for me and i have subscribed to this channel

  • @VenThing
    @VenThing Před 4 lety

    Black is the best , but both are awesome👍👌

  • @sampson217
    @sampson217 Před rokem

    That was ridiculously awesome.

  • @first1900
    @first1900 Před 3 lety +1

    Salute to you Sir ❤️ ❤️ ❤️ ❤️ ❤️

  • @ramlaaal
    @ramlaaal Před 3 lety

    awesome you make things clean minimalistic beautiful and easy coding i like your projects they are really cool

  • @user-vx6gt5lr4t
    @user-vx6gt5lr4t Před 4 lety

    Not anew , u are hero 🦸‍♂️ 🌼

  • @denimermoraes2663
    @denimermoraes2663 Před 4 lety +2

    Thank you brother for the great work and for sharing with the community!

  • @unknodud1346
    @unknodud1346 Před rokem +1

    0:08 both good when adding the light and dark mode feature in the website

  • @ArjunaPandava
    @ArjunaPandava Před rokem

    another great hit.. thanks bro

  • @lazylemur7761
    @lazylemur7761 Před 4 lety +1

    wow, this is simple code and very nice design, thanks

  • @fuzzypumpkin7743
    @fuzzypumpkin7743 Před 4 lety +2

    The problem with neumorphism is that it's not great for accessibility. Look at the white clock...much crisper than the black. I'd also say that the number and line contrast on the black clock would only barely pass WCAG standards. I mean, technically, it's the outline/border of the clock that is unclear and it's usable without that. But, not as great a user experience.

  • @mohamedfarh14
    @mohamedfarh14 Před 3 lety +2

    Javascript code doesn't work with me😭😭

  • @Jeeltech24x7
    @Jeeltech24x7 Před 2 lety

    awesome awesome awesome 🆒🆒🆒🆒🆒 you're absolutely skilled

  • @mahmud1008
    @mahmud1008 Před 2 lety

    Excellent,,, It's so Curious 🔥🔥🔥

  • @psnr_
    @psnr_ Před 4 lety +5

    Bro I have a problem, the clock hands are not centered on the white point.

    • @muradosmanov8166
      @muradosmanov8166 Před 4 lety

      I m too

    • @thehorse1496
      @thehorse1496 Před 4 lety

      I recommend u to upload your code to codepen or jsfiddle and post it here, perhaps we can help

    • @psnr_
      @psnr_ Před 4 lety +1

      That's my code:
      clock | css
      * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      }
      body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #091921;
      }
      .clock {
      width: 300px;
      height: 300px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: url(img/clock.png);
      background-size: cover;
      border: 4px solid #091921;
      border-radius: 50%;
      box-shadow: 0 -15px 15px rgba(255,255,255,0.05),
      inset 0 -15px 15px rgba(255,255,255,0.05),
      0 15px 15px rgba(0,0,0,0.3),
      inset 0 15px 15px rgba(0,0,0,0.3);
      }
      .clock:before {
      content: '';
      position: absolute;
      width: 15px;
      height: 15px;
      background: #FFF;
      border-radius: 50%;
      z-index: 10000;
      }
      .clock .hour,
      .clock .min,
      .clock .sec,
      {
      position: absolute;
      }
      .clock .hour, .hr {
      width: 160px;
      height: 160px;
      }
      .clock .min, .mn {
      width: 190px;
      height: 190px;
      }
      .clock .sec, .sc {
      width: 230px;
      height: 230px;
      }
      .hr, .mn, .sc
      {
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      border-radius: 50%;
      }
      .hr:before {
      content: '';
      position: absolute;
      width: 8px;
      height: 80px;
      background: #ff105e;
      z-index: 10;
      border-radius: 6px 6px 0 0;
      }
      .mn:before {
      content: '';
      position: absolute;
      width: 4px;
      height: 90px;
      background: #fff;
      z-index: 11;
      border-radius: 6px 6px 0 0;
      }
      .sc:before {
      content: '';
      position: absolute;
      width: 2px;
      height: 150px;
      background: #fff;
      z-index: 12;
      border-radius: 6px 6px 0 0;
      }









      const deg = 6;
      const hr = document.querySelector('#hr');
      const mn = document.querySelector('#mn');
      const sc = document.querySelector('#sc');

      setInterval(() => {

      let day= new Date();
      let hh = day.getHours() * 30;
      let mm = day.getMinutes() * deg;
      let ss = day.getSeconds() * deg;

      hr.style.transform = `rotateZ(${hh+(mm/12)}deg)`;
      mn.style.transform = `rotateZ(${mm}deg)`;
      sc.style.transform = `rotateZ(${ss}deg)`;

      })

    • @miniminiRedPanda
      @miniminiRedPanda Před 4 lety +1

      Posner Righ may be comment out .hr, .mn, .sc align-items:center ?

    • @suyashdhumal3
      @suyashdhumal3 Před 3 lety

      @@miniminiRedPanda Removing align-items: center; will also do

  • @mohammadmeraj40
    @mohammadmeraj40 Před 5 měsíci

    Nice clock👍❤️❤️❤️

  • @_tech_js
    @_tech_js Před rokem

    Both are supper... But white is more

  • @swapnilmehta4411
    @swapnilmehta4411 Před 4 lety +1

    Cool.. I'll do this on Sunday

  • @hakimessioufi2435
    @hakimessioufi2435 Před 3 lety

    You're the best! Thanks a lot for the video

  • @user-wl7zv6tn8h
    @user-wl7zv6tn8h Před 4 lety +1

    which do you like desktop or laptop for coding?

  • @abhisheknair3d
    @abhisheknair3d Před 4 lety

    Both are so beautiful. darkmode and bright/lightmode superb!!

  • @techteacher6549
    @techteacher6549 Před 4 lety

    amazing design. I like the black one

  • @lonnybulldozer8426
    @lonnybulldozer8426 Před 4 lety

    You got skills for days like.

  • @BDJ64
    @BDJ64 Před 4 lety +4

    Why not create the background in css as well

  • @GarvitJain_1
    @GarvitJain_1 Před 4 lety +1

    You could have added transition to make the tick look slightly better
    And overall smooth experience

    • @shahriarhossain9525
      @shahriarhossain9525 Před 3 lety

      Hello, could you please help me? I got stuck at a point. Would you like to check the code of the project?

  • @aarnbee1693
    @aarnbee1693 Před 4 lety

    Both clocksare awesome! it depends on the website

  • @vishnuparegi4580
    @vishnuparegi4580 Před 4 lety

    Both looks awesome!!

  • @cgd1602
    @cgd1602 Před 4 lety +1

    This is what I am looking for

  • @Wilson84KS
    @Wilson84KS Před 4 lety +6

    Interesting, I made a widget for iOS for iWidgets a couple of years ago and using milliseconds so the indicators move smooth continuously. But this one is very close and easy to understand what and why.
    What programm are you using for editing?
    I write this all in simple text-files, lol, one mistake in a little more complex code and I have to search for it longer than I would need to write a new code.

    • @leonardodev5478
      @leonardodev5478 Před 4 lety +3

      He's using Sublime, it's not considered an IDE, but it's one of the best. However, there is Microsoft's, which is Visual Studio Code, or rather, VS Code. Take a look!

  • @edgarvargas2397
    @edgarvargas2397 Před rokem

    great thank you very much

  • @eugeneponomarov7429
    @eugeneponomarov7429 Před 4 lety +4

    Why people are copying two letters? Is it so hard and time consuming to write it on your own?

    • @b.6603
      @b.6603 Před 4 lety

      YES! The content is amazing but this distracted me so much!

    • @NataliaBazj
      @NataliaBazj Před 4 lety

      And then spend the rest of the day trying to find which letter you have mistyped.

  • @asshard
    @asshard Před 4 lety

    both are amazing..

  • @DJone4one
    @DJone4one Před 4 lety +2

    hi, it doesn't work in my firefox browser. the position from the point was not in the center, and the other hands was the same problem. I have moved the parts with margin-top/left in the right position. But the rotation animation was not working too. Do you know how i can fix this.

  • @zasimahmed3794
    @zasimahmed3794 Před 4 lety

    so nice ... fantastic bro....

  • @damaestra
    @damaestra Před 4 lety +4

    Your CSS selectrors contains a lot of extra classes. F.e., ".clock .hour .hr" could contain only ".hr".

    • @FastKonrad
      @FastKonrad Před 4 lety +1

      Why is it wrong? I think that the way he used it is more appropriate because you can instantly see in css what is in DOM structure. It is more readable for other programmers. I am just curious about your opinion. Sinceraly ( :

    • @suyashdhumal3
      @suyashdhumal3 Před 3 lety

      He should start using sass

  • @kodewala
    @kodewala Před 4 lety

    Awesome creation

  • @thehonestabe
    @thehonestabe Před 4 lety

    You're the best! Thanks a lot for the video!!!

  • @violencetrial
    @violencetrial Před 4 lety

    GJ for juniors.

  • @khalediman9740
    @khalediman9740 Před 3 lety +1

    nice video keep this awesome work up , i followed your steps precisely however , The Js code is not working , all the other stuffs are fine only the code written inside the script code isn't working . is it cuz i'm using opera browser ? i hope anyone give me a hint to that issue
    thank you

  • @oleksandrsokolovskyi7624

    Both are good!

  • @OnlineTutorialsYT
    @OnlineTutorialsYT  Před 4 lety +3

    Use this sign ` with style.transform instead of this '

    • @sanskarsrivastava9694
      @sanskarsrivastava9694 Před 4 lety

      Why it's not working with ' ?

    • @nickolasjoe
      @nickolasjoe Před 4 lety

      sanskar srivastava Because you can’t insert variables in a regular ' string you have to use the template string `

    • @nickolasjoe
      @nickolasjoe Před 4 lety

      sanskar srivastava In this case the variables are the “let” ones

  • @santhoshm1847
    @santhoshm1847 Před 4 lety

    Awesome 🤩, I liked dark one.

  • @MehediHasan-di9nd
    @MehediHasan-di9nd Před rokem

    The background music made me move my body and dance 😂😂

  • @sbrother9584
    @sbrother9584 Před 4 lety

    Blue is good dear sir

  • @roubazahra2977
    @roubazahra2977 Před 4 lety +3

    There are no errors.
    And the clock is not working. Why?
    Thank you 🐼

  • @triplettutorials8334
    @triplettutorials8334 Před 3 lety +1

    Hey, why is querySelector not working?

  • @palda5457
    @palda5457 Před 4 lety +1

    very nice. Tks

  • @restaadiputra8399
    @restaadiputra8399 Před 4 lety +1

    Nice work, keep making such tutorial, it give me a lot of inspiration.

  • @kingross17
    @kingross17 Před 4 lety

    White one is good

  • @dungnguyenxuan1345
    @dungnguyenxuan1345 Před 4 lety

    tks pro .
    t have successfully run the program

  • @parthparmar4132
    @parthparmar4132 Před 4 lety +2

    Nice sir❤️❤️

  • @tenzinpesangdompatsang369

    Black is better for battery life . I guess !

  • @peybro
    @peybro Před 4 lety +10

    If you want a fluid seconds pointer replace day.getSeconds() with day.getTime()/1000 😉

    • @swapnilmehta4411
      @swapnilmehta4411 Před 4 lety

      and what for Min and Hour ??

    • @shahriarhossain9525
      @shahriarhossain9525 Před 3 lety

      Hello, could you please help me? I got stuck at a point. Would you like to check the code of the project?

  • @alessiopustorino85
    @alessiopustorino85 Před 4 lety +1

    Nice, but I didn't understand why you multiplied by 30. can you explain me, please?
    I forgot to tell you that I prefer the dark theme for the clock.

    • @hofas2007
      @hofas2007 Před 4 lety +4

      if you multiply hour by 30 you get angle of the circle, for example 30 * 1(hr) you get 30 degree, so you have to rotate 30 degree.. if you have 6hr just multiply 6 by 30 and you have 180 degree , so half a circle

    • @alessiopustorino85
      @alessiopustorino85 Před 4 lety

      @@hofas2007 Thank you.

    • @americanpie959
      @americanpie959 Před 4 lety +1

      hofas2007 thx a lot!

  • @alammd.samsul8424
    @alammd.samsul8424 Před 4 lety

    that willbe a nice project1.project......alam md.

  • @PanagiotisTheofilopoulos
    @PanagiotisTheofilopoulos Před 4 lety +2

    Great tutorial! Thank you!! Love it!

  • @giuseppepesce4619
    @giuseppepesce4619 Před 4 lety

    very nice work!!!

  • @atiqurrahman3887
    @atiqurrahman3887 Před 4 lety

    Awesome ... Thanks for share

  • @freelancersazedul1995
    @freelancersazedul1995 Před 4 lety +1

    Awesome

  • @mithiakter_050
    @mithiakter_050 Před 2 lety

    It works 🌸

  • @sundasnaveed8245
    @sundasnaveed8245 Před 3 lety

    Thanks

  • @luizfernandonoschang8298
    @luizfernandonoschang8298 Před 3 lety +2

    Very nice! Can you replace the clock image by actual divs or a SVG image, so you can change the style of the numbers?

  • @gerardoruiz7109
    @gerardoruiz7109 Před 4 lety +2

    Hi! Could you make a a tutorial for file input designs?

  • @ruchiray8557
    @ruchiray8557 Před 3 lety

    Amazing video

  • @shahriarhossain9525
    @shahriarhossain9525 Před 3 lety

    Great tutorial! Could you please help me to solve a problem in this project?

  • @absalamoval
    @absalamoval Před 4 lety +1

    super

  • @ahmedrazashah4644
    @ahmedrazashah4644 Před 4 lety +4

    your question is > Which One Is Good?
    for me number one white clock

  • @furkank1771
    @furkank1771 Před 4 lety +110

    Customer : this clock not working.
    me : please refresh page with ctrl + f5 or open web site in incognito mode.
    Customer : no, not working.
    me : okey... which web browser do you use?
    Customer : Internet Explorer
    me : ?!?!?!?!?!?

    • @techqueries3260
      @techqueries3260 Před 4 lety

      @Furkan k. LOL

    • @Stl71
      @Stl71 Před 4 lety +2

      You should be waiting all kind of clients...Even clients using IE7.

    • @temur2259
      @temur2259 Před 4 lety +6

      @@Stl71 I see, you're just as outdated as broken clients who can't afford Google Chrome
      EDIT: Should developers still stick with DirectX 9 when there's 12?

    • @daheck81
      @daheck81 Před 4 lety +2

      lool1234566 You've never worked in a company huh? IE7 support is hilarious, yes. But the sad fact that many people still use IE11 is still true. We ignore every use case < 2.5 %

    • @temur2259
      @temur2259 Před 4 lety +2

      @@daheck81 Well, that's a thing within YOUR company then. Maybe telling your customers to upgrade to a better browser that is not outdated would help you alot. Nobody is forced to use outdated or bad browsers nowadays, so why bother with it then?

  • @lazylemur7761
    @lazylemur7761 Před 2 lety

    thanks

  • @salmakhan123
    @salmakhan123 Před 4 lety +2

    I have so many problems with the clock hand .it can't stay in one place.

  • @nahombinyam3759
    @nahombinyam3759 Před 2 lety

    pretty cool

  • @danielnicholas1747
    @danielnicholas1747 Před 3 lety

    Thanks for this but only the hand for seconds is ticking

  • @bohdanmoroziuk2689
    @bohdanmoroziuk2689 Před 4 lety

    Nice easy sing

  • @missannie1272
    @missannie1272 Před 4 lety

    You are best

  • @whatsaguygottado2669
    @whatsaguygottado2669 Před 4 lety

    Wow! Way cool!

  • @alvirarahman1559
    @alvirarahman1559 Před 3 lety

    That was so cool!

  • @sinistersmile6638
    @sinistersmile6638 Před 4 lety +8

    Another great tutorial! Hey man, how can I contact you? I have 1 question.

    • @neon13x
      @neon13x Před 4 lety +5

      You can ask here perhaps someone will reply

    • @Nurutomo
      @Nurutomo Před 4 lety

      @@neon13x yeah

  •  Před 4 lety +1

    The black one :)