jquery实现手表转动显示时间效果

代码语言:html

所属分类:动画

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

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

<title> Rolex Oyster Perpetual Submariner - pure HTML/CSS illustration</title>
<link rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/reset.min.css">
<style>
  /*
CSS isn't organized very well
*/
/* Text */
@import url("https://fonts.googleapis.com/css?family=Roboto:300i,400&display=swap");
/* Numerals */
@import url("https://fonts.googleapis.com/css?family=Chathura:800&display=swap");
/* Date */
@import url("https://fonts.googleapis.com/css?family=Krona+One&display=swap");
/* Rolex */
@import url("https://fonts.googleapis.com/css?family=Rhodium+Libre&display=swap");
/* Swiss Made */
@import url("https://fonts.googleapis.com/css?family=Montserrat:600&display=swap");
*, *:before, *:after {
  box-sizing: border-box;
}

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  -webkit-transform: scale(0.7);
          transform: scale(0.7);
}

/* Not sure where this is used */
i:before, i:after, .rolex:before, .rolex:after, .rolex .crown:before, .rolex .crown:after, .bezel .bezel-gradient:after, .bezel .bezel-gradient:before, .bezel-decor:before, .bezel-decor:after, .crystal:before, .crystal:after, .face:after, .face .sec:nth-of-type(1):after, .face .sec:nth-of-type(14):after, .content-upper .logo:before, .content-upper .logo:after, .content-upper .logo .logo-left:before,
.content-upper .logo .logo-right:before, .marker-triangle:before, .marker-triangle:after, .marker-square:before, .marker-square:after, .date:after, .hand-sec:after, .hand-sec:before, .hand-min:before, .hand-min span:after, .hand-hour:after, .hand-hour:before, .hand-hour span:before, .hand-hour span:after, .hand-hour span .hour-decor:after, .hand-hour span .hour-decor:before {
  content: '';
  display: block;
  position: absolute;
}

/* Circle marker details */
.bezel-decor:after, .markers-circle:before, .markers-circle:after {
  width: 26px;
  height: 26px;
  border-radius: 100%;
  background: #fff;
  box-shadow: inset 1px 1px 1px 0 #666, inset 2px 2px 7px 0 #aaa, 1px 1px 1px 0 #222;
  border: 2px solid #ccc;
}

.rolex, .rolex .band, .bezel .bezel-gradient, .bez-num, .bez-num li, .crystal, .crystal:before, .crystal:after, .face, .face:after, .marker-square, .hand-sec, .hand-min, .hand-hour {
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  margin: auto;
}

/* .bez, .sec */
i {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  margin: auto;
}
i:before, i:after {
  height: inherit;
  width: inherit;
  border-radius: inherit;
  -webkit-transform: rotateZ(calc(90deg));
          transform: rotateZ(calc(90deg));
}

/* ***********************

Start main code

*********************** */
/* Band and crown */
.rolex {
  position: absolute;
  width: 430px;
  height: 430px;
  /* Left and right container */
}
.rolex:before, .rolex:after {
  border-top: 210px solid transparent;
  border-bottom: 210px solid transparent;
  height: 500px;
  z-index: -1;
  top: -35px;
}
.rolex:before {
  border-right: 73px solid #e6e6e6;
  left: 5px;
  box-shadow: 30px 0 0 #e6e6e6;
}
.rolex:after {
  border-left: 73px solid #e6e6e6;
  right: 5px;
  box-shadow: -30px 0 0 #e6e6e6;
}
.rolex .band {
  position: absolute;
  height: 508px;
  width: 82px;
  background: #e6e6e6;
  box-shadow: -74px 0 0 -14px #e6e6e6, 74px 0 0 -14px #e6e6e6;
}
.rolex .crown {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  right: -30px;
  width: 30px;
  height: 76px;
  background: #e6e6e6;
  box-shadow: 20px 0 0 -10px #e6e6e6;
  /* Top and bottom of crown */
}
.rolex .crown:before, .rolex .crown:after {
  right: 16px;
}
.rolex .crown:before {
  top: 110px;
  border-top: 30px solid #e6e6e6;
  border-right: 40px solid transparent;
  box-shadow: 0 -28px 0 0 #e6e6e6;
  /* 6px margin */
}
.rolex .crown:after {
  bottom: 110px;
  border-left: 40px solid #e6e6e6;
  border-top: 30px solid transparent;
  box-shadow: 0 28px 0 0 #e6e6e6;
  /* 6px margin */
}

/* Bezel radius and face */
.bezel {
  width: inherit;
  height: inherit;
  background: linear-gradient(45deg, #f0f0f0 0%, #ddd 50%, #f0f0f0 100%);
  border-radius: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 6px #fff;
  /* Bezel face */
}
.bezel .bezel-gradient {
  position: absolute;
  overflow: hidden;
  height: 404px;
  width: 404px;
  border-radius: inherit;
  background: linear-gradient(90deg, #373D7D 0%, #2E305B 30%, #4B60A6 50%, #2E305B 60%, #4B60A6 100%);
  /* Main BG */
  box-shadow: 0 0 0 2px #272A51, -1px 0 6px 0 #fff;
  /* Shadow */
  /* Gradient shine decor */
  /* Gradient shine decor */
}
.bezel .bezel-gradient:after {
  height: 280px;
  width: 120px;
  right: 0;
  opacity: 0.6;
  background: linear-gradient(128deg, #373D7D 0%, #2E305B 22%, #5666AD 22%, #4B60A6 50%, rgba(40, 42, 80, 0) 90%);
}
.bezel .bezel-gradient:before {
  height: 300px;
  width: 148px;
  left: 0;
  top: 50px;
  opacity: 0.4;
  background: linear-gradient(-138deg, #373D7D 0%, #2E305B 22%, #5666AD 22%, #4B60A6 64%, rgba(40, 42, 80, 0) 70%);
}

/* Bezel indents */
.bez {
  opacity: 0.7;
  height: 18px;
  width: 18px;
  border-radius: inherit;
  box-shadow: 0 222px 0 0 #fff, 0 -222px 0 0 #fff, 2px 216.........完整代码请登录后点击上方下载按钮下载查看

网友评论0