炫酷radio点击带枪射击效果

代码语言:html

所属分类:表单美化

代码描述:炫酷radio点击带枪射击效果

代码标签: 带枪 射击 效果

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

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

<style>
body {
  background: #f4faff;
  font-family: 'Averia Libre', sans-serif;
  display: grid;
  height: 100vh;
  place-items: center;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}
*:before, *:after {
  content: '';
  position: absolute;
}

.wrapper {
  display: inline-block;
  position: relative;
  perspective: 100em;
  transition: .4s ease;
  font-size: 20px;
}

.page {
  background: white;
  min-width: 398px;
  max-width: 500px;
  border-radius: 20px;
  box-shadow: 0 3px 12px rgba(70, 107, 255, 0.1);
  border: 1px solid rgba(69, 103, 207, 0.1);
  transform-style: preserve-3d;
  transition: .5s ease;
  padding: 30px 40px 20px;
  position: relative;
  z-index: 0;
}
.page p {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}

.gun {
  position: absolute;
  top: 0;
  left: -200px;
  z-index: 1;
  transform: translateY(1000px);
  transition: .9s ease-in-out;
}
.gun__main {
  width: 175px;
  height: 100px;
  background: #344793;
  border-radius: 4px;
  padding: 10px;
  text-align: right;
  position: relative;
}
.gun__main:before {
  background: #f97822;
  width: 6px;
  height: 30px;
  right: -6px;
}
.gun__main:after {
  background: #f97822;
  width: 5px;
  height: 22px;
  right: -11px;
  top: 15px;
}
.gun__yellow {
  width: 80%;
  margin-left: auto;
  background: #fdbb2f;
  height: 83%;
  border-radius: 3px;
  position: relative;
}
.gun__yellow .line {
  position: absolute;
  background: #ffdeaa;
  width: 80%;
  height: 9px;
  bottom: 10px;
  left: 18px;
  border-radius: 20px;
  box-shadow: 0 -18px 0 0px #ffdeaa, 0px -36px 0 0px #ffdeaa;
}
.gun__accent-1 {
  position: absolute;
  width: 22px;
  top: 19px;
  height: 50px;
  left: 12px;
  border-radius: 100% 2px 2px 100%;
  background: linear-gradient(to right, #4567cf 50%, #344793 50%, #344793 75%, #4567cf 75%);
}
.gun__accent-1:before {
  background: #4567cf;
  width: 85px;
  bottom: -25px;
  height: 5px;
  border-radius: 5px;
  left: 32px;
}
.gun__accent-1:after {
  border-radius: 50%;
  bottom: -30px;
  left: 135px;
  width: 8px;
  height: 8px;
  border: 2px solid #4567cf;
}
.gun__accent-2 {
  background: #344793;
  width: 35px;
  height: 20px;
  bottom: -7px;
  right: 0;
  position: absolute;
  background: linear-gradient(135deg, #344793 65%, #f4faff 65%);
  background-repeat: no-repeat;
}
.gun__accent-2:before {
  width: 18px;
  height: 10px;
  background: #344793;
  bottom: 4px;
  left: -14px;
  transform: rotate(30deg);
}
.gun__handle {
  position: absolute;
  width: 100px;
  height: 70px;
  top: -5px;
  left: -90px;
  border-radius: 2px;
  transform: skew(-20deg);
  background: #344793;
}
.gun__handle .top {
  background: #fdbb2f;
  width: 100%;
  height: 72%;
  position: absolute;
  border-radius: 2px;
  left: -5px;
  top: -2px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 15px;
}
.gun__handle .top:before {
  width: 85%;
  top: -3px;
  height: 4px;
  background: #f97822;
  left: 6px;
  transform: skew(20deg);
}
.gun__handle .top:after {
  width: 8px;
  height: 8px;
  background: #f4faff;
  border: 5px solid #fdbb2f;
  transform: skew(20deg);
  top: 6px;
  left: -7px;
  border-radius: 50%;
}
.gun__handle .line {
  height: 35px;
  width: 5px;
  border-radius: 2px;
  bottom: 10px;
  background: #ffdeaa;
  left: 20px;
}
.gun__handle .line-long {
  height: 90%;
}
.gun__handle .line-short {
  height: 55%;
}
.gun__handle .bottom {
  background: #344793;
  width: 60px;
  height: 100px;
  position: absolute;
  top: 82px;
  left: 35px;
  border-radius: 80% 100% 100% 120%;
  transform: skew(20deg) rotate(25deg);
}
.gun__handle .bottom:before {
  width: 38px;
  height: 55px;
  top: 47%;
  left: 41%;
  border-radius: 80% 20% 60% 100% / 20% 60% 50% 20%;
  background: inherit;
}
.gun__handle .bottom:after {
  width: 20px;
  height: 20px;
  background: #344793;
  border-radius: 50%;
  top: 82px;
  right: -5px;
}
.gun__handle .middle {
  position: absolute;
  width: 112px;
  background: #344793;
  height: 47px;
  top: 45px;
  left: 2px;
  border-radius: 3px;
  transform: skew(20deg) rotate(15deg);
}
.gun__handle .middle:before {
  background: #344793;
  width: 30px;
  height: 50px;
  left: 10px;
  top: 15px;
}
.gun__handle .middle:after {
  background: #f4faff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  left: -18px;
  top: 35px;
}
.gun__accent-3 {
  width: 20px;
  height: 20px;
  background: #344793;
  position: absolute;
  top: 145px;
  border-radius: 50%;
  left: -52px;
  box-shadow: 9px -33px 0 0px #344793;
}
.gun__accent-3:before {
  width: 6px;
  height: 25px;
  background: #4567cf;
  border-radius: 5px;
  transform: rotate(20deg);
  left: -30px;
  bottom: 30px;
}
.gun__accent-3:after {
  width: 6px;
  height: 6px;
  background: #4567cf;
  border-radius: 5px;
  left: -36px;
  bottom: 20px;
}
.gun__accent-4 {
  width: 30px;
  background: #fdbb2f;
  height: 15px;
  top: 92px;
  left: 10px;
  position: absolute;
  background: linear-gradient(115deg, #344793 90%, #f4faff 90%);
}
.gun__accent-4:before {
  border-radius: 50%;
  bottom: 8px;
  left: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid #4567cf;
}
.gun__accent-4:after {
  background: #f4faff;
  width: 40px;
  height: 20px;
  border-radius: 100%;
  left: -30px;
  bottom: -10px;
}
.gun__trigger {
  position: absolute;
  width: 30px;
  height: 45px;
  z-index: 5;
  background: radial-gradient(circle at 50% 80%, white 38%, #344793 38%, #344793 48%, #f97822 48%);
  transform: rotate(-80deg) translate(10px, -45px);
  border-radius: 20%;
  border-top-left-radius: 50% 100%;
  border-top-right-radius: 60% 100%;
  border: 4px solid #344793;
}

.bullet {
  width: 82px;
  height: 18px;
  background: #f88b42;
  position: absolute;
  border-radius: 6px 0 0 6px;
  right: -20px;
  top: 17px;
  z-index: -1;
  transform: scale(0);
  opacity: 0;
}
.bullet:before {
  background: #344793;
  border-radius: 3px;
  width: 11px;
  height: 20px;
  top: -1px;
  right: -5px;
}
.bullet:after {
  width: 0;
  height: 0;
  right: -12px;
  top: -2px;
  border-radius: 5px;
  border-top: 11px solid transparent;
  border-right: 17px solid #344793;
  border-bottom: 11px solid transparent;
}

@keyframes appear-shoot {
  0%, 5% {
    opacity: 0;
    transform: scale(0);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  35% {
    opacity: 1;
    transform: scale(1) translateX(158px);
  }
  70%, 100% {
    transform-origin: right bottom;
    transform: rotate(-10deg) translate(80px, 370px) scale(1);
  }
}
@keyframes trigger {
  0% {
    background: radial-gradient(circle at 50% 80%, white 38%, #344793 38%, #344793 48%, #f97822 48%);
  }
  50% {
    background: radial-gradient(circle at 50% 80%, white 58%, #344793 58%, #344793 68%, #f97822 68%);
  }
}
input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
input + label {
  display: block;
  position: relative;
  padding: 5px 0 5px 30px;
  margin: 10px 0;
  cursor: pointer;
  color: #333;
}
input + label:hover:before {
  box-shadow: 0 0 0 4px rgba(69, 103, 207, 0.4);
}
input + label:before {
  width: 16px;
  height: 16px;
  border: 2px solid #344793;
  border-radius: 50%;
  left: 0;
  transition: border .1s ease-in-out  1.6s, box-shadow .2s ease;
}
input + label:after {
  width: 20px;
  height: 20px;
  left: 0;
  opacity: 0;
  transition: opacity .1s ease-in-out  1.6s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 82.24 82.24'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23344793;%7D.cls-2%7Bfill:%23f6f6f6;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3EAsset 1%3C/title%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Objects'%3E%3Ccircle class='cls-1' cx='41.12' cy='41.12' r='41.12' transform='translate(-8.48 10.76) rotate(-13.52)'/%3E%3C/g%3E%3Cg id='Texture'%3E%3Cpath class='cls-2' d='M9.57,39.14a4.48,4.48,0,0,0-1.23.8.6.6,0,0,0-.36,0c.16.48-.58,1.84-.87,2.22.67.27.6.74,1.28,0a6.42,6.42,0,0,0,.78-1.74,1.05,1.05,0,0,1-.63-.31C9.05,39.87,9.67,39.55,9.57,39.14Z'/%3E%3Cpath class='cls-2' d='M6.35,38.3a1,1,0,0,0,.27-.09c0,.16,0,.32,0,.48.15-.06.2-.34.2-.72s.12-.6.29-.89a.56.56,0,0,0-.37,0,12.28,12.28,0,0,0-.37-1.86c-.13-.45-.22.8-.2,1s.13.65.21,1l-.52.18C6.42,37.58,6.76,37.64,6.35,38.3Z'/%3E%3Cpath class='cls-2' d='M10.16,63.73c.33-.32-.3-.54-.55-.78C9.38,63.17,10,63.59,10.16,63.73Z'/%3E%3Cpath class='cls-2' d='M8.66,48.58c0-.13.06-.79-.37-.53C8.31,48.18,8.22,48.84,8.66,48.58Z'/%3E%3Cpath class='cls-2' d='M9.13,45h0V45c.11-.49.34-1.27-.15-1-.34.21-1.53.62-1,1.24.57,0,.61-.21,1.1.07A2.3,2.3,0,0,1,9.13,45Z'/%3E%3Cpath class='cls-2' d='M8.32,27.51l.86.69C9.33,27.91,8.46,27.32,8.32,27.51Z'/%3E%3Cpath class='cls-2' d='M8.5,39.57a8.25,8.25,0,0,0-1-.31C7.82,39.45,8.06,39.73,8.5,39.57Z'/%3E%3Cpath class='cls-2' d='M9.66,27l-.43.25C9.32,27.6,9.65,27.11.........完整代码请登录后点击上方下载按钮下载查看

网友评论0