Welcome Guest! To enable all features please try to register or login.
HTML Clock will it work in RLC
Mr_NYDon
#1 Posted : Friday, January 01, 2021 9:03:55 AM(UTC)

Rank: Forum Regular

Joined: 12/6/2011(UTC)
Posts: 104
Medals:
I had flash clocks that worked great here but not sure how to get a new HTML clock work. Any help would be appreciated.
1 user thanked Mr_NYDon for this useful post.
Cougar on 1/1/2021(UTC)
Anhton_Novo
#2 Posted : Friday, January 01, 2021 6:53:59 PM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
Mr_NYDon;1663718 wrote:
I had flash clocks that worked great here but not sure how to get a new HTML clock work. Any help would be appreciated.



I created a basic analog clock using some basic coding that I found online. I've placed it in Sweetpea's Holiday Traditions 2 property if you want to check it out.

The url for the property is....

vww://utherverse.vww/@13923/@1443039#Holiday%20Traditions


This is just a basic clock but seems to work fine. I'm sure that digital versions could be created just as easily.

I hope this helps!

Best,

Anhton
7 users thanked Anhton_Novo for this useful post.
Mr_NYDon on 1/1/2021(UTC), A_Seddy on 1/2/2021(UTC), Sandra_SD_SoF on 1/2/2021(UTC), LazTopCat on 1/3/2021(UTC), The_Black_Rieder on 1/7/2021(UTC), Lindaatje on 1/8/2021(UTC), Never_Lost on 1/29/2021(UTC)
Cala_ULIKHYI
#3 Posted : Friday, January 01, 2021 7:40:31 PM(UTC)


Rank: Forum Regular

Joined: 12/30/2013(UTC)
Posts: 301
Location: SPAIN
From here, you can choose, formats and colors.
https://www.timeanddate.com/clocks/free.html

MY CLOCK TIMER EXAMPLE

El mundo se muere, el culpable es un parasito... EL SER HUMANO.
The world is dying, the culprit is a parasite ... THE HUMAN.
6 users thanked Cala_ULIKHYI for this useful post.
Mr_NYDon on 1/1/2021(UTC), A_Seddy on 1/2/2021(UTC), Sandra_SD_SoF on 1/2/2021(UTC), LazTopCat on 1/3/2021(UTC), The_Black_Rieder on 1/7/2021(UTC), Never_Lost on 1/29/2021(UTC)
Mr_NYDon
#4 Posted : Thursday, January 07, 2021 5:18:53 PM(UTC)

Rank: Forum Regular

Joined: 12/6/2011(UTC)
Posts: 104
Medals:
Thank you Anhton the clock looked great wish I had one.
1 user thanked Mr_NYDon for this useful post.
Never_Lost on 1/29/2021(UTC)
Anhton_Novo
#5 Posted : Thursday, January 07, 2021 6:07:32 PM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
Mr_NYDon;1664226 wrote:
Thank you Anhton the clock looked great wish I had one.


Hello,

I can send you html code for it if you'd like. Just let me know.

Best,

Anhton


Edit: I sent you the code via PM.
5 users thanked Anhton_Novo for this useful post.
The_Black_Rieder on 1/7/2021(UTC), Sandra_SD_SoF on 1/8/2021(UTC), A_Seddy on 1/8/2021(UTC), Lindaatje on 1/8/2021(UTC), Never_Lost on 1/29/2021(UTC)
Mr_NYDon
#6 Posted : Friday, January 08, 2021 9:04:04 AM(UTC)

Rank: Forum Regular

Joined: 12/6/2011(UTC)
Posts: 104
Medals:
Yes please Anhton I would appreciate that very much. And if you would how to apply the code. I had one from an online site but could figure out where or how to apply so it would work.
1 user thanked Mr_NYDon for this useful post.
Never_Lost on 1/29/2021(UTC)
Anhton_Novo
#7 Posted : Friday, January 08, 2021 9:21:37 AM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
Mr_NYDon;1664318 wrote:
Yes please Anhton I would appreciate that very much. And if you would how to apply the code. I had one from an online site but could figure out where or how to apply so it would work.



If you copy the code I sent you then open a program like notepad on windows. Paste the code into the program and save it with your desired name (add .html to the end of the file name)

Example file name would be clock.html

That's the easy part. It now gets a little more technical. In order to utilize the file it would need to be uploaded to a web host so that you can use the web browser script. I'll check around and see if some the free hosting places allow ftp uploads and get back to you. If you already have a preferred site just let me know and I'll see if I can assist you with the upload process.

Best,

Anhton

Edit: You can test the file you saved. Once you save it with the html extension you should be able to open it in a web browser.
3 users thanked Anhton_Novo for this useful post.
Sandra_SD_SoF on 1/8/2021(UTC), A_Seddy on 1/8/2021(UTC), Never_Lost on 1/29/2021(UTC)
Anhton_Novo
#8 Posted : Friday, January 08, 2021 9:43:52 AM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
For anyone else who may want to use this clock, here's the code I found online and modified:

===========================================================================================

Code:
<!DOCTYPE html>
<html>
<body>

<canvas id="canvas" width="400" height="400">
</canvas>

<script>
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var radius = canvas.height / 2;
ctx.translate(radius, radius);
radius = radius * 0.90
setInterval(drawClock, 1000);

function drawClock() {
  drawFace(ctx, radius);
  drawNumbers(ctx, radius);
  drawTime(ctx, radius);
}

function drawFace(ctx, radius) {
  var grad;
  ctx.beginPath();
  ctx.arc(0, 0, radius, 0, 2*Math.PI);
  ctx.fillStyle = 'white';
  ctx.fill();
  grad = ctx.createRadialGradient(0,0,radius*0.95, 0,0,radius*1.05);
  grad.addColorStop(0, '#333');
  grad.addColorStop(0.5, 'white');
  grad.addColorStop(1, '#333');
  ctx.strokeStyle = grad;
  ctx.lineWidth = radius*0.1;
  ctx.stroke();
  ctx.beginPath();
  ctx.arc(0, 0, radius*0.1, 0, 2*Math.PI);
  ctx.fillStyle = '#333';
  ctx.fill();
}

function drawNumbers(ctx, radius) {
  var ang;
  var num;
  ctx.font = radius*0.15 + "px arial";
  ctx.textBaseline="middle";
  ctx.textAlign="center";
  for(num = 1; num < 13; num++){
    ang = num * Math.PI / 6;
    ctx.rotate(ang);
    ctx.translate(0, -radius*0.85);
    ctx.rotate(-ang);
    ctx.fillText(num.toString(), 0, 0);
    ctx.rotate(ang);
    ctx.translate(0, radius*0.85);
    ctx.rotate(-ang);
  }
}

function drawTime(ctx, radius){
    var now = new Date();
    var hour = now.getHours();
    var minute = now.getMinutes();
    var second = now.getSeconds();
    //hour
    hour=hour%12;
    hour=(hour*Math.PI/6)+
    (minute*Math.PI/(6*60))+
    (second*Math.PI/(360*60));
    drawHand(ctx, hour, radius*0.5, radius*0.07);
    //minute
    minute=(minute*Math.PI/30)+(second*Math.PI/(30*60));
    drawHand(ctx, minute, radius*0.8, radius*0.07);
    // second
    second=(second*Math.PI/30);
    drawHand(ctx, second, radius*0.9, radius*0.02);
}

function drawHand(ctx, pos, length, width) {
    ctx.beginPath();
    ctx.lineWidth = width;
    ctx.lineCap = "round";
    ctx.moveTo(0,0);
    ctx.rotate(pos);
    ctx.lineTo(0, -length);
    ctx.stroke();
    ctx.rotate(-pos);
}
</script>

</body>
</html>


===========================================================================================

Have fun with it!

Best,

Anhton

Edit: Added closing bracket to Canvas tag
7 users thanked Anhton_Novo for this useful post.
A_Seddy on 1/8/2021(UTC), Viegoth on 1/8/2021(UTC), marta on 1/8/2021(UTC), Sandra_SD_SoF on 1/8/2021(UTC), LazTopCat on 1/10/2021(UTC), Never_Lost on 1/29/2021(UTC), MAJI_DHS on 3/14/2021(UTC)
Viegoth
#9 Posted : Friday, January 08, 2021 10:27:56 AM(UTC)

Rank: Veteran Forum Member

Joined: 10/9/2009(UTC)
Posts: 2,358
Medals:
Anhton_Novo;1664325 wrote:
For anyone else who may want to use this clock, here's the code I found online and modified:
...


Very nice and simplistic!

Just one minor correction if I may... you appear to be missing a closing bracket at the end of the canvas tag.

"The definition of insanity is doing the same thing over and over again and expecting different results." - Albert Einstein

VC Designs (Viegoth Customs)

Profile Message

-
5 users thanked Viegoth for this useful post.
Anhton_Novo on 1/8/2021(UTC), A_Seddy on 1/8/2021(UTC), Sandra_SD_SoF on 1/8/2021(UTC), LazTopCat on 1/10/2021(UTC), Never_Lost on 1/29/2021(UTC)
Anhton_Novo
#10 Posted : Friday, January 08, 2021 11:28:43 AM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
DJ_Morgan_RRR just made a good post about clocks.

https://forums.uthervers...clocks.aspx#post1664330

I just checked out the site and it seems to have many options for clocks. The clocks I tested had transparency so they would work well in your properties.

The main url is https://www.clocklink.com/

Thank you DJ_Morgan_RRR for providing this information to us.


Best,

Anhton

Please note: It appears that these clocks are free to use but please read any necessary information on the site before using the clocks.
4 users thanked Anhton_Novo for this useful post.
A_Seddy on 1/8/2021(UTC), Sandra_SD_SoF on 1/8/2021(UTC), LazTopCat on 1/10/2021(UTC), Never_Lost on 1/29/2021(UTC)
Anhton_Novo
#11 Posted : Friday, January 08, 2021 11:39:40 AM(UTC)


Rank: Seasoned Forum Member

Joined: 8/12/2012(UTC)
Posts: 746
Location: I hang with RLC friends whenever I can.
Medals:
Viegoth;1664327 wrote:
Anhton_Novo;1664325 wrote:
For anyone else who may want to use this clock, here's the code I found online and modified:
...


Very nice and simplistic!

Just one minor correction if I may... you appear to be missing a closing bracket at the end of the canvas tag.




Oops! Thanks! I fixed it!
3 users thanked Anhton_Novo for this useful post.
A_Seddy on 1/8/2021(UTC), Sandra_SD_SoF on 1/8/2021(UTC), Never_Lost on 1/29/2021(UTC)
Gabriella_Bunny
#12 Posted : Saturday, January 09, 2021 11:24:07 AM(UTC)


Rank: Rising Forum Member

Joined: 12/11/2013(UTC)
Posts: 54
Medals:
5 users thanked Gabriella_Bunny for this useful post.
Anhton_Novo on 1/9/2021(UTC), Sandra_SD_SoF on 1/9/2021(UTC), A_Seddy on 1/9/2021(UTC), LazTopCat on 1/10/2021(UTC), Never_Lost on 1/29/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.260 seconds.
TC-IIS-7
3.143.17.27