css+js实现数字闹钟鼠标悬浮到点摇动摆动动画效果代码

代码语言:html

所属分类:动画

代码描述:css+js实现数字闹钟鼠标悬浮到点摇动摆动动画效果代码

代码标签: css 数字 闹钟 鼠标 悬浮 到点 摇动 摆动 动画

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


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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
*, *::before, *::after {
  content: "";
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  flex-direction: column;
  font-size: 1.3em;
  font-weight: bold;
  font-family: monospace;
  color: white;
  background-color: #fff480;
  display: flex;
  justify-content: center;
  align-items: center;
}

span {
  color: #262626;
  position: absolute;
  bottom: 10%;
}

.clock {
  height: 60px;
  width: 120px;
  border: 3px solid black;
  border-radius: 2px;
  background-color: #b4ffdc;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: scale(1.5);
}
.clock:hover {
  animation: alarm 0.1s infinite;
}
.clock::before {
  height: 30px;
  width: 6.6666666667px;
  position: absolute;
  border-radius: 0 2px 2px 0;
  transform: translateX(63.1578947368px);
  background-image: repeating-linear-gradient(#595959 0 1%, black 0 1.5%);
}
.clock::after {
  height: 4px;
  width: 30px;
  position: absolute;
  background-image: linear-gradient(to right, #262626 0 40%, transparent 0 60%, #262626 0 100%);
  transform: translateY(-31.914893617px) translateX(-30px);
}

p {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 104.347826087px;
  border: 5px solid black;
  border-radius: 2px;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0