svg+css实现粉色爱心wifi信号开关动画效果代码
代码语言:html
所属分类:表白
代码描述:svg+css实现粉色爱心wifi信号开关动画效果代码
代码标签: svg css 粉色 爱心 wifi 信号 开关 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
min-height: 100vh;
background-color: #080607;
}
#group-wifi, #group-hearth {
fill: #413544;
}
#wrapper {
display: grid;
place-items: center;
min-height: 100vh;
}
#svg {
width: 200px;
height: 200px;
display: block;
position: relative;
}
#hearth-3 {
z-index: 0;
}
.active #group-hearth [id^=hearth] {
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1;
-webkit-animation-duration: 3s;
animation-duration: 3s;
fill: #FF87CA;
}
.active #group-hearth #hearth-0 {
-webkit-animation-name: pulse1;
animation-name: pulse1;
}
.active #group-hearth #hearth-1 {
-webkit-animation-name: pulse2;
animation-name: pulse2;
}
.active #group-hearth #hearth-2 {
-webkit-animation-name: pulse3;
animation-name: pulse3;
}
.active #group-hearth #hearth-3 {
-webkit-animation-name: pulse4;
animation-name: pulse4;
}
@-webkit-keyframes pulse1 {
0% {
fill: #413544;
}
1% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@keyframes pulse1 {
0% {
fill: #413544;
}
1% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@-webkit-keyframes pulse2 {
0% {
fill: #413544;
}
10% {
fill: #413544;
}
11% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@keyframes pulse2 {
0% {
fill: #413544;
}
10% {
fill: #413544;
}
11% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@-webkit-keyframes pulse3 {
0% {
fill: #413544;
}
20% {
fill: #413544;
}
21% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@keyframes pulse3 {
0% {
fill: #413544;
}
20% {
fill: #413544;
}
21% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@-webkit-keyframes pulse4 {
0% {
fill: #413544;
}
55% {
fill: #413544;
}
56% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
@keyframes pulse4 {
0% {
fill: #413544;
}
55% {
fill: #413544;
}
56% {
fill: #FF87CA;
}
100% {
fill: #FF87CA;
}
}
/*TOGGLE*/
.toggle-wrapper {
height: 40px;
}
.toggle-button-cover {
display: table-cell;
position: relative;
width: 200px;
box-sizing: border-box;
}
.button-cover, .knobs {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.button {
position: relative;
top: 50%;
width: 74px;
height: 36px;
margin: 0 auto;
overflow: hidden;
}
.button.r {
border-radius: 100px;
}
.checkbox {
position: relative;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
opacity: 0;
cursor: pointer;
z-index: 3;
}
.knobs {
z-index: 2;
background-color: #413544;
}
#button-3.........完整代码请登录后点击上方下载按钮下载查看
网友评论0