css3下雪的效果,首页下雪效果

c4468b3f4df77e96b0a416fa2a870fba.png

首页下雪效果

Posted on

2019-09-17 14:18 大艾木 阅读(...) 评论(...) 编辑 收藏

下雪效果,转自网络,快去试试吧 :)

原理

通过多张雪花图片,不同速度的移动,达到下雪的效果。

清晰度: 清晰 ----> 模糊

远近: 近 ----> 远

HTML

CSS

.snow-container {

position: fixed;

top:0;

left:0;

right: 0;

bottom:0;

overflow: hidden;

z-index: 2;

pointer-events: none;

background-color: none;

}

.snow {

display: block;

position: absolute;

z-index: 2;

top: 0;

right: 0;

bottom: 0;

left: 0;

pointer-events: none;

-webkit-transform: translate3d(0, -100%, 0);

transform: translate3d(0, -100%, 0);

-webkit-animation: snow linear infinite;

animation: snow linear infinite;

}

.snow.foreground {

background-image: url("https://dl6rt3mwcjzxg.cloudfront.net/assets/snow/snow-large-075d267ecbc42e3564c8ed43516dd557.png");

-webkit-animation-duration: 15s;

animation-duration: 15s;

}

.snow.foreground.layered {

-webkit-animation-delay: 7.5s;

animation-delay: 7.5s;

}

.snow.middleground {

background-image: url(https://dl6rt3mwcjzxg.cloudfront.net/assets/snow/snow-medium-0b8a5e0732315b68e1f54185be7a1ad9.png);

-webkit-animation-duration: 20s;

animation-duration: 20s;

}

.snow.middleground.layered {

-webkit-animation-delay: 10s;

animation-delay: 10s;

}

.snow.background {

background-image: url(https://dl6rt3mwcjzxg.cloudfront.net/assets/snow/snow-small-1ecd03b1fce08c24e064ff8c0a72c519.png);

-webkit-animation-duration: 30s;

animation-duration: 30s;

}

.snow.background.layered {

-webkit-animation-delay: 15s;

animation-delay: 15s;

}

@-webkit-keyframes snow {

0% {

-webkit-transform: translate3d(0, -100%, 0);

transform: translate3d(0, -100%, 0);

}

100% {

-webkit-transform: translate3d(15%, 100%, 0);

transform: translate3d(15%, 100%, 0);

}

}

@keyframes snow {

0% {

-webkit-transform: translate3d(0, -100%, 0);

transform: translate3d(0, -100%, 0);

}

100% {

-webkit-transform: translate3d(15%, 100%, 0);

transform: translate3d(15%, 100%, 0);

}

}

原文链接:https://www.cnblogs.com/mlocvery/p/11533468.html

如有疑问请与原作者联系

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com

特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值