Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Nice Clock ( Javascript )

  1. #1
    Join Date
    Nov 2006
    Posts
    2

    Default Nice Clock ( Javascript )

    Copy this Code into the BODY tag of your page
    <script language="VBScript">
    Dim a
    Dim min1
    Dim hr1
    Dim sec1

    'Initializes clock and tells it how to behave, when to start animation, etc

    Sub window_onload
    a = time
    min1 = minute(time)
    hr1 = hour(time)
    if hr1 > 12 then
    hr1 = hr1 - 12
    end if
    sec1 = second(time)
    call sgSecondHand.Rotate(0,0,sec1*6 - 90)
    call sgMinuteHand.Rotate(0,0,min1*6 - 90)
    call sgHourHand.Rotate(0,0,hr1*360/12 - 90)
    call seq("Time").Play
    end Sub


    'Sequencer initilization

    Sub Seq_OnInit
    Call seq("Time").at(0.000, "SecRot", -1, 1.000, 1)
    Call seq("Time").at(60.000, "MinRot", -1, 60.000, 1)
    Call seq("Time").at(0.000, "HourRot", -1, 1800.000, 1)
    End Sub

    'rotates second hand of clock

    Sub SecRot
    Call sgSecondHand.Rotate(0,0,6)
    End Sub

    ' rotates minute hand of clock

    Sub MinRot
    Call sgMinuteHand.Rotate(0,0,6)
    End Sub

    ' rotates hour hand of clock

    Sub HourRot
    Call sgHourHand.Rotate(0,0,15)
    End Sub


    </script>



    <div id="MASTERLAYOUT" STYLE="POSITION:ABSOLUTE;WIDTH:300; HEIGHT:300;TOP:25%;LEFT:25%">



    <div id="divTimeText" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;z-index:2">








    <p align="center">

    <font face="Verdana,Tahoma,Arial" size="5" color="YELLOW">





    </font>

    </p>



    <OBJECT ID="SgNumbers"
    CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
    STYLE= "POSITION:ABSOLUTE; WIDTH:215; HEIGHT:200; TOP:0; LEFT:0;Z-INDEX:5">
    <PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
    <PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
    <PARAM NAME="Line0003" VALUE="SetFillStyle(1)">
    <PARAM NAME="Line0004" VALUE="SetFillColor(255,255,255)">
    <PARAM NAME="Line0005" VALUE="SetFont('ARIAL',24,650,0,0,0)">
    <PARAM NAME="Line0006" VALUE="Text('1',30,-66,0">
    <PARAM NAME="Line0007" VALUE="Text('2',60,-36,0">
    <PARAM NAME="Line0008" VALUE="Text('3',70,4,0">
    <PARAM NAME="Line0009" VALUE="Text('4',60,44,0">
    <PARAM NAME="Line0010" VALUE="Text('5',30,74,0">
    <PARAM NAME="Line0011" VALUE="Text('6',-10,89,0">
    <PARAM NAME="Line0012" VALUE="Text('7',-50,79,0">
    <PARAM NAME="Line0013" VALUE="Text('8',-85,44,0">
    <PARAM NAME="Line0014" VALUE="Text('9',-95,4,0">
    <PARAM NAME="Line0015" VALUE="Text('10',-85,-36,0">
    <PARAM NAME="Line0016" VALUE="Text('11',-60,-61,0">
    <PARAM NAME="Line0017" VALUE="Text('12',-20,-76,0">
    </OBJECT>

    </div>



    <OBJECT ID="sgBackground"
    CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
    STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200">
    <PARAM NAME="Line0001" VALUE="SetLineStyle(5)">
    <PARAM NAME="Line0002" VALUE="SetFillStyle(11)">
    <PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0,0,0,255)">
    <PARAM NAME="Line0004" VALUE="SetGradientFill(0,0,-100,-100,0)">
    <PARAM NAME="Line0005" VALUE="Oval(-100,-100,200,200,0)">
    </OBJECT>

    <div id="divClock" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;">



    <OBJECT ID="sgSecondHand"
    CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
    STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
    <PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
    <PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
    <PARAM NAME="Line0003" VALUE="SetFillColor(255,255,255)">
    <PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
    <PARAM NAME="Line0005" VALUE="Rect(-5,-2,100,4,0)">
    </OBJECT>



    <OBJECT ID="sgMinuteHand"
    CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
    STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
    <PARAM NAME="Line0001" VALUE="SetLineColor(255, 0, 0)">
    <PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
    <PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0)">
    <PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
    <PARAM NAME="Line0005" VALUE="Rect(-5,-3,85,6,0)">
    </OBJECT>



    <OBJECT ID="sgHourHand"
    CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
    STYLE="POSITION:ABSOLUTE; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
    <PARAM NAME="Line0001" VALUE="SetLineColor(0, 0, 255)">
    <PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
    <PARAM NAME="Line0003" VALUE="SetFillColor(0,0,255)">
    <PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
    <PARAM NAME="Line0005" VALUE="Rect(-5,-3,70,6,0)">
    </OBJECT>

    </div>
    </div>



    <OBJECT ID="Seq"
    CLASSID="CLSID:B0A6BAE2-AAF0-11d0-A152-00A0C908DB96">
    </OBJECT>

  2. #2
    Join Date
    Nov 2006
    Posts
    21

    Default

    Very Very Cool :D :D :D

  3. #3
    Join Date
    Mar 2005
    Posts
    44

    Default

    Javascript ? Are you kidding ?
    It's not Javascript, but VBscript, an old language which will only works in deprecated browsers.... :roll:

  4. #4
    Join Date
    Nov 2006
    Location
    Brighton / England
    Posts
    118

    Default

    hmm if you want a working clock you can simply create an html code with the www.timeanddate.com webpage.

    just defince your time here http://www.timeanddate.com/worldclock/setpersonal.html

    press on "save your configuration " then press on try new personalized world clock "
    then underneath the topic "Additional time-related services for ( your city ):"

    select the option : " Display a free clock for London on your web site or blog "

    which leads you to the html code generator for your city. Well for London it looks like this :
    http://www.timeanddate.com/clocks/free.html?n=136

    sounds complicated but once you visit the page you see what i mean 8)
    Oh well from this link you can still change the location ( http://www.timeanddate.com/clocks/free.html?n=136 )

    But its a great webpage if you dont have a watch or clock at home , only a computer :roll: :D

  5. #5
    Join Date
    Mar 2007
    Posts
    8

    Default

    Thanks, wery nice...

  6. #6
    Join Date
    Apr 2007
    Posts
    3

    Default

    thanks man ;-) nice thing

  7. #7
    Join Date
    Apr 2007
    Posts
    12

    Default

    thank you so much.
    its cool !!!!!!!

  8. #8
    Join Date
    Apr 2007
    Posts
    7

    Default

    Thank for all post too.

  9. #9
    Join Date
    Jun 2007
    Posts
    5

    Default

    wow!
    so cool!
    I like it!

  10. #10
    Join Date
    Jun 2007
    Posts
    17

    Default

    i cant see any thing. it didn't work on my site sad.... nvm thanks anyway btw how u figure those sense in tis long long codes?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •