纯css实现等离子球放电动画效果代码
代码语言:html
所属分类:动画
代码描述:纯css实现等离子球放电动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
html {
height: 100%;
}
body {
margin: 0;
background: radial-gradient(#607d8b 15%, #000000 100%);
font-family: Arial, Helvetica, sans-serif;
}
body,
body * {
box-sizing: border-box;
}
.click {
position: relative;
margin: 0 auto;
width: 350px;
height: 350px;
top: 10vh;
}
.base {
position: absolute;
background: #222;
width: 300px;
height: 200px;
margin: 3em auto;
z-index: -2;
top: 286px;
left: 25px;
}
.base:before {
position: absolute;
top: -44px;
width: 300px;
height: 5em;
border-radius: 100%;
content: "";
background: radial-gradient(#222 20%, #353535);
background: conic-gradient(from 167deg, #666666, #232323, #232323, #666666);
border: 2px solid #597481;
box-sizing: border-box;
left: 0;
z-index: 0;
}
.base:after {
position: absolute;
left: -35px;
bottom: -65px;
width: 370px;
height: 110px;
border-radius: 30% 30% 50% 50%;
content: "";
background: #222222;
z-index: -1;
}
.base div {
background: #222222;
height: 100px;
margin-top: 3em;
float: left;
margin-left: -53px;
width: 63%;
transform: rotate(-85deg);
z-index: -1;
position: relative;
}
.base div + div {
margin-top: -99px;
margin-left: 164px;
transform: rotate(85deg);
}
.base span {
position: absolute;
left: -51px;
bottom: -4px;
width: 402px;
height: 160px;
border-radius: 0% 0% 80% 80%;
content: "";
background: #242f3400;
z-index: 0;
border: 2px solid transparent;
border-bottom-color: #435761;
}
input.switcher {
width: 48px;
height: 48px;
opacity: 0;
position: absolute;
z-index: 3333;
margin: 0;
cursor: pointer;
outline: none;
border-radius: 50px !important;
top: 425px;
left: 151px;
}
.glassball {
position: relative;
overflow: hidden;
margin: 0 auto;
width: 100%;
height: 100%;
border-radius: 100%;
background-color: rgb(255 255 255 / 0.15);
top: 0%;
box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2),
inset 0px 10px 30px 5px rgba(255, 255, 255, 1);
position: absolute;
}
.glassball:after {
background: radial-gradient(
ellipse at center,
rgba(255, 255, 255, 0.5) 0%,
rgba(255, 255, 255, 0) 70%
);
border-radius: 50%;
box-shadow: inset 0 20px 30px rgb(255 255 255 / 30%);
content: "";
height: 96%;
left: 2%;
position: absolute;
width: 96%;
top: 2%;
z-index: 1;
}
.glassball:hover {
cursor: grab;
}
.glassball:before {
position: absolute;
left: 48%;
top: 50%;
width: 0px;
height: 0px;
background: radial-gradient(circle closest-side, #9c27b0, transparent);
transform: translate(-45%, -48%);
transition: width 0.2s ease, height 0.2s ease;
animation: spark 5ms ease 0s infinite alternate;
border: 8px dotted #24e6ff;
filter: blur(15px);
border-radius: 100%;
z-index: 2;
font-size: 10em;
color: #d6faff;
text-align: center;
line-height: 1;
content: "s".........完整代码请登录后点击上方下载按钮下载查看
网友评论0