css样式贪图蛇的编写,CSS3 3D游蛇

CSS

语言:

CSSSCSS

确定

body {

display: -webkit-box;

display: -webkit-flex;

display: -ms-flexbox;

display: flex;

-webkit-box-pack: center;

-webkit-justify-content: center;

-ms-flex-pack: center;

justify-content: center;

-webkit-box-align: center;

-webkit-align-items: center;

-ms-flex-align: center;

align-items: center;

-webkit-flex-wrap: wrap;

-ms-flex-wrap: wrap;

flex-wrap: wrap;

-webkit-box-orient: vertical;

-webkit-box-direction: normal;

-webkit-flex-direction: column;

-ms-flex-direction: column;

flex-direction: column;

width: 100vw;

height: 100vh;

-webkit-perspective: 1000px;

perspective: 1000px;

background: -webkit-linear-gradient(top, red 0%, blue 100%);

background: linear-gradient(to bottom, red 0%, blue 100%);

}

@-webkit-keyframes snake {

from, to {

margin-left: 100px;

}

50% {

margin-left: -100px;

}

}

@keyframes snake {

from, to {

margin-left: 100px;

}

50% {

margin-left: -100px;

}

}

div {

width: 50px;

height: 50px;

border-radius: 50%;

background: -webkit-linear-gradient(top, red 0%, blue 100%);

background: linear-gradient(to bottom, red 0%, blue 100%);

margin-top: -25px;

margin-left: 100px;

}

div:nth-child(1) {

-webkit-transform: translate3d(10px, 0px, 20px);

transform: translate3d(10px, 0px, 20px);

-webkit-animation: snake 2s 200ms infinite ease-in-out;

animation: snake 2s 200ms infinite ease-in-out;

}

div:nth-child(2) {

-webkit-transform: translate3d(20px, 0px, 40px);

transform: translate3d(20px, 0px, 40px);

-webkit-animation: snake 2s 400ms infinite ease-in-out;

animation: snake 2s 400ms infinite ease-in-out;

}

div:nth-child(3) {

-webkit-transform: translate3d(30px, 0px, 60px);

transform: translate3d(30px, 0px, 60px);

-webkit-animation: snake 2s 600ms infinite ease-in-out;

animation: snake 2s 600ms infinite ease-in-out;

}

div:nth-child(4) {

-webkit-transform: translate3d(40px, 0px, 80px);

transform: translate3d(40px, 0px, 80px);

-webkit-animation: snake 2s 800ms infinite ease-in-out;

animation: snake 2s 800ms infinite ease-in-out;

}

div:nth-child(5) {

-webkit-transform: translate3d(50px, 0px, 100px);

transform: translate3d(50px, 0px, 100px);

-webkit-animation: snake 2s 1000ms infinite ease-in-out;

animation: snake 2s 1000ms infinite ease-in-out;

}

div:nth-child(6) {

-webkit-transform: translate3d(60px, 0px, 120px);

transform: translate3d(60px, 0px, 120px);

-webkit-animation: snake 2s 1200ms infinite ease-in-out;

animation: snake 2s 1200ms infinite ease-in-out;

}

div:nth-child(7) {

-webkit-transform: translate3d(70px, 0px, 140px);

transform: translate3d(70px, 0px, 140px);

-webkit-animation: snake 2s 1400ms infinite ease-in-out;

animation: snake 2s 1400ms infinite ease-in-out;

}

div:nth-child(8) {

-webkit-transform: translate3d(80px, 0px, 160px);

transform: translate3d(80px, 0px, 160px);

-webkit-animation: snake 2s 1600ms infinite ease-in-out;

animation: snake 2s 1600ms infinite ease-in-out;

}

div:nth-child(9) {

-webkit-transform: translate3d(90px, 0px, 180px);

transform: translate3d(90px, 0px, 180px);

-webkit-animation: snake 2s 1800ms infinite ease-in-out;

animation: snake 2s 1800ms infinite ease-in-out;

}

div:nth-child(10) {

-webkit-transform: translate3d(100px, 0px, 200px);

transform: translate3d(100px, 0px, 200px);

-webkit-animation: snake 2s 2000ms infinite ease-in-out;

animation: snake 2s 2000ms infinite ease-in-out;

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值