Draggable实现保险箱实体密码旋钮效果代码

代码语言:html

所属分类:拖放

代码描述:Draggable实现保险箱实体密码旋钮效果代码

代码标签: 实体 密码 旋钮 效果

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


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

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
body {
  background: #fff;
  counter-reset: inc -5;
  font-family: Open Sans, sans-serif;
  display: flex;
  display: -webkit-flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  justify-content: center;
  -webkit-justify-content: center;
  align-items: center;
  -webkit-align-items: center;
  height: 100vh;
  overflow: hidden;
}

.container {
  margin-bottom: 18px;
  position: relative;
  height: 270px;
  width: 180px;
}

.lock, .dial {
  border-radius: 50%;
}

.arrow, .dial {
  margin: auto;
}

.shackle, .dial, .tick {
  position: absolute;
}

.lock {
  background: #aaa;
  position: absolute;
  bottom: 0;
  height: 180px;
  width: 180px;
}

.shackle {
  bottom: 108px;
  right: 22.5px;
  width: 135px;
  height: 168.75px;
  will-change: transform;
  z-index: -1;
}
.shackle div {
  background: #999999;
  position: absolute;
  will-change: transform;
}
.shackle .top {
  border-radius: 135px 135px 0 0;
  height: 67.5px;
  width: 135px;
  transform-origin: 100% 0;
}
.shackle .inner {
  background: #fff;
  border-radius: 50%;
  top: 33.75px;
  left: 33.75px;
  height: 67.5px;
  width: 67.5px;
}
.shackle .left, .shackle .right {
  top: 66.5px;
  width: 33.75px;
}
.shackle .left {
  border-radius: 0 0 6.75px 6.75px;
  height: 94.5px;
  overflow: hidden;
  position: relative;
}
.shackle .left .dentL, .shackle .left .dentR {
  position: absolute;
  bottom: 16.875px;
  z-index: 2;
}
.shackle .left .dentL {
  border-top: 15px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 15px solid #fff;
  left: -30px;
}
.shackle .left .dentR {
  border-top: 15px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 15px solid #fff;
  right: 0;
}
.shackle .right {
  right: 0;
  height: 135px;
}

.arrow {
  border: 7.5px solid transparent;
  border-color: #a00 transparent transparent transparent;
  margin-top: 11.25px;
  margin-bottom: 3px;
  transform: translateY(7.5px);
  height: 0;
  width: 0;
}

.dial {
  background: #333 radial-gradient(transparent, transparent 30px, #1a1a1a 30px, #1a1a1a 32.25px, transparent 32.25px, transparent);
  font-family: Helvetica, sans-serif;
  left: 0;
  right: 0;
  bottom: 7.2px;
  position: absolute;
  height: 144px;
  width: 144px;
  transform: rotate(0deg);
  will-change: transform;
  z-index: 1;
}

.tick {
  background: #fff;
  color: #fff;
  font-size: 15px;
  top: 72px;
  left: 70.5px;
  width: 3px;
  height: 9px;
  transform-origin: 50% -63px;
}
.tick::before {
  display: block;
  margin: -18px -18px 0 -18px;
  text-align: center;
  transform: rotate(180deg);
}
.tick:nth-of-type(1) {
  transform: translateY(63px) rotate(180deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(180deg);
}
.tick:nth-of-type(1)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(2) {
  transform: translateY(63px) rotate(189deg);
}
.tick:nth-of-type(3) {
  transform: translateY(63px) rotate(198deg);
}
.tick:nth-of-type(4) {
  transform: translateY(63px) rotate(207deg);
}
.tick:nth-of-type(5) {
  transform: translateY(63px) rotate(216deg);
}
.tick:nth-of-type(6) {
  transform: translateY(63px) rotate(225deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(225deg);
}
.tick:nth-of-type(6)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(7) {
  transform: translateY(63px) rotate(234deg);
}
.tick:nth-of-type(8) {
  transform: translateY(63px) rotate(243deg);
}
.tick:nth-of-type(9) {
  transform: translateY(63px) rotate(252deg);
}
.tick:nth-of-type(10) {
  transform: translateY(63px) rotate(261deg);
}
.tick:nth-of-type(11) {
  transform: translateY(63px) rotate(270deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(270deg);
}
.tick:nth-of-type(11)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(12) {
  transform: translateY(63px) rotate(279deg);
}
.tick:nth-of-type(13) {
  transform: translateY(63px) rotate(288deg);
}
.tick:nth-of-type(14) {
  transform: translateY(63px) rotate(297deg);
}
.tick:nth-of-type(15) {
  transform: translateY(63px) rotate(306deg);
}
.tick:nth-of-type(16) {
  transform: translateY(63px) rotate(315deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(315deg);
}
.tick:nth-of-type(16)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(17) {
  transform: translateY(63px) rotate(324deg);
}
.tick:nth-of-type(18) {
  transform: translateY(63px) rotate(333deg);
}
.tick:nth-of-type(19) {
  transform: translateY(63px) rotate(342deg);
}
.tick:nth-of-type(20) {
  transform: translateY(63px) rotate(351deg);
}
.tick:nth-of-type(21) {
  transform: translateY(63px) rotate(360deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(360deg);
}
.tick:nth-of-type(21)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(22) {
  transform: translateY(63px) rotate(369deg);
}
.tick:nth-of-type(23) {
  transform: translateY(63px) rotate(378deg);
}
.tick:nth-of-type(24) {
  transform: translateY(63px) rotate(387deg);
}
.tick:nth-of-type(25) {
  transform: translateY(63px) rotate(396deg);
}
.tick:nth-of-type(26) {
  transform: translateY(63px) rotate(405deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(405deg);
}
.tick:nth-of-type(26)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(27) {
  transform: translateY(63px) rotate(414deg);
}
.tick:nth-of-type(28) {
  transform: translateY(63px) rotate(423deg);
}
.tick:nth-of-type(29) {
  transform: translateY(63px) rotate(432deg);
}
.tick:nth-of-type(30) {
  transform: translateY(63px) rotate(441deg);
}
.tick:nth-of-type(31) {
  transform: translateY(63px) rotate(450deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(450deg);
}
.tick:nth-of-type(31)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(32) {
  transform: translateY(63px) rotate(459deg);
}
.tick:nth-of-type(33) {
  transform: translateY(63px) rotate(468deg);
}
.tick:nth-of-type(34) {
  transform: translateY(63px) rotate(477deg);
}
.tick:nth-of-type(35) {
  transform: translateY(63px) rotate(486deg);
}
.tick:nth-of-type(36) {
  transform: translateY(63px) rotate(495deg);
  height: 18px;
  transform-origin: 50% -54px;
  transform: translateY(54px) rotate(495deg);
}
.tick:nth-of-type(36)::before {
  counter-increment: inc 5;
  content: counter(inc);
}
.tick:nth-of-type(37) {
  transform: translateY(63px) rotate(504deg);
}
.tick:nth-of-type(38) {
  transform: translateY(63px) rotate(513deg);
}
.tick:nth-of-type(39) {
  transform: translateY(63px) rotate(522deg);
}
.tick:nth-of-type(40) {
  transform: translateY(63px) rotate(531deg);
}

.combo {
  font-size: 22.5px;
  text-align: center;
}
.combo span {
  background: #ccc;
  display: inline-block;
  line-height: 30px;
  padding: 7.5px;
  width: 30px;
  height: 30px;
  vertical-align: middle;
}
.combo span.found {
  background: #262;
  color: #fff;
}

/* Animation classes */
.unlocked {
  animation: moveUp 0.2s linear forwards, moveUp 0.2s 2s linear reverse forwards;
}

.moveLeft {
  animation: moveLeft 0.5s 0.4s linear forwards, moveLeft 0.5s 1.2s li.........完整代码请登录后点击上方下载按钮下载查看

网友评论0