css+js实现时钟特效

代码语言:html

所属分类:动画

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<title>Fluid Width Working Clock </title>
<style>
      body {
  margin: 0;
}
/* The .page-wrap centers the clock on the page*/
.page-wrap {
  background-color: #EEE;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #777;
}
/* The .container creates spacing around the clock and the viewport edges */
.container {
  width: 70%;
  max-width: 600px;
  min-width: 250px;
}
/* This div makes sure the clock stays square while adjusting to screen width */
.aspect-ratio-container {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
}
/* This is a background that serves as a border */
.clock-border {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 7%; /* Width of the clock border */
}
/* This gives the border and middle button a matching gradient */
.clock-border,
.center-button {
  background-image: linear-gradient(to right, #225378, #1695A3);
}
/* This gives the border, middle button and hands a matching box-shadow */
.clock-border,
.center-button,
.clock-hands li {
  box-shadow: 0 3px 4px 0 rgba(0,0,0,.14), 0 3px 3px -2px rgba(0,0,0,.2);
}
/* This rounds everything that should be round */
.clock-border,
.clock-face,
.clock-face ul {
  border-radius: 50%;
}
/* This contains our clock hands and numbers */
.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #FFF;
}
/* Style the numbers ul and the hands ul to lay on top of eachother and cover t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0