div+css实现胖墩墩的小兔子动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现胖墩墩的小兔子动画效果代码

代码标签: div css 胖墩墩 小兔子 动画

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

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

<head>

  <meta charset="UTF-8">
  
<link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png" />
<meta name="apple-mobile-web-app-title" content="CodePen">

<link rel="shortcut icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico" />

<link rel="mask-icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg" color="#111" />


  
  <title>CodePen - CSS Rabbit Trap</title>
  
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
  
<style>
* {
  box-sizing: border-box;
}

:root {
  font-size: 10px;
}

body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  background: #210c05;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.reference {
  z-index: 1;
  position: fixed;
  bottom: 1em;
  left: 0;
  right: 0;
  text-align: center;
  color: #db8251;
  font-size: 24px;
  text-decoration: none;
}

.window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(1.75em);
  width: 87.5em;
  height: 67.5em;
  overflow: hidden;
  background-color: #e27450;
  box-shadow: 0 0 1em 0.25em #e27450;
}
.window .bottom {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 5.425em;
  background: #000;
  background: linear-gradient(#d16a47, #0000);
  clip-path: polygon(4.3% 0%, 95.8% 0%, 100% 100%, 0% 100%);
}
.window .top {
  position: absolute;
  top: 0;
  width: 100%;
  height: 2.05em;
  background: #000;
  background: linear-gradient(0deg, rgba(209, 106, 71, 0.75), #0000);
  clip-path: polygon(0% 0%, 100% 0%, 95.8% 100%, 4.3% 100%);
}

.scene {
  position: relative;
  width: 80em;
  height: 60em;
  overflow: hidden;
  background: linear-gradient(#e9825b, #e2734e);
  box-shadow: 0 0 2em 0.375em #0002;
}

.floor {
  width: 100%;
  height: 100%;
}
.floor .rabbit-shadow {
  position: absolute;
  bottom: 0;
  right: 0;
  transform: translate(-13.5em, -25.7em);
  width: 32.1em;
  height: 12.3em;
  background-image: radial-gradient(ellipse at 60%, rgba(204, 73, 40, 0.75) 10%, rgba(204, 73, 40, 0) 30%), radial-gradient(ellipse, #d75333 30%, #d75333 40%, rgba(217, 94, 63, 0.75) 50%, #0000 70%);
}
.floor .carrot-shadow {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(22em, 40em);
  width: 12em;
  height: 4.25em;
  background-image: linear-gradient(-90deg, #e47753 20%, #0000), radial-gradient(ellipse at right, #bb301b 45%, #cf5830 48%, #cf5830 56%, rgba(222, 106, 74, 0.75) 66%, #0000 70%), radial-gradient(circle at bottom right, rgba(207, 88, 48, 0.8) 48%, #0000 55%);
  filter: blur(0.25em);
}

.rabbit {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: translate(44.7em, -27.6em);
  width: 21.7em;
  height: 19em;
  border-radius: 85% 85% 90% 90%/100% 100% 75% 75%;
  background-color: #e7e7de;
  background-image: radial-gradient(circle at bottom left, #d7957f, #fff0 50%);
  box-shadow: 0.1em -0.1em 0.25em 0 #3331, -0.1em 0.5em 0.25em -0.25em #bb4325, inset -0.15em 0.1em 0.2em 0 #fff6;
}
.rabbit .eye {
  position: absolute;
  w.........完整代码请登录后点击上方下载按钮下载查看

网友评论0