css实现窗外冬季雪花飞舞动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现窗外冬季雪花飞舞动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #35a66f;
text-align: center;
}
#christmas {
background: #162a4e;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzBjMWQzOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzFhMzE1OCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
background-size: 100%;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0c1d38), color-stop(100%, #1a3158));
background-image: -moz-linear-gradient(#0c1d38, #1a3158);
background-image: -webkit-linear-gradient(#0c1d38, #1a3158);
background-image: linear-gradient(#0c1d38, #1a3158);
position: relative;
width: 182px;
height: 182px;
margin: 50px auto;
overflow: hidden;
/* iOS hack for border radius bleed with transforms */
-webkit-mask-image: -webkit-radial-gradient(circle, white, black);
}
#christmas .ground {
-moz-border-radius-topright: 130px 40px;
-webkit-border-top-right-radius: 130px 40px;
border-top-right-radius: 130px 40px;
position: absolute;
width: 133px;
height: 61px;
left: 0;
bottom: 0;
background: white;
}
#christmas .ground:before {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
content: " ";
position: absolute;
width: 130px;
height: 100px;
top: 10px;
right: -60px;
background: white;
}
#christmas .ground:after {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
content: " ";
position: absolute;
width: 70px;
height: 70px;
top: 5px;
right: -75px;
background: white;
}
#christmas .tree {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-color: transparent transparent #23915b transparent;
}
#christmas .tree:before {
content: " ";
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-color: transparent transparent #23915b transparent;
}
#christmas .tree:after {
content: " ";
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-color: transparent transparent #23915b transparent;
}
#christmas .tree.left {
left: 28px;
bottom: 78px;
border-width: 0 18px 24px 18px;
}
#christmas .tree.left:before {
top: 10px;
left: -21px;
border-width: 0 21px 28px 21px;
}
#christmas .tree.left:after {
top: 22px;
left: -24px;
border-width: 0 24px 32px 24px;
}
#christmas .tree.left .snow {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
-moz-box-shadow: -2px 2px 0 0 white, 2px 2px 0 0 white, -3px 3px 0 0 white, 3px 3px 0 0 white, -12px 14px 0 0 white, -13px 17px 0 1px white, -16px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 11px 14px 0 1px white, 13px 17px 0 1px white, 15px 19px 0 0 white;
-webkit-box-shadow: -2px 2px 0 0 white, 2px 2px 0 0 white, -3px 3px 0 0 white, 3px 3px 0 0 white, -12px 14px 0 0 white, -13px 17px 0 1px white, -16px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 11px 14px 0 1px white, 13px 17px 0 1px white, 15px 19px 0 0 white;
box-shadow: -2px 2px 0 0 white, 2px 2px 0 0 white, -3px 3px 0 0 white, 3px 3px 0 0 white, -12px 14px 0 0 white, -13px 17px 0 1px white, -16px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 11px 14px 0 1px white, 13px 17px 0 1px white, 15px 19px 0 0 white;
position: absolute;
top: 1px;
left: -3px;
width: 6px;
height: 6px;
background: white;
z-index: 1;
}
#christmas .tree.left .snow:after {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
-moz-box-shadow: -14px 14px 0 0 white, -15px 17px 0 1px white, -18px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 12px 17px 0 3px white, 16px 17px 0 1px white, 18px 19px 0 0 white, 11px 20px 0 1px white, 16px 20px 0 1px white, 18px 22px 0 1px white, 21px 25px 0 0 white, -2px 27px 0 1px white;
-webkit-box-shadow: -14px 14px 0 0 white, -15px 17px 0 1px white, -18px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 12px 17px 0 3px white, 16px 17px 0 1px white, 18px 19px 0 0 white, 11px 20px 0 1px white, 16px 20px 0 1px white, 18px 22px 0 1px white, 21px 25px 0 0 white, -2px 27px 0 1px white;
box-shadow: -14px 14px 0 0 white, -15px 17px 0 1px white, -18px 19px 0 0 white, -9px 16px 0 0 white, -5px 15px 0 2px white, -9px 13px 0 0 white, 6px 15px 0 2px white, 0 13px 0 1px white, 12px 17px 0 3px white, 16px 17px 0 1px white, 18px 19px 0 0 white, 11px 20px 0 1px white, 16px 20px 0 1px white, 18px 22px 0 1px white, 21px 25px 0 0 white, -2px 27px 0 1px white;
content: " ";
position: absolute;
top: 14px;
left: 0px;
width: 6px;
height: 6px;
background: white;
z-index: 1;
}
#christmas .tree.right {
left: 60px;
bottom: 45px;
border-width: 0 18px 24px 18px;
}
#christmas .tree.right:before, #christmas .tree.right:after {
display: none;
}
#christmas .tree.right .snow {
-moz-border-radius: 50%;
-webkit-.........完整代码请登录后点击上方下载按钮下载查看
网友评论0