js+css布局猫头眼睛跟随鼠标转动交互效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css布局猫头眼睛跟随鼠标转动交互效果代码

代码标签: js css布局 猫头 眼睛 跟随 鼠标 转动 交互

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

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

<head>
  <meta charset="UTF-8">
  

  
  
<style>
@charset "UTF-8";
@import url("https://fonts.googleapis.com/css?family=Baloo+Bhaina");
* {
  box-sizing: border-box;
}

.flex {
  display: flex;
}

html,
body,
.wrap {

  height: 100%;
}

body {
  background: #27313D;
}

.bg {
  background: rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  z-index: 10000;
}

.wrap {

  align-items: center;
  justify-content: center;
}

.cat {
  height: 150px;
  width: 200px;
}

.face {
  background: #ededed;
  border-radius: 100%;
  height: inherit;
  position: relative;
}

.ears {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
}

.ear {
  background: #ededed;
  border-radius: 30px;

  align-items: center;
  justify-content: center;
  height: 80px;
  position: absolute;
  top: -6px;
  width: 80px;
}
.ear::before {
  background: #F58E7E;
  border-radius: 23px;
  content: "";
  height: 73px;
  width: 73px;
}
.ear-left {
  left: 14px;

  transform: rotate(25deg) skewX(30deg) skewY(8deg);
}
.ear-right {
  right: 14px;

  transform: rotate(-25deg) skewX(-30deg) skewY(-8deg);
}

.eyes {
  height: 40px;
  position: absolute;
  top: 40%;
  left: 0;
  transform: translateY(-40%);
  width: 100%;
}

.eye {
  background: #333333;
  border: 2px solid #333333;
  align-items: center;
  justify-content: center;
  height: 35px;
  overflow: hidden;
  position: absolute;
  top: 0;
  width: 45px;
  /* 虹彩 */
  /* 瞳 */
}
.eye-iris {
  background: #58BE89;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}
.eye-iris, .eye-pupil, .eye-pupil::before {
  border-radius: 100%;
}
.eye-pupil {
  background: #333333;
  align.........完整代码请登录后点击上方下载按钮下载查看

网友评论0