大数跨境
0
0

炫酷的等离子球(可复制源代码)

炫酷的等离子球(可复制源代码) 趣聊科技圈
2024-09-16
2

效果演示

html 代码

<link rel="stylesheet" href="index.css">
<link href="plasma.css" rel="stylesheet">
<div class="click">
  <input type="checkbox" class="switcher" checked="checked">
  <div class="glassball">
    <div class="electrode"></div>
    <div class="rays">
      <div class="ray">
        <span></span><span></span><span></span>
      </div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
    </div>
    <div class="rays">
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
    </div>
    <div class="rays">
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
    </div>
    <div class="rays">
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray bigwave"><span></span><span></span></div>
    </div>
    <div class="rays">
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
    </div>
    <div class="rays">
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
      <div class="ray"><span></span><span></span><span></span></div>
    </div>

  </div>
  <div class="base">
    <div></div>
    <div></div><span></span>
  </div>
  <div class="switch"></div>
</div>

CSS 代码

html {
  height100%;
}
body {margin0;backgroundradial-gradient(#607d8b 15%, #000000 100%);font-family: Arial, Helvetica, sans-serif;
}
body,
body * {
  box-sizing: border-box;
}.click {position: relative;margin0 auto;width350px;height350px;top10vh;
}.base {position: absolute;background#222;width300px;height200px;margin3em auto;z-index: -2;top286px;left25px;
}
.base:before {position: absolute;top: -44px;width300px;height5em;border-radius100%;content"";backgroundradial-gradient(#222 20%, #353535);backgroundconic-gradient(from 167deg, #666666, #232323, #232323, #666666);border2px solid #597481;box-sizing: border-box;left0;z-index0;
}
.base:after {position: absolute;left: -35px;bottom: -65px;width370px;height110px;border-radius30% 30% 50% 50%;content"";background#222222;z-index: -1;
}
.base div {background#222222;height100px;margin-top3em;float: left;margin-left: -53px;width63%;transformrotate(-85deg);z-index: -1;position: relative;
}
.base div + div {margin-top: -99px;margin-left164px;transformrotate(85deg);
}
.base span {position: absolute;left: -51px;bottom: -4px;width402px;height160px;border-radius0% 0% 80% 80%;content"";background#242f3400;z-index0;border2px solid transparent;border-bottom-color#435761;
}
input.switcher {width48px;height48px;opacity0;position: absolute;z-index3333;margin0;cursor: pointer;outline: none;border-radius50px !important;top425px;left151px;
}
.glassball {position: relative;overflow: hidden;margin0 auto;width100%;height100%;border-radius100%;background-colorrgb(255 255 255 / 0.15);top0%;box-shadow0 20px 30px rgba(0000.2),inset 0px 10px 30px 5px rgba(2552552551);position: absolute;
}
.glassball:after {
  backgroundradial-gradient(ellipse at center,rgba(2552552550.50%,rgba(255255255070%
  );border-radius50%;box-shadow: inset 0 20px 30px rgb(255 255 255 / 30%);content"";height96%;left2%;position: absolute;width96%;top2%;z-index1;
}
.glassball:hover {cursor: grab;}
.glassball:before {position: absolute;left48%;top50%;width0px;height0px;backgroundradial-gradient(circle closest-side, #9c27b0, transparent);transformtranslate(-45%, -48%);transition: width 0.2s ease, height 0.2s ease;animation: spark 5ms ease 0s infinite alternate;border8px dotted #24e6ff;filterblur(15px);border-radius100%;z-index2;font-size10em;color#d6faff;text-align: center;line-height1;content"s";display: none;opacity0.75;}
.glassball:hover:before {width120px;height150px;}
input.switcher:checked + .glassball:before,
input.switcher:checked + .glassball:after {display: block;}
input.switcher:checked + .glassball:after {width97%;height97%;left1.5%;top1.5%;}
input.switcher:checked + .glassball:hover:after {
  animation: rotation 3s ease 0s infinite alternate;
  backgroundradial-gradient(ellipse at center,#ffffff7d 0%,#54ecff94 10%,transparent 100%);filterbrightness(1.75);opacity0.5;}
input.switcher:checked + .glassball {
  transformtranslate3d(000);
  backface-visibility: hidden;
  perspective1000px;
  backgroundradial-gradient(
    circle,
    #ff5affb8 0%,
    #ff5affb8 20%,
    #5493d2a8 70%,
    #5493d2a8 100%
  );
  animation: innerlight 5s linear 0s infinite,
    shake 0.82s cubic-bezier(0.360.070.190.97) both;
  transition: background 0.4s ease 0s;
  box-shadow0 0 15px 5px #5493d2a8;
  border1px solid transparent;
}

.switch {
  background#1b1b1b;
  width37px;
  height37px;
  position: absolute;
  margin-leftcalc(50% - 19px);
  top430px;
  border3px solid #4e4e4e;
  z-index5;
  font-size0.75em;
  border-radius100%;
  box-shadow0 0 10px 0px #0000000 0 5px 1px #2d2d2d0 0 3px 1px #000 inset;
}
.switch::before {
  content"";
  position: absolute;
  width13px;
  height13px;
  bottom6px;
  border3px solid #4e4e4e;
  border-top-color: transparent;
  border-radius100%;
  left6px;
}
.switch::after {
  content"";
  position: absolute;
  width3px;
  height9px;
  bottom16px;
  left14px;
  background#4e4e4e;}
input:checked + div + div + .switch {backgroundlinear-gradient(to bottom, #171717, #404040);color#fff;box-shadow0 0 10px 0px #03a9f40 0 5px 1px #03a9f4;border-color#222222d1;}
input:checked + div + div + .switch:before {border-color: transparent #03a9f4 #03a9f4 #03a9f4;}
input:checked + div + div + .switch:after {background#03a9f4;}
.electrode {backgroundlinear-gradient(75deg, #3a3a3a 20%, #2d2d2d);width1em;height8.75em;bottom1.25em;position: absolute;leftcalc(50% - 0.5em);overflow: visible;border-bottom1px solid #657882;border-radius0 0 6px 5px;}
.electrode:before {position: absolute;left: -16px;top: -40px;width3em;height3em;border-radius100%;content"";backgroundradial-gradient(at top left, #4a4949 20%, #2d2d2d);border1px solid #758e99;box-sizing: border-box;
}.electrode:after {position: absolute;left: -3px;bottom: -11px;width1.375em;height1em;border-radius140px/50px;content"";backgroundlinear-gradient(-263deg, #191919 20%, #0a0a0a);z-index: -1;}
input.switcher:checked + .glassball .electrode:after {backgroundlinear-gradient(-263deg, #3a3a3a 20%, #2d2d2d);}
input.switcher:checked + .glassball .electrode:before {backgroundradial-gradient(ellipse farthest-corner at 30px 30px,#999,#e449ff,#e449ff,#9763ff,#62edff,#fff);box-shadow0 0 10px 2px #e449ffb30 0 10px 2px #fff,0 0 50px -10px #fff inset;border-color#ffffff94;}
input.switcher + .glassball .rays {display: none;}
input.switcher:checked + .glassball .rays {display: block;float: left;width100%;height100%;position: absolute;}
.ray {width10em;height2em;position: absolute;bottom9em;filterdrop-shadow(0px 0px 7px #9660f7) drop-shadow(0px 0px 2px #fff);}
.ray:before {content"";width0.5em;height0.45em;border2px dashed #03a9f4;position: absolute;border-width3px 3px 1px 1px;transformrotate(87deg);top0.3em;left3px;border-radius10px 5px 8px 7px;filterblur(2px);box-shadow0 0 10px -1px black;}
.ray:after {content"s";float: left;width0.5em;height1.5em;margin-top20px;margin-left0px;animation: blink 1s linear 0s infinite alternate;backgroundradial-gradient(circle closest-side, #9c27b0, transparent);transformtranslate(-45%, -48%);transition: width 0.2s ease, height 0.2s ease;border8px dotted #24e6ff;filterblur(5px);border-radius100%;z-index2;font-size4em;color#d6faff;text-align: center;line-height1;}
.ray span {width4em;height1em;border: solid 0.25em #000;border-radius238%/50px 50px 0 0;position: absolute;top0.5em;left0;border-color#6bbdff transparent transparent transparent;}
.ray span + span {left30%;transformrotate(180deg);top0.15em;}
.ray span + span + span {left60%;transformrotate(0deg);top0.5em;}
.ray span:last-of-type:before {content"";float: right;width8px;height8px;background#d1eefb;border-radius100%;box-shadow0 0 4px 3px #fff;filterblur(1px);margin-top: -2px;left3px;position: relative;}
.ray.bigwave span:last-of-type:before {content"";float: left;width8px;height8px;background#d1eefb;border-radius100%;box-shadow0 0 4px 3px #fff;filterblur(1px);margin-top: -3px;left: -2px;position: relative;}
.ray.bigwave span {width55%;border-width4px;}
.ray.bigwave span + span {width60%;left40%;border-width5px;margin-left4px;margin-top2px;}
.rays + .rays {transformrotate(180deg);}
.rays + .rays + .rays {transformrotate(90deg);}
.rays + .rays + .rays + .rays {transformrotate(270deg);}
.rays + .rays + .rays + .rays + .rays {transformskew(-187deg0degscale(0.675rotate(0deg);display: none;animation: touchray1 2.5s ease 0.1s infinite alternate;
}.rays + .rays + .rays + .rays + .rays + .rays {transformskew(-140deg, -40degscale(0.675rotate(180deg);display: none;animation: touchray2 1s ease 0.25s infinite;}
input.switcher:checked.glassball:hover.rays.rays.rays.rays.rays {display: block;}
.rays + .rays + .rays + .rays + .rays .ray {width8.5em;animation: ray1 0.5s linear 0s infinite alternate;}
.rays + .rays + .rays + .rays + .rays .ray span {border-top-width8px;}.ray:nth-of-type(1) {animation: ray1 0.5s linear 0s infinite;}
.ray:nth-of-type(2) {animation: ray1 0.75s linear 0s infinite alternate;}
.ray:nth-of-type(3) {animation: ray1 0.65s linear 0s infinite reverse;}
.ray:nth-of-type(4) {animation: ray1 0.95s linear 0s infinite alternate;}.ray:nth-of-type(5) {animation: ray1 0.85s linear 0s infinite reverse;}.rays + .rays .ray:nth-of-type(1) {animation-duration1.55s;}.rays + .rays .ray:nth-of-type(2) {animation-duration1.75s;}.rays + .rays .ray:nth-of-type(3) {animation-duration0.65s;}.rays + .rays .ray:nth-of-type(4) {animation-duration1.85s;}.rays + .rays .ray:nth-of-type(5) {animation-duration1.6s;}.rays + .rays + .rays .ray:nth-of-type(1) {animation-duration1.15s;}.rays + .rays + .rays .ray:nth-of-type(2) {animation-duration1.5s;}.rays + .rays + .rays .ray:nth-of-type(3) {animation-duration1.35s;}.rays + .rays + .rays .ray:nth-of-type(4) {animation-duration1s;}.rays + .rays + .rays .ray:nth-of-type(5) {animation-duration1.25s;}.rays + .rays + .rays + .rays .ray:nth-of-type(1) {animation-duration1.05s;}.rays + .rays + .rays + .rays .ray:nth-of-type(2) {animation-duration1.35s;}.rays + .rays + .rays + .rays .ray:nth-of-type(3) {animation-duration1.25s;}.rays + .rays + .rays + .rays .ray:nth-of-type(4) {animation-duration1.15s;}.rays + .rays + .rays + .rays .ray:nth-of-type(5) {animation-duration1.45s;}.rays + .rays + .rays + .rays + .rays .ray:nth-of-type(1) {animation-duration0.85s;}.rays + .rays + .rays + .rays + .rays .ray:nth-of-type(2) {animation-duration0.95s;}.rays + .rays + .rays + .rays + .rays .ray:nth-of-type(3) {animation-duration0.75s;}.rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(1) {animation-duration1.1s;}.rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(2) {animation-duration1.25s;}.rays + .rays + .rays + .rays + .rays + .rays .ray:nth-of-type(3) {animation-duration1.35s;}
@keyframes rotation {50% {transformrotate(360deg);}}
@keyframes blink {0% {backgroundradial-gradient(circle closest-side, #ff5affb8, #5493d2a8);transformtranslate(-50%, -50%scale(0.75rotate(6deg);}50% {backgroundradial-gradient(circle closest-side, #5493d2a8, #ff5affb8);transformtranslate(-50%, -50%scale(0.5rotate(2deg);}100% {backgroundradial-gradient(circle closest-side, #ffffffa8, #5493d2a8);transformtranslate(-50%, -50%scale(0.35rotate(11deg);}}
@keyframes innerlight {0% {background-size105% 105%;background-position: center center;box-shadow0 0 15px 5px #5493d2a8;}25% {box-shadow0 0 15px 5px #ff5aff30;}50% {background-size85% 85%;background-position: center center;box-shadow0 0 15px 5px #5493d2a8;}75% {box-shadow0 0 15px 5px #ff5aff30;}100% {background-size105% 105%;background-position: center center;box-shadow0 0 15px 5px #5493d2a8;}}
@keyframes touchray1 {0% {transformskew(-187deg0degscale(0.675rotate(0deg);}50% {transformskew(-185deg2degscale(0.525rotate(180deg);opacity1;}51% {opacity0;}52% {opacity1;}100% {transformskew(-188deg, -2degscale(0.625rotate(360deg);}}
@keyframes touchray2 {0% {transformskew(-140deg, -40degscale(0.675rotate(140deg);}50% {transformskew(-143deg, -42degscale(0.525rotate(0deg);opacity1;}51% {opacity0;}52% {opacity1;}100% {transformskew(-145deg, -38degscale(0.625rotate(210deg);}}
@keyframes spark {0% {backgroundradial-gradient(circle closest-side, #ff5affb8, #5493d2a8);transformtranslate(-50%, -50%scale(0.75rotate(0deg);}50% {backgroundradial-gradient(circle closest-side, #5493d2a8, #ff5affb8);transformtranslate(-50%, -50%scale(0.5rotate(180deg);}100% {backgroundradial-gradient(circle closest-side, #ffffffa8, #5493d2a8);transformtranslate(-50%, -50%scale(1rotate(360deg);}}
@keyframes ray1 {0% {opacity0;transformrotate(0degtranslate(0px0px);}12% {opacity1;transformrotate(22degtranslate(0px, -35px);filterbrightness(1.75);}25% {opacity0;transformrotate(45degtranslate(-33px, -69px);}37% {opacity1;transformrotate(67degtranslate(-64px, -86px);filterbrightness(1.15);}50% {opacity0;transformrotate(90degtranslate(-108px, -93px);}62% {opacity1;transformrotate(112degtranslate(-140px, -90px);filterbrightness(1.25);}75% {opacity0;transformrotate(135degtranslate(-169px, -69px);}87% {opacity1;transformrotate(157degtranslate(-185px, -36px);filterbrightness(1.75);}100% {opacity0;transformrotate(180degtranslate(-192px6px);}}

【声明】内容源于网络
0
0
趣聊科技圈
🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
内容 511
粉丝 0
趣聊科技圈 🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
总阅读63
粉丝0
内容511