js+css实现指针时钟显示时间代码

代码语言:html

所属分类:其他

代码描述:js+css实现指针时钟显示时间代码

代码标签: js css 指针 时钟 显示 时间 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
@font-face {
    font-family: 'Digital';
    src: url('http://www.ababsli.net/digital.woff') format('woff');
}

*{
	margin: 0;
	padding: 0;
}

body{
	background: black;
  font-family: 'Digital';
}

#dayOfWeek{
	position: absolute;
	color:#fff;
	font-size: 50px;
	width:80px;
	height: 555px;
	line-height: 555px;
	padding-left: 50px;
	color:#01c4c4;
	opacity: .9;
}

#date{
	position: absolute;
	right: 0;
	color:#fff;
	font-size: 40px;
	width:150px;
	height: 555px;
	line-height: 555px;
	color:#01c4c4;
	opacity: .9;
	padding-right: 20px;
}

#digital{
	position: absolute;
	bottom: 0;
	color:#fff;
	font-size: 90px;
	width: 555px;
	height: 130px;
	line-height: 65px;
	color:#01c4c4;
	text-align: center;
	opacity: .9;
}
#hourHand{
	transform-origin: bottom center;
	height: 170px;
	width: 12px;
	position: absolute;
	top: 19.3%;
	left: 48.9%;
	background-color:#01c4c4;
	opacity: .6;
	border-radius: 7px;
}

#minuteHand{
	transform-origin: bottom center;
	height: 200px;
	width: 8px;
	position: absolute;
	top: 13.5%;
	left: 49.2%;
	background-color:#01c4c4;
	opacity: .6;
	border-radius: 7px;
}
#circle{
	width: 25px;
	height: 25px;
	position: relative;
	margin: 262.75px auto;
	border-radius: 50%;
	background-color:#01c4c4;
}
#secondHand{
	transform-origin: bottom center;
	
	height: 220px;
	width: 5px;
	position: absolute;
	top: 10%;
	left: 49.5%;
	background-color:#01c4c4;
	opacity: .7;
	border-radius: 3px;
}

#clock-wrap{
	color:#fff;
	position:relative;
	margin: 50px auto;
	width:555px;
	height: 555px;
	border:20px solid #019394;
	border-radius: 50%;
	box-shadow: 0 0 0px 10px #007874, inset 0 0 0px 7px #01c4c4;
}

.numbers-12{
 	position: absolute;
 	top:6px;
 	left: 49%;
	width:10px;
	height:17px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	background:#01c4c4;
}

.numbers-3{
	transform:rotate(90deg);
 	position: absolute;
 	top:48%;
 	right: 8px;
	width:10px;
	height:17px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	background:#01c4c4;
}
.numbers-6{
	transform:rotate(180deg);
 	position: absolute;
 	left:49%;
 	bottom: 6px;
	width:10px;
	height:17px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	background:#01c4c4;
}
.numbers-9{
	transform:rotate(270deg);
 	position: absolute;
 	left:8px;
 	top:48%;
	width:10px;
	height:17px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
	background:#01c4c4;
}
</style>


</head>


  <body onload="startClock()">

	<div id="clock-wrap">
		<!-- Day of week {-->
		<div id="dayOfWeek"></div>
		<.........完整代码请登录后点击上方下载按钮下载查看

网友评论0