TweenMax实现三维卡通人脸表情跟随盯着鼠标交互效果代码

代码语言:html

所属分类:其他

代码描述:TweenMax实现三维卡通人脸表情跟随盯着鼠标交互效果代码

代码标签: TweenMax 三维 卡通 人脸 表情 跟随 盯着 鼠标 交互

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

<!DOCTYPE html>
<html lang="en" >
<head>
 
<meta charset="UTF-8">
<style>
    * {
  box-sizing: border-box;
}
*::before, *::after {
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  background: #fbf6e6;
}

#container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.25rem;
  height: 6.25rem;
}

button {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  border: 0;
  vertical-align: middle;
}
button.face-button {
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 50%;
  background: #fdda5f;
  box-shadow: inset 2px -4px 18px #fd9744;
}

.face-container {
  position: relative;
  display: block;
  width: 40px;
  height: 20px;
  margin: auto;
}

.eye {
  position: absolute;
  height: 0.5rem;
  width: 0.5rem;
  background: #2a2927;
  border-radius: 50%;
  -webkit-animation: eyeBlink 3200ms linear infinite;
          animation: eyeBlink 3200ms linear infinite;
}
.eye.left {
  left: 0;
}
.eye.right {
  left: 2rem;
}

.mouth {
  position: absolute;
  top: 1.125rem;
  left: 0.8rem;
  width: 1rem;
  height: 0.125rem;
  background: #2a2927;
  border-radius: 0;
}

.eye, .mo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0