div+css实现三维小鸡选择效果代码

代码语言:html

所属分类:三维

代码描述:div+css实现三维小鸡选择效果代码

代码标签: div css 三维 小鸡 选择

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


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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
body {
  background: rgb(15 19 22);
  font-family: 'Silkscreen', cursive;
}
h1 {
  color: white;
  font-size: 4rem;
  position: absolute;
  transition: all 0.1s ease-out;
  top: -12rem; 
  left: -10rem;
}

#hat:checked ~ #chicken h1 {
  top: -18rem;
}
#controls {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 99999;
}
#rotate-label, #hat-label, #link {
  background: #3c874c;
  color: white;
  text-align: center;
  text-decoration: none;
  margin-bottom: 2rem;
  display: block;
  padding: 0.5rem;
  font-size: 1.5rem;
  box-shadow: 0 4px 0 #204c2d, 0 -4px #64ca55, 4px 0 #316c42, -4px 0 #316c42, 0 -7px black, 0 7px black, 7px 0 black, -7px 0 black, -7px 3px black, -7px -3px black, 7px 3px black, 7px -3px black, -3px 7px black, 3px 7px black, -3px -7px black, 3px -7px black;
  transform: scale(1);
  cursor: pointer;
}

.c14, .c15, .c16 { display: none; }
#hat:checked ~ #chicken .c14, #hat:checked ~ #chicken .c15, #hat:checked ~ #chicken .c16 {
  display: block;
}

#rotate-label:hover, #hat-label:hover, #link:hover {
  background: #439356;
}
#rotate-label:active, #hat-label:active, #link:active {
  background: #439356;
  box-shadow: 0 4px 0 #204c2d, 0 -4px #64ca55, 4px 0 #316c42, -4px 0 #316c42, 0 -7px white, 0 7px white, 7px 0 white, -7px 0 white, -7px 3px white, -7px -3px white, 7px 3px white, 7px -3px white, -3px 7px white, 3px 7px white, -3px -7px white, 3px -7px white;
  transform: scale(1.05);
}
input[type="checkbox"] {
  display: none;
}
h1:before {
  content: "CHICKEN";
  position: absolute;
  font-size: 5rem;
  left: -2rem;
  top: -0.75rem;
  opacity: 0.05;
}
h1:after {
  font-family: "Font Awesome 5 Pro";
  content: '\f0d7';
  font-weight: 900;
  color: #ecb729;
  position: absolute;
  top: 4rem;
  left: calc(50% - 0.5rem);
}
#chicken {
  transform: rotateX(-15deg) rotateY(20deg);
  transform-style: preserve-3d;
  position: relative;
  left: 16rem;
  top: 16rem;
  transform-origin: 6rem 6rem;
  transform-style: preserve-3d;
  transition: all 0.1s ease-out;
  cursor: pointer;
}

#chicken:hover > h1 {
  transform: scale(1.1);
}

#chicken > div {
  height: 6rem;
  width: 6rem;
  position: relative;
  transform-style: preserve-3d;
 }
#poke-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  cursor: pointer;
}
#shadow {
  background: radial-gradient(circle, rgb(37 45 51) 0%, rgba(9,9,121,0) 70%);
  width: 30rem;
  height: 30rem;
  position: absolute;
  top: 24rem;
  left: 4rem;
  transform-style: preserve-3d;
  perspective: 500px;
  transform: rotateX(70deg);
  z-index: -1;
  filter: color-burn;
}
#chicken .c1 {
  position: absolute;
  top: 18rem;
}

#chicken .c2 {
  position: absolute;
  top: 6rem;
}

#chicken .c3 {
  position: absolute;
  transform: translateZ(2rem) translateY(2rem);
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0