div+css实现可爱大眼睛女孩鼠标交互动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现可爱大眼睛女孩鼠标交互动画效果代码

代码标签: div ss 可爱 大眼睛 女孩 鼠标 交互 动画

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


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

<head>

  <meta charset="UTF-8">

  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Kiwi+Maru:wght@500&display=swap");
@keyframes blinky {
  0%, 9%, 11%, 19%, 21%, 69%, 71%, 100% {
    transform: scaleY(1);
  }
  10%, 20%, 70% {
    transform: scaleY(0);
  }
}
:root {
  --black: #413564;
  --white: #fff;
  --primary-color: #554684;
  --primary-color-dark: #413564;
  --primary-color-tint: #8979b9;
  --secondary-color: #fff5f0;
  --accent-color: #ff4dde;
  --sparkle-color: #ffe085;
  --shirt-color: #fff;
  --shirt-color-dark: #eaeaea;
  --shirt-color-dark-2: #ddd;
  --bow-color-1: #961E60;
  --bow-color-2: #411854;
  --bow-gradient: repeating-linear-gradient(-45deg, var(--bow-color-1) 0 0.25rem, var(--bow-color-2) 0.25rem 0.375rem);
  --background: #c4bcdc;
  --line-width-1: 0.125rem;
  --line-width-2: 0.375rem;
}

* {
  box-sizing: border-box;
}

body {
  display: grid;
  place-items: center;
  height: 100vh;
  background-color: var(--background);
  font-size: 16px;
  line-height: 1;
  font-family: "Kiwi Maru", serif;
  overflow-x: hidden;
}

.komi {
  position: relative;
}
.komi *,
.komi *::before,
.komi *::after {
  position: absolute;
}
.komi-head, .komi-body, .komi-hair-extension {
  animation: var(--hover-animation, none);
}
.komi-eye {
  top: 4.5rem;
  right: var(--eye-right);
  bottom: auto;
  left: var(--eye-left);
  --flip: 1;
  --eye-offset: 1.25rem;
  --pupil-offset: 0.5rem;
  --eye-line-top-offset: -13%;
  --eye-line-bottom-offset: 16%;
  z-index: 2;
  height: 3.75rem;
  width: 4rem;
  transform-origin: center 70%;
  border-radius: 100%;
  background-color: var(--white);
  animation: blinky 7s infinite;
}
.komi-eye::before, .komi-eye::after {
  content: "";
}
.komi-eye::before {
  top: -0.0625rem;
  right: var(--eye-line-top-right);
  bottom: auto;
  left: var(--eye-line-top-left);
  height: 120%;
  width: 120%;
  transform: rotate(calc(-12deg * var(--flip)));
  border-radius: 100%;
  border: var(--line-width-2) solid transparent;
  border-top: var(--line-width-2) solid var(--black);
}
.komi-eye::after {
  top: auto;
  right: var(--eye-line-bottom-right);
  bottom: 0;
  left: var(--eye-line-bottom-left);
  height: 15%;
  width: 50%;
  transform: rotate(calc(8deg * var(--flip)));
  border-radius: 100%;
  border: var(--line-width-1) solid transparent;
  border-bottom: var(--line-width-1) solid var(--black);
}
.komi-eye-sparkle {
  inset: 15% 20%;
  transform: scale(var(--eye-sparkle-scale, 0));
  transition: 0.4s ease-in-out;
}
.komi-eye-sparkle::before, .komi-eye-sparkle::after {
  content: "";
  border-radius: 100%;
  background-color: var(--sparkle-color);
}
.komi-eye-sparkle::before {
  left: 50%;
  height: 100%;
  width: 0.5rem;
  transform: translateX(-50%);
  animation: twinkleY 0.3s infinite;
}
.komi-eye-sparkle::after {
  top: 50%;
  width: 100%;
  height: 0.5rem;
  transform: translateY(-50%);
  animation: twinkleX 0.3s 0.3s infinite;
}
.komi-eye-pupil {
  top: 0.75rem;
  right: var(--pupil-right);
  bottom: auto;
  left: var(--pupil-left);
  height: 2.5rem;
  width: 2.5rem;
  transform: scale(var(--eye-pupil-scale, 1));
  border-radius: 100%;
  background-color: var(--black);
  transition: 0.4s ease-in-out;
  overflow: hidden;
}
.komi-eye-pupil::before {
  content: "";
  top: 60%;
  left: 50%;
  height: 100%;
  width: 130%;
  transform: translateX(-50%);
  border-radius: 100%;
  background-color: var(--primary-color-tint);
}
.komi-eye-left {
  --eye-left: var(--eye-offset);
  --pupil-right: var(--pupil-offset);
  --eye-line-top-left: var(--eye-line-top-offset);
  --eye-line-bottom-left: var(--eye-l.........完整代码请登录后点击上方下载按钮下载查看

网友评论0