Вход Регистрация
* SysTeam.exe

Часы с календарем

  1. <html>
  2. <head>
  3. <title>Часы
  4. круглые</title>
  5. </head>
  6. <body>
  7. <SCRIPT
  8. language=JavaScript>
  9. dCol='0099FF';//
  10. Цветкалендаря.
  11. fCol='00FF00';//
  12. Цветцифреблата.
  13. sCol='FF0000';//
  14. Цветсекундной
  15. стрелки.
  16. mCol='FFFF00';//
  17. Цветминутной
  18. стрелки.
  19. hCol='FFFF00';//
  20. Цветчасовой
  21. стрелки.
  22. ClockHeight=40;
  23. ClockWidth=40;
  24. ClockFromMouseY=0;
  25. ClockFromMouseX=100;
  26. /*Календарьдни
  27. неделимесяца,
  28. принеобходимости
  29. можнозадать
  30. другойязыки
  31. другойтекст*/
  32. d=newArray
  33. ("Сегодня
  34. воскресенье","Сегодня
  35. понедельник","Сегодня
  36. вторник","Сегодня
  37. среда","Сегодня
  38. четверг","Сегодня
  39. пятница","Сегодня
  40. субота");
  41. m=newArray
  42. ("января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря");
  43. date=newDate();
  44. ();
  45. year=date.getYear
  46. ();
  47. if(year<2000)
  48. year=year+1900;
  49. TodaysDate=""+d
  50. [date.getDay()]+"
  51. "+day+""+m
  52. [date.getMonth
  53. ()]+""+year;
  54. D=TodaysDate.split
  55. ('');
  56. H='...';
  57. H=H.split('');
  58. M='....';
  59. M=M.split('');
  60. S='.....';
  61. S=S.split('');
  62. Face='123456
  63. 789101112';
  64. //font='Arial';
  65. font='Verdana';
  66. size=1;
  67. speed=0.6;
  68. ns=
  69. (document.layers);
  70. ie=
  71. (document.all);
  72. Face=Face.split('
  73. ');
  74. n=Face.length;
  75. a=size*10;
  76. ymouse=0;
  77. xmouse=0;
  78. scrll=0;
  79. props="<font
  80. face="+font+"
  81. size="+size+"
  82. color="+fCol
  83. +"><B>";
  84. props2="<font
  85. face="+font+"
  86. size="+size+"
  87. color="+dCol
  88. +"><B>";
  89. Split=360/n;
  90. Dsplit=360/
  91. D.length;
  92. HandHeight=ClockHeight/4.5
  93. HandWidth=ClockWidth/4.5
  94. HandY=-7;
  95. HandX=-2.5;
  96. scrll=0;
  97. step=0.06;
  98. currStep=0;
  99. y=newArray
  100. ();x=newArray
  101. ();Y=newArray
  102. ();X=newArray();
  103. for(i=0;i<n;
  104. i++){y[i]=0;x
  105. [i]=0;Y[i]=0;X
  106. [i]=0}
  107. Dy=newArray
  108. ();Dx=newArray
  109. ();DY=newArray
  110. ();DX=newArray
  111. ();
  112. for(i=0;i<
  113. D.length;i++){Dy
  114. [i]=0;Dx[i]=0;DY
  115. [i]=0;DX[i]=0}
  116. if(ns){
  117. for(i=0;i<
  118. D.length;i++)
  119. document.write
  120. ('<layer
  121. name="nsDate'+i
  122. +'"top=0left=0
  123. height='+a+'
  124. width='+a
  125. +'><center>'+props2+D
  126. [i]+'</font></
  127. center></
  128. layer>');
  129. for(i=0;i<n;
  130. i++)
  131. document.write
  132. ('<layer
  133. name="nsFace'+i
  134. +'"top=0left=0
  135. height='+a+'
  136. width='+a
  137. +'><center>'+props
  138. +Face[i]+'</
  139. font></center></
  140. layer>');
  141. for(i=0;i<
  142. S.length;i++)
  143. document.write
  144. ('<layer
  145. name=nsSeconds'+i
  146. +'top=0left=0
  147. width=15
  148. height=15><font
  149. face=Arialsize=3
  150. color='+sCol
  151. +'><center><b>'+S
  152. [i]+'</b></
  153. center></font></
  154. layer>');
  155. for(i=0;i<
  156. M.length;i++)
  157. document.write
  158. ('<layer
  159. name=nsMinutes'+i
  160. +'top=0left=0
  161. width=15
  162. height=15><font
  163. face=Arialsize=3
  164. color='+mCol
  165. +'><center><b>'+M
  166. [i]+'</b></
  167. center></font></
  168. layer>');
  169. for(i=0;i<
  170. H.length;i++)
  171. document.write
  172. ('<layer
  173. name=nsHours'+i+'
  174. top=0left=0
  175. width=15
  176. height=15><font
  177. face=Arialsize=3
  178. color='+hCol
  179. +'><center><b>'+H
  180. [i]+'</b></
  181. center></font></
  182. layer>');
  183. }
  184. if(ie){
  185. document.write
  186. ('<divid="Od"
  187. style="position:absolute;top:0px;left:0px"><div
  188. style="position:relative">');
  189. for(i=0;i<
  190. D.length;i++)
  191. document.write
  192. ('<div
  193. id="ieDate"
  194. style="position:absolute;top:0px;left:0;height:'+a
  195. +';width:'+a
  196. +';text-
  197. align:center">'+props2+D
  198. [i]+'</B></
  199. font></div>');
  200. document.write
  201. ('</div></div>');
  202. document.write
  203. ('<divid="Of"
  204. style="position:absolute;top:0px;left:0px"><div
  205. style="position:relative">');
  206. for(i=0;i<n;
  207. i++)
  208. document.write
  209. ('<div
  210. id="ieFace"
  211. style="position:absolute;top:0px;left:0;height:'+a
  212. +';width:'+a
  213. +';text-
  214. align:center">'+props
  215. +Face[i]+'</B></
  216. font></div>');
  217. document.write
  218. ('</div></div>');
  219. document.write
  220. ('<divid="Oh"
  221. style="position:absolute;top:0px;left:0px"><div
  222. style="position:relative">');
  223. for(i=0;i<
  224. H.length;i++)
  225. document.write
  226. ('<div
  227. id="ieHours"
  228. style="position:absolute;width:16px;height:16px;font-
  229. family:Arial;font-
  230. size:16px;color:'+hCol
  231. +';text-
  232. align:center;font-
  233. weight:bold">'+H
  234. [i]+'</div>');
  235. document.write
  236. ('</div></div>');
  237. document.write
  238. ('<divid="Om"
  239. style="position:absolute;top:0px;left:0px"><div
  240. style="position:relative">');
  241. for(i=0;i<
  242. M.length;i++)
  243. document.write
  244. ('<div
  245. id="ieMinutes"
  246. style="position:absolute;width:16px;height:16px;font-
  247. family:Arial;font-
  248. size:16px;color:'+mCol
  249. +';text-
  250. align:center;font-
  251. weight:bold">'+M
  252. [i]+'</div>');
  253. document.write
  254. ('</div></div>')
  255. document.write
  256. ('<divid="Os"
  257. style="position:absolute;top:0px;left:0px"><div
  258. style="position:relative">');
  259. for(i=0;i<
  260. S.length;i++)
  261. document.write
  262. ('<div
  263. id="ieSeconds"
  264. style="position:absolute;width:16px;height:16px;font-
  265. family:Arial;font-
  266. size:16px;color:'+sCol
  267. +';text-
  268. align:center;font-
  269. weight:bold">'+S
  270. [i]+'</div>');
  271. document.write
  272. ('</div></div>')
  273. }
  274. (ns)?
  275. window.captureEvents
  276. (Event.MOUSEMOVE):0;
  277. functionMouse
  278. (evnt){
  279. ymouse=(ns)?
  280. evnt.pageY
  281. +ClockFromMouseY-
  282. (window.pageYOffset):event.y
  283. +ClockFromMouseY;
  284. xmouse=(ns)?
  285. evnt.pageX
  286. +ClockFromMouseX:event.x
  287. +ClockFromMouseX;
  288. }
  289. (ns)?
  290. window.onMouseMove=Mouse:document.onmousemove=Mouse;
  291. function
  292. ClockAndAssign(){
  293. time=newDate
  294. ();
  295. secs=
  296. time.getSeconds
  297. ();
  298. sec=-1.57+
  299. Math.PI*
  300. secs/30;
  301. mins=
  302. time.getMinutes
  303. ();
  304. min=-1.57+
  305. Math.PI*
  306. mins/30;
  307. hr=
  308. time.getHours();
  309. hrs=-1.575+
  310. Math.PI*
  311. hr/6+Math.PI*parseInt
  312. (time.getMinutes
  313. ())/360;
  314. if(ie){
  315. Od.style.top=window.document.body.scrollTop;
  316. Of.style.top=window.document.body.scrollTop;
  317. Oh.style.top=window.document.body.scrollTop;
  318. Om.style.top=window.document.body.scrollTop;
  319. Os.style.top=window.document.body.scrollTop;
  320. }
  321. for(i=0;i<n;
  322. i++){
  323. varF=(ns)?
  324. document.layers
  325. ['nsFace'+i]:ieFace
  326. [i].style;
  327. F.top=y[i]+
  328. ClockHeight*Math.sin
  329. (-1.0471+
  330. i*Split*Math.PI/180)+scrll;
  331. F.left=x[i]+
  332. ClockWidth*Math.cos
  333. (-1.0471+
  334. i*Split*Math.PI/180);
  335. }
  336. for(i=0;i<
  337. H.length;i++){
  338. varHL=(ns)?
  339. document.layers
  340. ['nsHours'+i]:ieHours
  341. [i].style;
  342. HL.top=y[i]+HandY
  343. +(i*HandHeight)*Math.sin
  344. (hrs)+scrll;
  345. HL.left=x
  346. [i]+HandX
  347. +(i*HandWidth)*Math.cos
  348. (hrs);
  349. }
  350. for(i=0;i<
  351. M.length;i++){
  352. varML=(ns)?
  353. document.layers
  354. ['nsMinutes'+i]:ieMinutes
  355. [i].style;
  356. ML.top=y[i]+HandY
  357. +(i*HandHeight)*Math.sin
  358. (min)+scrll;
  359. ML.left=x
  360. [i]+HandX
  361. +(i*HandWidth)*Math.cos
  362. (min);
  363. }
  364. for(i=0;i<
  365. S.length;i++){
  366. varSL=(ns)?
  367. document.layers
  368. ['nsSeconds'+i]:ieSeconds
  369. [i].style;
  370. SL.top=y[i]+HandY
  371. +(i*HandHeight)*Math.sin
  372. (sec)+scrll;
  373. SL.left=x
  374. [i]+HandX
  375. +(i*HandWidth)*Math.cos
  376. (sec);
  377. }
  378. for(i=0;i<
  379. D.length;i++){
  380. varDL=(ns)?
  381. document.layers
  382. ['nsDate'+i]:ieDate
  383. [i].style;
  384. DL.top=Dy[i]+
  385. ClockHeight*1.5*Math.sin
  386. (currStep
  387. +i*Dsplit*Math.PI/180)+scrll;
  388. DL.left=Dx[i]+
  389. ClockWidth*1.5*Math.cos
  390. (currStep
  391. +i*Dsplit*Math.PI/180);
  392. }
  393. currStep-=step;
  394. }
  395. functionDelay(){
  396. scrll=(ns)?
  397. window.pageYOffset:0;
  398. Dy[0]=Math.round
  399. (DY[0]+=
  400. ((ymouse)-DY
  401. [0])*speed);
  402. Dx[0]=Math.round
  403. (DX[0]+=
  404. ((xmouse)-DX
  405. [0])*speed);
  406. for(i=1;i<
  407. D.length;i++){
  408. Dy[i]=Math.round
  409. (DY[i]+=(Dy[i-1]-
  410. DY[i])*speed);
  411. Dx[i]=Math.round
  412. (DX[i]+=(Dx[i-1]-
  413. DX[i])*speed);
  414. }
  415. y[0]=Math.round(Y
  416. [0]+=((ymouse)-Y
  417. [0])*speed);
  418. x[0]=Math.round(X
  419. [0]+=((xmouse)-X
  420. [0])*speed);
  421. for(i=1;i<n;
  422. i++){
  423. y[i]=Math.round(Y
  424. [i]+=(y[i-1]-Y
  425. [i])*speed);
  426. x[i]=Math.round(X
  427. [i]+=(x[i-1]-X
  428. [i])*speed);
  429. }
  430. ClockAndAssign();
  431. setTimeout('Delay
  432. ()',20);
  433. }
  434. if(ns||
  435. ie)window.onload=Delay;
  436. </SCRIPT>
  437. </body>
  438. </html>
» Описание: Очень красивый
JavaScript! За курсором мыши
движется круглый циферблат
с идущими аналоговыми
часами,
» Время добавления: 13 Авг 2014 в 11:33
» Посмотров: 1163
» textarea
» Рейтинг: [+1 | -0]
Комментарии [0]
Онлайн: 0
Реклама