svg实现全套天气动画图标效果代码
代码语言:html
所属分类:布局界面
代码描述:svg实现全套天气动画图标效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
@charset "utf-8";
body {
background: #222;
box-sizing: border-box;
color: #fff;
font-family: "Cabin", sans-serif;
font-size: 16px;
text-align: center;
}
.container {
max-width: 720px;
width: 95%;
margin: 0 auto;
}
.container h1 {
font-size: 2.5em;
}
footer {
padding-bottom: 2em;
}
svg {
width: 110px;
}
#smallcloud path {
will-change: transform;
-webkit-animation: bgCloud 6s linear infinite;
animation: bgCloud 6s linear infinite;
}
#bigCloudRain path {
-webkit-animation: cloud-color 8s ease infinite;
animation: cloud-color 8s ease infinite;
}
#drop1 {
-webkit-animation: droplet 1s linear infinite;
animation: droplet 1s linear infinite;
}
#drop2 {
-webkit-animation: droplet 1s linear infinite 0.4s;
animation: droplet 1s linear infinite 0.4s;
}
#drop3 {
-webkit-animation: droplet 1s linear infinite 0.8s;
animation: droplet 1s linear infinite 0.8s;
}
#flake3 {
-webkit-animation: snow-flakes 3s linear infinite;
animation: snow-flakes 3s linear infinite;
}
#flake1 {
-webkit-animation: snow-flakes 3s linear infinite 1.2s;
animation: snow-flakes 3s linear infinite 1.2s;
}
#flake2 {
-webkit-animation: snow-flakes 3s linear infinite 2s;
animation: snow-flakes 3s linear infinite 2s;
}
#mistrays path {
opacity: 1;
}
#mistrays #ray2 {
stroke-dashoffset: 5;
stroke-dasharray: 5;
-webkit-animation: dashXs 9s linear forwards infinite;
animation: dashXs 9s linear forwards infinite;
}
#mistrays #ray4, #ray5 {
stroke-dashoffset: 20;
stroke-dasharray: 20;
-webkit-animation: dashM 9s linear forwards infinite;
animation: dashM 9s linear forwards infinite;
}
#mistrays #ray6, #ray7 {
stroke-dashoffset: 14;
stroke-dasharray: 14;
-webkit-animation: dashS 9s linear forwards infinite;
animation: dashS 9s linear forwards infinite;
}
#mistrays #ray1, #ray3 {
stroke-dashoffset: 27;
stroke-dasharray: 27;
-webkit-animation: dashL 9s linear forwards infinite;
animation: dashL 9s linear forwards infinite;
}
/*#sunRays, #SunGlobe{
transform:translate(10px, -12px)
}*/
#sunRays, #sunrays, #SunGlobe {
transform-origin: 50% 50%;
-webkit-animation: spin 20s linear infinite;
animation: spin 20s linear infinite;
}
#totalSun {
transform: translate(15px, -12px) scale(0.9);
}
#thunder {
-webkit-animation: thunder-bolt 6s linear infinite;
animation: thunder-bolt 6s linear infinite;
}
#bigClouds path {
-webkit-animation: thunder-cloud 6s ease infinite;
animation: thunder-cloud 6s ease infinite;
}
@-webkit-keyframes bgCloud {
0% {
transform: translate(0px, 0px);
opacity: 0;
}
30% {
transform: translate(9px, 0px);
opacity: 1;
}
70% {
transform: translate(27px, 0px);
opacity: 1;
}
100% {
transform: translate(45px, 0px);
opacity: 0;
}
}
@keyframes bgCloud {
0% {
transform: translate(0px, 0px);
opacity: 0;
}
30% {
transform: translate(9px, 0px);
opacity: 1;
}
70% {
transform: translate(27px, 0px);
opacity: 1;
}
100% {
transform: translate(45px, 0px);
opacity: 0;
}
}
@-webkit-keyframes droplet {
0% {
transform: translate(0px, -35px);
opacity: 0;
}
30% {
transform: translate(0px, -18px);
opacity: 1;
}
80% {
transform: translate(0px, 8px);
opacity: 1;
}
100% {
transform: translate(0px, 20px);
opacity: 0;
}
}
@keyframes droplet {
0% {
transform: translate(0px, -35px);
opacity: 0;
}
30% {
transform: translate(0px, -18px);
opacity: 1;
}
80% {
transform: translate(0px, 8px);
opacity: 1;
}
100% {
transform: translate(0px, 20px);
opacity: 0;
}
}
@-webkit-keyframes cloud-color {
0% {
fill: #F4F4F4;
}
50% {
fill: #c4c4c4;
}
100% {
fill: #F4F4F4;
}
}
@keyframes cloud-color {
0% {
fill: #F4F4F4;
}
50% {
fill: #c4c4c4;
}
100% {
fill: #F4F4F4;
}
}
@-webkit-keyframes snow-flakes {
0% {
transform: translate(0px, -35px);
opacity: 0;
}
30% {
transform: translate(-10px, -18px);
opacity: 1;
}
40% {
transform: translate(0px, -8px);
opacity: 1;
}
60% {
transform: translate(10px, 0px);
opacity: 1;
}
80% {
transform: translate(0px, 8px);
opacity: 1;
}
100% {
transform: translate(10px, 20px);
opacity: 0;
}
}
@keyframes snow-flakes {
0% {
transform: translate(0px, -35px);
opacity: 0;
}
30% {
transform: translate(-10px, -18px);
opacity: 1;
}
40% {
transform: translate(0px, -8px);
opacity: 1;
}
60% {
transform: translate(10px, 0px);
opacity: 1;
}
80% {
transform: translate(0px, 8px);
opacity: 1;
}
100% {
transform: translate(10px, 20px);
opacity: 0;
}
}
@-webkit-keyframes dashXs {
0% {
opacity: 0;
stroke-dashoffset: 5;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: -5;
}
}
@keyframes dashXs {
0% {
opacity: 0;
stroke-dashoffset: 5;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: -5;
}
}
@-webkit-keyframes dashS {
0% {
opacity: 0;
stroke-dashoffset: 14;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: -14;
}
}
@keyframes dashS {
0% {
opacity: 0;
stroke-dashoffset: 14;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: -14;
}
}
@-webkit-keyframes dashM {
0% {
opacity: 0;
stroke-dashoffset: -20;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: 20;
}
}
@keyframes dashM {
0% {
opacity: 0;
stroke-dashoffset: -20;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: 20;
}
}
@-webkit-keyframes dashL {
0% {
opacity: 0;
stroke-dashoffset: -27;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: 27;
}
}
@keyframes dashL {
0% {
opacity: 0;
stroke-dashoffset: -27;
}
50% {
opacity: 1;
stroke-dashoffset: 0;
}
100% {
opacity: 0;
stroke-dashoffset: 27;
}
}
@-webkit-keyframes spin {
100% {
transform: rotate(360deg);
}
}
@keyframes spin {
100% {
transform: rotate(360deg);
}
}
@-webkit-keyframes thunder-cloud {
100%, 0% {
fill: #666;
}
20% {
fill: #555;
}
21.5% {
fill: #999;
}
25% {
fill: #555;
}
27.5% {
fill: #999;
}
30% {
fill: #555;
}
40% {
fill: #999;
}
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0