div+js实现精致时钟显示时间指针走动效果代码

代码语言:html

所属分类:其他

代码描述:div+js实现精致时钟显示时间指针走动效果代码

代码标签: div js 精致 时钟 显示 时间 指针 走动

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

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

<head>
  <meta charset="UTF-8">
  

  
  
<style>
/*-------------------------*\
|
| ***** GENERAL
|
\*-------------------------*/

html
{
  width: 100%;
  height: 100%;
}

body
{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: linear-gradient(-45deg, #200 0%, rgb(223, 44, 44) 100%);
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  cursor: default;
  overflow: hidden;
  user-select: none;
}

.clock
{
  position: relative;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at 25% 25%, #fff 0%, #ccc 50%, #666 100%);
  border-radius: 100%;
  box-shadow: 20px 20px 40px rgba(0, 0, 0, 0.75);
}

.clock .border.front
{
  position: absolute;
  top: -50px;
  left: -50px;
  filter: drop-shadow(7.5px 7.5px 2.5px rgba(0, 0, 0, 0.75));
}

.clock .border.side
{
  position: absolute;
  top: -47.5px;
  left: -47.5px;
}

/*-------------------------*\
|
| ***** AXE
|
\*-------------------------*/

.clock .axe
{
  position: absolute;
  top: 50%;
  left: 50%;
}

.clock .needle
{
  position: absolute;
  bottom: -2px;
  left: -2.........完整代码请登录后点击上方下载按钮下载查看

网友评论0