css绘制精灵宝可梦大战效果代码

代码语言:html

所属分类:布局界面

代码描述:css绘制精灵宝可梦大战效果代码

代码标签: 灵宝 可梦 大战 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
.signature {
  font-family: sans-serif;
  font-size: 16px;
  position: absolute;
  bottom: 28%;
  right: 300px;
}
.signature a {
  text-decoration: none;
  color: #0089c9;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: paleturquoise;
  transform: scale(0.95);
  animation: zoom 5s forwards;
}
@keyframes zoom {
  100% {
    transform: scale(1);
  }
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.container {
  width: 800px;
  height: 800px;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
}

.switch-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
}

.switch {
  transform: rotateX(55deg) rotateZ(40deg) scale(0.8);
  position: relative;
  top: 200px;
  left: 30px;
  width: 750px;
  height: 320px;
  border-radius: 75px;
  display: grid;
  grid-template-columns: 15% 1fr 15%;
  z-index: 3;
}
.switch > * {
  position: relative;
}
.switch .joycon-blue > div,
.switch .joycon-red > div {
  position: relative;
}
.switch .joycon-blue {
  height: 100%;
  background-color: #00c3e3;
  box-shadow: inset 0.125em -0.125em 0.3em rgba(68, 68, 68, 0.4), inset -0.3em 0 0.0625em -0.25em rgba(34, 34, 34, 0.5), inset 0.4em 0.5em 0.5em -0.25em rgba(255, 255, 255, 0.6), 0.04em 0.25em 0 -0.3em #333;
  border-top-left-radius: 75px;
  border-bottom-left-radius: 75px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 5px;
}
.switch .joycon-blue .select-btn {
  width: 20px;
  height: 6px;
  background-color: #414548;
  left: 72%;
  top: 10%;
  border-radius: 0.0675em;
  box-shadow: inset 0 -0.03125em 0.0625em rgba(0, 0, 0, 0.5), inset 0 0.03125em rgba(255, 255, 255, 0.2), 0 0 0.03125em 0.03125em rgba(0, 0, 0, 0.5), 0 0.09125em 0.125em -0.03125em rgba(0, 0, 0, 0.4);
}
.switch .joycon-blue .joystick {
  top: 20%;
}
.switch .joycon-blue .joystick .joystick-base {
  position: absolute;
  width: 60px;
  height: 45px;
  background-color: #444;
  box-shadow: inset 0.75em 0.5em 1em black, -0.125em 0 0 0.015em #0097b0;
  border-radius: 100%;
  top: 26%;
  left: 38%;
  transform: rotate(10deg);
}
.switch .joycon-blue .joystick .joystick-base:after {
  content: "";
  position: absolute;
  width: 40px;
  height: 30px;
  background-color: #111;
  border-radius: 100%;
  left: 18%;
  top: 16%;
  box-shadow: inset -0.125em 0 rgba(255, 255, 255, 0.2), -0.0125em 0.1em rgba(255, 255, 255, 0.2);
}
.switch .joycon-blue .joystick .joystick-top {
  position: relative;
  width: 55px;
  height: 45px;
  background-color: #414548;
  left: calc(50% - 19px);
  border-radius: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.14em 100%, 100% 0.14em, 100%;
  background-image: linear-gradient(to bottom, #222, #111), linear-gradient(to bottom, #222, #333), linear-gradient(to bottom, #777, #111);
  box-shadow: inset 0 -0.06em 0.125em black, inset 0 0.125em 0.125em -0.0325em rgba(0, 0, 0, 0.2), inset 0 0.18em 0.125em -0.0625em rgba(255, 255, 255, 0.3), inset -0.125em 0 0.125em -0.0625em rgba(255, 255, 255, 0.3), 0 0 0.02em 0.0625em rgba(0, 0, 0, 0.75), 0 0.375em 1em 0.0625em rgba(0, 0, 0, 0.4);
  transform: rotate(10deg);
  height: 42px;
}
.switch .joycon-blue .joystick .joystick-top:before, .switch .joycon-blue .joystick .joystick-top:after {
  content: "";
  position: absolute;
  width: 75%;
  height: 75%;
  border-radius: 100%;
  left: 10%;
  top: 8%;
  background-repeat: no-repeat;
  background-position: center;
  background-image: radial-gradient(ellipse 30px 30px at 20% 20%, rgba(255, 255, 255, 0.2), transparent), linear-gradient(to bottom, #333, #111);
}
.switch .joycon-blue .joystick .joystick-top:before {
  width: 85%;
  height: 85%;
  left: 7%;
  top: 7%;
  background-size: 0.14em 100%, 100% 0.14em, 100%;
  background-image: linear-gradient(to bottom, #444, #111), linear-gradient(to bottom, #222, #333), linear-gradient(to bottom, #222, #666);
}
.switch .joycon-blue .joystick .joystick-top:after {
  height: 73%;
  left: 10%;
  top: 10%;
  transform: scale(0.95);
  box-shadow: 0.125em 0.1em 0 0.03125em rgba(0, 0, 0, 0.8), inset 0.125em 0 rgba(0, 0, 0, 0.5), inset 0.0125em 0.01em rgba(0, 0, 0, 0.8);
}
.switch .joycon-blue .button-group {
  width: 45px;
  height: 45px;
  left: calc(50% - 32.5px);
  top: 28%;
}
.switch .joycon-blue .button-group .button {
  position: absolute;
  width: 45%;
  height: 35%;
  background-color: #414548;
  border-radius: 100%;
  box-shadow: inset 0 -0.0625em 0.125em rgba(0, 0, 0, 0.75), inset 0 0.125em 0.125em -0.0625em rgba(255, 255, 255, 0.4), 0 0 0.03125em 0.0625em rgba(0, 0, 0, 0.6), 0 0.0625em 0.25em 0.03125em rgba(0, 0, 0, 0.5), 0.3em 0.25em 0 0.065em #333, 0.15em -0.005em 0 0.015em #333, 0.125em 0.2em 0 0.0125em #333, 0 0 0.02em 0.0625em rgba(0, 0, 0, 0.75), 0 0.375em 1em 0.0625em rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}
.switch .joycon-blue .button-group .button:after {
  content: "";
}
.switch .joycon-blue .button-group .button.up {
  top: 0;
  left: 50%;
}
.switch .joycon-blue .button-group .button.up:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-bottom: 8px solid #222;
}
.switch .joycon-blue .button-group .button.down {
  top: 100%;
  left: 50%;
}
.switch .joycon-blue .button-group .button.down:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 8px solid #222;
}
.switch .joycon-blue .button-group .button.left {
  top: 50%;
  left: 0;
}
.switch .joycon-blue .button-group .button.left:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 8px solid #222;
}
.switch .joycon-blue .button-group .button.right {
  top: 50%;
  left: 100%;
}
.switch .joycon-blue .button-group .button.right:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 8px solid #222;
}
.switch .joycon-blue .capture-btn {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #414548;
  bottom: 22%;
  left: 60%;
  border-radius: 0.125em;
  box-shadow: inset 0 0.25em 0.5em -0.0625em rgba(255, 255, 255, 0.1), inset 0 0.015em 0.03125em rgba(255, 255, 255, 0.4), inset 0 0 0.03125em 0.03125em black, 0 0.015em 0 0.03125em rgba(0, 0, 0, 0.75), 0 0.015em 0.05em 0.0625em rgba(0, 0, 0, 0.5);
}
.switch .joycon-blue .capture-btn:after {
  content: "";
  width: 14px;
  height: 14px;
  position: absolute;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-radius: 100%;
  background-image: linear-gradient(to bottom, #222, #333);
  box-shadow: inset 0 0.0125em 0 0.03125em rgba(0, 0, 0, 0.6), inset 0 -0.0125em 0 0.06125em rgba(255, 255, 255, 0.4), 0.015em -0.03125em 0.0125em rgba(0, 0, 0, 0.7);
}
.switch .joycon-blue .shoulder.left {
  position: absolute;
  z-index: -1;
  top: -0.25em;
  width: 6.5em;
  height: 4.5em;
  transform-style: none;
  background-color: #414548;
  left: -0.25em;
  border-radius: 6em 1em 0 0;
}
.switch .screen {
  background-color: #414548;
  border-radius: 10px;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  box-shadow: inset 0 -1.25em 0.5em -1em rgba(0, 0, 0, 0.5), inset 0.125em 0 rgba(255, 255, 255, 0.2), inset -0.125em 0 rgba(255, 255, 255, 0.2);
}
.switch .screen:before, .switch .screen:after {
  content: "";
  position: absolute;
  width: 100%;
}
.switch .screen:before {
  height: 15px;
  background-image: linear-gradient(to bottom, #414548, rgba(152, 152, 152, 0.4), #414548);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  box-shadow: inset 0.125em 0 rgba(255, 255, 255, 0.2), inset -0.125em 0 rgba(255, 255, 255, 0.2);
}
.switch .screen .battle-field {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 93%;
  height: 92%;
  background-color: paleturquoise;
  border-top: 25px solid black;
  border-bottom: 25px solid black;
  border-left: 35px solid black;
  border-right: 35px solid black;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 40px #0089c9;
  background-size: 375px 100%, 100px 100px, 10px 100%;
  background-repeat: no-repeat;
  background-position: 0 0, 50% 50%, 50% 0;
  background-image: linear-gradient(120deg, transparent 20%, rgba(133, 229, 229, 0.2) 20%, 25%, transparent 25%, 30%, rgba(255, 255, 255, 0.2) 30%, 40%, transparent 40%, rgba(133, 229, 229, 0.2) 40%, 45%, rgba(255, 255, 255, 0.2) 45%, 48%, transparent 48%, 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 70%, rgba(133, 229, 229, 0.2) 70%, 75%, transparent 75%), radial-gradient(circle at center, paleturquoise 20%, white 20%, 30%, transparent 30%, 50%, white 50%, 60%, transparent 60%), linear-gradient(to bottom, white, white);
}
.switch .glass-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 93%;
  height: 92%;
  background-color: paleturquoise;
  border-top: 25px solid black;
  border-bottom: 25px solid black;
  border-left: 35px solid black;
  border-right: 35px solid black;
  border-radius: 10px;
  overflow: hidden;
  background-size: 420px 100%, 100px 100px, 10px 100%;
  background-repeat: no-repeat;
  background-position: 0 0, 50% 50%, 50% 0;
  background-image: linear-gradient(120deg, transparent 20%, rgba(133, 229, 229, 0.3) 20%, 25%, transparent 25%, 30%, rgba(255, 255, 255, 0.3) 30%, 40%, transparent 40%, rgba(133, 229, 229, 0.3) 40%, 45%, rgba(255, 255, 255, 0.3) 45%, 48%, transparent 48%, 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 70%, rgba(133, 229, 229, 0.3) 70%, 75%, transparent 75%);
}
.switch .joycon-red {
  height: 100%;
  background-color: #ff4554;
  border-top-right-radius: 75px;
  border-bottom-right-radius: 75px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 5px;
  box-shadow: inset -0.125em 0.125em 0.3em rgba(68, 68, 68, 0.4), inset 0.3em 0 0.0625em -0.25em rgba(34, 34, 34, 0.5), inset -0.4em 0.5em 0.5em -0.25em rgba(255, 255, 255, 0.6), -0.04em 0.25em 0 -0.3em #333;
}
.switch .joycon-red .start-btn {
  width: 7px;
  height: 20px;
  background-color: #414548;
  top: 8%;
  left: 15%;
  box-shadow: 0 0 0.03125em rgba(0, 0, 0, 0.6), 0 0.09375em 0.125em -0.03125em rgba(0, 0, 0, 0.5);
}
.switch .joycon-red .start-btn:before, .switch .joycon-red .start-btn:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #414548;
  border-radius: 0.0675em;
}
.switch .joycon-red .start-btn:before {
  height: 7px;
  width: 20px;
  box-shadow: inset 0 -0.03125em 0.0625em rgba(0, 0, 0, 0.5), inset 0 0.03125em rgba(255, 255, 255, 0.2), 0 0 0.03125em 0.03125em rgba(0, 0, 0, 0.6), 0 0.09375em 0.125em -0.03125em rgba(0, 0, 0, 0.4);
}
.switch .joycon-red .start-btn:after {
  width: 7px;
  height: 20px;
  box-shadow: inset 0 -0.09375em 0.0625em -0.0624em rgba(0, 0, 0, 0.5), inset 0 0.03125em rgba(255, 255, 255, 0.2);
}
.switch .joycon-red .button-group {
  width: 45px;
  height: 45px;
  left: calc(50% - 32.5px);
  top: -3%;
}
.switch .joycon-red .button-group .button {
  position: absolute;
  width: 45%;
  height: 35%;
  background-color: #414548;
  border-radius: 100%;
  box-shadow: inset 0 -0.0625em 0.125em rgba(0, 0, 0, 0.75), inset 0 0.125em 0.125em -0.0625em rgba(255, 255, 255, 0.4), 0 0 0.03125em 0.0625em rgba(0, 0, 0, 0.6), 0 0.0625em 0.25em 0.03125em rgba(0, 0, 0, 0.5), 0.3em 0.25em 0 0.065em #333, 0.15em -0.005em 0 0.015em #333, 0.125em 0.2em 0 0.0125em #333, 0 0 0.02em 0.0625em rgba(0, 0, 0, 0.75), 0 0.375em 1em 0.0625em rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}
.switch .joycon-red .button-group .button:after {
  font-family: "Arial";
  font-size: 0.7em;
}
.switch .joycon-red .button-group .button.x {
  top: 0;
  left: 50%;
}
.switch .joycon-red .button-group .button.x:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  content: "X";
}
.switch .joycon-red .button-group .button.a {
  top: 100%;
  left: 50%;
}
.switch .joycon-red .button-group .button.a:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  content: "A";
}
.switch .joycon-red .button-group .button.b {
  top: 50%;
  left: 0;
}
.switch .joycon-red .button-group .button.b:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  content: "B";
}
.switch .joycon-red .button-group .button.y {
  top: 50%;
  left: 100%;
}
.switch .joycon-red .button-group .button.y:after {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  content: "Y";
}
.switch .joycon-red .joystick {
  top: 40%;
  right: 10%;
}
.switch .joycon-red .joystick .joystick-base {
  position: absolute;
  width: 60px;
  height: 45px;
  background-color: #444;
  box-shadow: inset 0.75em 0.5em 1em black, -0.125em 0 0 0.015em #ff1225;
  border-radius: 100%;
  top: 26%;
  left: 38%;
  transform: rotate(10deg);
}
.switch .joycon-red .joystick .joystick-base:after {
  content: "";
  position: absolute;
  width: 40px;
  height: 30px;
  background-color: #111;
  border-radius: 100%;
  left: 18%;
  top: 16%;
  box-shadow: inset -0.125em 0 rgba(255, 255, 255, 0.2), -0.0125em 0.1em rgba(255, 255, 255, 0.2);
}
.switch .joycon-red .joystick .joystick-top {
  position: relative;
  width: 55px;
  height: 45px;
  background-color: #414548;
  left: calc(50% - 19px);
  border-radius: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.14em 100%, 100% 0.14em, 100%;
  background-image: linear-gradient(to bottom, #222, #111), linear-gradient(to bottom, #222, #333), linear-gradient(to bottom, #777, #111);
  box-shadow: inset 0 -0.06em 0.125em black, inset 0 0.125em 0.125em -0.0325em rgba(0, 0, 0, 0.2), inset 0 0.18em 0.125em -0.0625em rgba(255, 255, 255, 0.3), inset -0.125em 0 0.125em -0.0625em rgba(255, 255, 255, 0.3), 0 0 0.02em 0.0625em rgba(0, 0, 0, 0.75), 0 0.375em 1em 0.0625em rgba(0, 0, 0, 0.4);
  transform: rotate(10deg);
  height: 42px;
}
.switch .joycon-red .joystick .joystick-top:before, .switch .joycon-red .joystick .joystick-top:after {
  content: "";
  position: absolute;
  width: 75%;
  height: 75%;
  border-radius: 100%;
  left: 10%;
  top: 8%;
  background-repeat: no-repeat;
  background-position: center;
  background-image: radial-gradient(ellipse 30px 30px at 20% 20%, rgba(255, 255, 255, 0.2), transparent), linear-gradient(to bottom, #333, #111);
}
.switch .joycon-red .joystick .joystick-top:before {
  width: 85%;
  height: 85%;
  left: 7%;
  top: 7%;
  background-size: 0.14em 100%, 100% 0.14em, 100%;
  background-image: linear-gradient(to bottom, #444, #111), linear-gradient(to bottom, #222, #333), linear-gradient(to bottom, #222, #666);
}
.switch .joycon-red .joystick .joystick-top:after {
  height: 73%;
  left: 10%;
  top: 10%;
  transform: scale(0.95);
  box-shadow: 0.125em 0.1em 0 0.03125em rgba(0, 0, 0, 0.8), inset 0.125em 0 rgba(0, 0, 0, 0.5), inset 0.0125em 0.01em rgba(0, 0, 0, 0.8);
}
.switch .joycon-red .home-btn {
  position: absolute;
  bottom: 22%;
  width: 20px;
  height: 20px;
  left: 20%;
  background-color: #444;
  border-radius: 100%;
  box-shadow: inset 0 0 0 0.09em #9b9b9b, inset 0 0.25em 0.5em rgba(255, 255, 255, 0.2), inset 0 0 0.03125em black, 0 0.0155em 0.03125em 0.0625em rgba(0, 0, 0, 0.6);
}
.switch .joycon-red .home-btn:before, .switch .joycon-red .home-btn:after {
  content: "";
  position: absolute;
  transform: translate(-50%, -50%) scale(1.15);
  top: 50%;
  left: 50%;
  display: block;
  box-sizing: border-box;
}
.switch .joycon-red .home-btn:before {
  height: 6px;
  width: 7px;
  background-color: #444;
  border: 0.025em solid #111;
  box-shadow: inset 0 0 0 0.1em #111, inset 0.12em 0 0 #111, inset -0.12em 0 0 #11.........完整代码请登录后点击上方下载按钮下载查看

网友评论0