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
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;
I
{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
J
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
}
}
The function changePosition ()
{
for(let i=0; I
{
For (let j=0;
J
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%
}