跟随鼠标表情变化效果

代码语言:html

所属分类:动画

代码描述:跟随鼠标表情变化效果

代码标签: 变化 效果

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

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

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #2d7a9c;
}
.face {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: #ffcc09;
  justify-content: center;
  align-items: center;
}
.face::before {
  content: '';
  position: absolute;
  top: 180px;
  width: 150px;
  height: 70px;
  background: #b57700;
  left: 74.3px;
  border-bottom-left-radius: 70px;
  border-bottom-right-radius: 70px;
  transition: 0.5s;
}
.face:hover::before {
   top: 210px;
  width: 150px;
  height: 20px;
  background: #b57700;
  left: 74.3px;
  border-bottom-left-radius: 0px;
  border-bottom-right-radius: 0px;
}
.eyes {
  position: relative;
  top: 58px;
  left: 40px;
  display: flex;
}
.eyes .eye {
  position: relative;
  width: 80px;
  height: 80px;
  display: block;
  background: #fff;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0