Functional digital clock in Hype

Years ago, as an amateur screen printer, I printed this wall clock based on Leonardo da Vinci's Vitruvius Man. The indicated time is about a quarter to eleven.


Now I have made a version for the iPad, Mac, iPhone etc. in Hype. The two figures rotate randomly, but how nice would it be if they also indicated the correct time like my little clock.
Is there an existing script for a clock or should I invent it myself, which of course I will never succeed.
https://www.janmac.nl/Vitruvius/Vitruvius.html

Have a look at this post. Everything you need, I guess...

1 Like

It's almost unbelievable, I post a question, go to bed and when I wake up I see the answer to my question! Only now my poor HTLM knowledge is paying off. I normally substitute parts of a complicated idea on the forum and it works great after a week of trying it out: jazzkoe
Unfortunately, my luck is failing me now because it may be a little too complicated for me. This is what I made of it, but it doesn't work. Is help still possible? I replaced everything except the second hand, because with that I can check if the clock is working:
proefje

1 Like

The issue is that this clock works by obtaining the time zone it works with from the symbols id
.
Simply give the symbol an id that is a time zone i.e

Europe/Berlin

Screenshot 2023-08-15 at 19.41.04

The other time zones can be found heree https://en.wikipedia.org/wiki/List_of_tz_database_time_zones .

Also just realised you have not set the hour and minute hand class names and left the old ones in.

Also need the two Leonardo's and second hand placement repositioned to rotate correctly from a shared center point.

I will pm you a fixed version

I also changed the time zone ref to use the Additional Html Attributes instead of id
This line in the code changed

h = today.toLocaleString('en-GB', {hour: '2-digit', hour12: false, timeZone: window[element.id].id })

to

h = today.toLocaleString('en-GB', {hour: '2-digit', hour12: false, timeZone: window[element.id].dataset.timezone })

And the symbol given it time zone

Screenshot 2023-08-15 at 20.23.08

--

2 Likes

With the very expert help of Mark Hunte, this seventy-six-year-old former art teacher managed to create a clock as a variation of Leonardo da Vinci's Vitrivius Man, as he described it in his "De architectura" of about 1490. Of course, I couldn't resist adding some humor to it. I fear that many other variations will follow. Mark thanks immensely for your help and patience!
https://www.janmac.nl/Leonardoclock/Leonardoclock.html

4 Likes

Hahah, that's very funny,
Well done.

2 Likes