DEV Community 👩‍💻👨‍💻

Mohammad Mirfatemi
Mohammad Mirfatemi

Posted on

a classic watch , width HTML CSS JS

This is a simple project with HTML, CSS and Js GitHub repository: https://github.com/kiumad/clock_m

Top comments (7)

Collapse
tracygjg profile image
TGJ Gilmore

Nice job Mohammad. In the JavaScript for loop, if you replace the less-than (<) for a less-than or equal to (<=) you can drop the + 1.
Instead of

for (let i = 1; i < c_numbers_count + 1; i++)
Enter fullscreen mode Exit fullscreen mode

use

for (let i = 1; i <= c_numbers_count; i++)
Enter fullscreen mode Exit fullscreen mode
Collapse
kiumad profile image
Mohammad Mirfatemi Author

Thanks a lot @tracygjg .
It was an interesting and informative point for me

Collapse
tracygjg profile image
TGJ Gilmore

Thanks for accepting the PR but don't forget to update CodePen.

Thread Thread
kiumad profile image
Mohammad Mirfatemi Author

Yes, Sure
Thank you again

Collapse
lukeshiru profile image
Luke Shiru

I suggest you use CSS custom properties instead of changing styles directly. This way all the calculations stay in CSS, and you can even use the same values for other stuff inside the same element:

Cheers!

Collapse
kiumad profile image
Mohammad Mirfatemi Author

Thank you for taking the time to fix it
It was very informative for me
Cheers!

Collapse
malzeri83 profile image
malzeri83

thumbs up!

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.