css实现鼠标悬浮宝葫芦动画效果代码

代码语言:html

所属分类:悬停

代码描述:css实现鼠标悬浮宝葫芦动画效果代码

代码标签: css 鼠标 悬浮 宝葫芦 动画

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


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

<head>

  <meta charset="UTF-8">

  
  
<style>
@charset "UTF-8";
body {
  display: grid;
  place-items: center;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #ddd 24%, rgba(0, 0, 0, 0.001) 25%) 50% calc(50% + 180px) no-repeat, #fff;
  background-size: 300px 100px, 100% 100%;
  -webkit-animation: grow 2s ease-in-out infinite alternate;
          animation: grow 2s ease-in-out infinite alternate;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'  width='50' height='60' viewport='0 0 100 100' style='fill:black;font-size:30px;'><text y='50%'>💀</text></svg>") 16 0, auto;
}
@-webkit-keyframes grow {
  to {
    background-size: 150px 100px, 100% 100%;
  }
}
@keyframes grow {
  to {
    background-size: 150px 100px, 100% 100%;
  }
}
body:before {
  content: "hover me(at)";
  position: absolute;
  bottom: 10px;
  width: 100%;
  left: 0;
  text-align: center;
  font-family: "Futura", sans-serif;
  font-size: 12px;
}
body div {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'  width='50' height='60' viewport='0 0 100 100' style='fill:black;font-size:30px;'><text y='50%'>🐮</text></svg>") 16 0, auto;
  width: 300px;
  height: 300px;
  filter: blur(4px) contrast(15) hue-rotate(30deg) saturate(0.5) brightness(1.5);
  background: radial-gradient(circle at center, #fff 140px, rgba(0, 0, 0, 0.001) 100px);
  position: relative;
  transition: 0.2s ease-in-out;
  transform-origin: 45% 55%;
  -webkit-animation: bouncing 2s ease-in-out infinite alternate;
          animation: bouncing 2s ease-in-out infinite alternate;
}
@-webkit-keyframes bouncing {
  to {
    transform: translateY(-20px);
  }
}
@keyframes bouncing {
  to {
    transform: translateY(-20px);
  }
}
body div:hover {
  filter: blur(2px) contrast(12) saturate(0.9);
}
body div:hover:before, body div:hover:after {
  transform: rotate(0deg) translateX(0px);
  opacity: 1;
}
body div:before, body div:after {
  transform: rotate(-10deg) translateX(5px);
  transform-origin: 50% 75%;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.175), opacity 0.2s ease-in-out;
}
body div:before {
  z-index: 0;
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  box-shadow: inherit;
  top: 0;
  left: 0;
  background: radial-gradient(circle at center, #000 5px, rgba(0, 0, 0, 0.001) 10px) calc(50% - 30px) calc(50% - 30px), radial-gradient(circle at center, #000 5px, rgba(0, 0, 0, 0.001) 10px) calc(50% + 0px) calc(50% - 30px), radial-gradient(circle at bottom, rgba(0, 0, 0, 0.001) 10px, #000 10px, #000 17px, rgba(0, 0, 0, 0.001) 17px) calc(50% - 11px) calc(50% - 147.5px), radial-gradient(ellipse at center, red 10px, #fff 12px, #fff 19px, rgba(0, 0, 0, 0.001) 10px) 0px 0px/100% 125% no-repeat, linear-gradient(75deg, rgba(0, 0, 0, 0.001) 47.5%, #fff 47.5%, #fff 50%, rgba(0, 0, 0, 0.001) 50%) calc(50% + 10px) calc(50% + 65px)/100% 50px no-repeat, radial-gradient(circle at center, red 50px, rgba(0, 0, 0, 0.001) 50px) 50% 40px/100% 100% no-repeat, radial-gradient(circle at center, red 40px, rgba(0, 0, 0, 0.001) 40px) -15.5px -5px/100% 100% no-repeat, radial-gradient(circle at center, red 45px, rgba(0, 0, 0, 0.001) 40px) -12.5px 15px/100% 100% no-repeat, radial-gradient(circle at center, red 35px, rgba(0, 0, 0, 0.001) 35px) -20px -30px/100% 100% no-repeat, radial-gradient(circle at center, #fff 60px, rgba(0, 0, 0, 0.001) 50px) 50% 40px/100% 100% no-repeat, radial-gradient(circle at center, #fff 50px, rgba(0, 0, 0, 0.001) 40px) -15.5px -5px/100% 100% no-repeat, radial-gradient(circle at center, #fff 55px, rgba(0, 0, 0, 0.001) 40px) -12.5px 15px/100% 100% no-repeat, radial-gradient(circle at center, #fff 45px, rgba(0, 0, 0, 0.001) 35px) -20px -30px/100% 100% no-repeat, radial-gradient(circle at center, #000 67.5px, rgba(0, 0, 0, 0.001) 50px) 50% 40px/100% 100% no-repeat, radial-gradient(circle at center, #000 57.5px, rgba(0, 0, 0, 0.001) 40px) -15.5px .........完整代码请登录后点击上方下载按钮下载查看

网友评论0