Home > database >  Big brand how to set up the computer compass clock
Big brand how to set up the computer compass clock

Time:09-24

Code all had, just don't know how to set up,
Var monthText=[" month ", "February", "march", "April", "may", "June", "July", "August", "September", "October", "November", "December"].
Var dayText=[" and ", "we", "three", "and four", "five", "number and six", "number 7", "no. 08", "number nine", "10", "11", "12", "13", "14", "15", "16" and "17", "18", "19", "20", "21st", "22", "twenty-third", "24", "25", "26", "27", "28", "29", "30", "31"].
Var weekText=[" Sunday ", "Monday" and "Tuesday", "on Wednesday", "Thursday", "Friday", "Saturday"].
Var hourText=[" zero ", "zero point", "zero points", "zero at 3 o 'clock," "zero" at four o 'clock, "zero points", "zero" six, "zero" at seven o 'clock, "zero" at eight o 'clock, "zero nine", "zero" ten, "11", "twelve", "thirteen" and "fourteen points", "ten five" and "sixteen," "ten seven", "ten eight", "39 points", "2" ten, "blackjack", "2" twelve o 'clock, "twenty three o 'clock"].
Var minuteText=[" and ", "zero dichotomy", "three points", "four points", "five points", "and six points", "7 points", "zero eight", "nine points", "zero is", "11 points", "twelve", "13", "fourteen points", "15 points", "16 points", "17 points", "ten eight", "19 points", "20", "21 points", "twenty-two," "23 points", "24 points", "twenty-five points", "26 points", "27 points," "twenty eight", "29 points", "be", "31 points", "three to twelve", "33 points", "34 points", "35 points," "36 points", "37 points", "thirty eight", "39 points", "four very", "41 points," "minutes", "43 points", "44 points", "45 points", "46 points", "47 points", "forty eight", "49 points", "50", "51 points", "five minutes", "53 points", "54 points", "55 points", "56 points", "three minutes", "fifty eight", "59 points", "six very"].
Var secondsText=[" and a second ", "02 seconds", "three second", "four seconds", "five seconds," "and six seconds," "zero 7", "08 second", "nine seconds", "ten seconds," "11 seconds", "twelve seconds", "13 seconds," "14 seconds", "fifteen seconds," "16 seconds", "17 seconds", "eighteen seconds," "19 seconds," "twenty seconds," "21 seconds", "22 seconds," "23 seconds," "24 seconds", "twenty-five seconds", "26 seconds," "27 seconds," "28 seconds," "29 seconds", "thirty seconds," "thirty seconds," "32 seconds", "33 seconds," "34 seconds", "35 seconds," "36 seconds," "37 seconds", "38 seconds", "39 seconds", "40 seconds," "41 seconds", "42 seconds", "43 seconds", "44 seconds", "45 seconds," "46 seconds," "47 seconds," "48 seconds", "49 seconds", "fifty seconds", "51 seconds", "52 seconds", "53 seconds", "fifty-four second", "55 seconds", "56 seconds," "57 seconds," "58 seconds", "59 seconds", "sixty seconds"].
Var clock; Var monthList=[];
Var zhongList=[];
Var dayList=[];
Var weekList=[];
Var hourList=[];
Var minuteList=[];
Var secondsList=[];
Var isCircle=false;
Var textSet=[[monthText monthList],
[dayText, dayList],
[weekText, weekList],
[hourText, hourList],
[minuteText, minuteList],
[secondsText, secondsList]];
Window. &western nl &western AD=function ()
{
The init ();
SetInterval (function ()
{the runTime ();
}, 100);
ChangePosition ();
SetTimeout (function ()
{changeCircle ();
}, 2000);
}
The function the init ()
{clock=document. GetElementById (" clock ");
for(var i=0;
I{the for (var j=0; J{var temp=createLabel (textSet [I] [0] [j]);
Clock. The appendChild (temp); TextSet [I] [1]. Push (temp);
}
}
}
The function createLabel (text)
{
Var div=document. The createElement method (' div ');
Div. ClassList. Add (" label ");
Div. The innerText=text; Return div.
}
The function the runTime ()
{
Var now=new Date ();
Var month=now. GetMonth ();
Var day=now. GetDate ();
Var week=now. GetDay ();
Var hour=now. GetHours ();
Var minute=now. GetMinutes ();
Var seconds=now. GetSeconds ();
InitStyle ();
Var nowValue=https://bbs.csdn.net/topics/[month, day 1, week, hour, minute, seconds];
for(var i=0;
II++)
{var num=nowValue [I];
TextSet [I] [1] [num] style. Color='# FFF';
}
If (isCircle)
{var widthMid=document. Body. ClientWidth/2;
Var heightMid=document. Body. ClientHeight/2;
for(var i=0;
I{i++) for (var j=0;
JJ++) {var r=35 + (I + 1) * 50 * I;
Var deg=360/textSet [I] [1]. The length * (j - nowValue [I]);
Var x=r * Math. Sin (deg * Math. PI/180) + widthMid;
Var y=heightMid - r * Math. Cos (deg * math.h PI/180);
Var temp=textSet [I] [1] [j];
Temp. Style. Transform='rotate (' + + deg (90) +' deg) ';
The temp. Style. Left=x + 'px';
Temp. Style. The top=y + 'px';
}
}
}
}
The function initStyle ()
{var label=document. GetElementsByClassName (" label ");
for(var i=0;
I{label [I]. Style. Color='# 4 d4d4d';
}
}
The function changePosition ()
{
for(let i=0; II++)
{
For (let j=0;
JJ++) {
Let tempX=textSet [I] [1] [j]. Journal of offsetLeft + "px";
Let tempY=textSet [I] [1] [j]. J offsetTop + "px";
SetTimeout (function () {
TextSet [I] [1] [j]. Journal of style. The position="absolute";
TextSet [I] [1] [j]. J style.css. Left=tempX; TextSet [I] [1] [j]. Journal of style. The top=tempY;
}, 50);
}
}
}
The function changeCircle ()
{
IsCircle=true;
Clock. Style. The transform="rotate (90 deg)";
}
* {
margin:0;
Padding: 0
}
HTML, body {
width:100%;
height:100%;
Background - color: # 000;
Overflow: hidden
}
# clock {
position:relative;
width:100%;
height:100%;
Background: # 000
}
The label {
display:inline-block;
Color: # 4 d4d4d;
text-align:center;
Padding: 0 px;
The font - size: 19 px;
The transition: left 1 s and 1 s top;
The transform - origin: 0% 0%
}


<meta charset="UTF-8">
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="ie=edge" & gt;
A compass clock & lt;/title> <br/><br/><link rel="stylesheet" href="https://bbs.csdn.net/topics/clock.css" & gt; nullnullnullnullnullnullnullnullnullnullnull </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/database/25761.html" target="_blank" style="color:#999">https//www.codepudding.com/database/25761.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/database/25760.html'>In SQL how to compare two two columns of data values in the table are the same then take care about</a></div> <div class="detail-arr-right">Next:<a href='/database/25762.html'>The eldest brother a question</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=The+base+class' target='_blank'>The base class</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>