css偷鸡蛋交互效果

代码语言:html

所属分类:动画

代码描述:css偷鸡蛋交互效果

代码标签: 交互 效果

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


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

<style>
:root {
  --sizeVar: clamp(100px, 20vw, 50vh);
}
body {
  background-color: black;
  overflow: hidden;
}
div,
a {
  position: absolute;
}
.chickenDiv {
  width: 20vw;
  width: var(--sizeVar);
  height: 20vw;
  height: var(--sizeVar);
  bottom: 20%;
  left: 50%;
  margin-left: -10vw;
  margin-left: calc(var(--sizeVar) / -2);
  -webkit-animation: none 300ms linear;
          animation: none 300ms linear;
}
.chickenDiv,
.chickenDiv:focus,
.chickenDiv:active {
  -webkit-tap-highlight-color: transparent;
}
.bgDiv {
  width: 110%;
  height: 110%;
  left: 0%;
  top: -10%;
  border-radius: 50%;
  background-color: rgb(2, 0, 36);
  background: -webkit-gradient(
    linear,
    left bottom, left top,
    from(rgba(2, 0, 36, 1)),
    color-stop(35%, rgba(80, 9, 121, 1)),
    to(rgba(239, 0, 255, 1))
  );
  background: linear-gradient(
    0deg,
    rgba(2, 0, 36, 1) 0%,
    rgba(80, 9, 121, 1) 35%,
    rgba(239, 0, 255, 1) 100%
  );
  z-index: -2;
}
.chickenDiv::after,
.chickenDiv::before {
  position: absolute;
  content: "";
  width: 80%;
  height: 15%;
  left: 10%;
  border-radius: 50%;
}
.chickenDiv::after {
  bottom: -7%;
  -webkit-clip-path: polygon(0 54%, 100% 54%, 100% 100%, 0% 100%);
          clip-path: polygon(0 54%, 100% 54%, 100% 100%, 0% 100%);
  border-bottom: 2vw solid rgb(117, 80, 56);
  border-bottom: calc(var(--sizeVar) / 10) solid rgb(117, 80, 56);
}
.chickenDiv::before {
  bottom: -2%;
  backgro.........完整代码请登录后点击上方下载按钮下载查看

网友评论0