1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python3d旋转相册 用HTML+CSS代码制作3D旋转相册

python3d旋转相册 用HTML+CSS代码制作3D旋转相册

时间:2022-08-30 07:13:30

相关推荐

python3d旋转相册 用HTML+CSS代码制作3D旋转相册

二、index文件代码如下

3D旋转

*{padding: 0;

margin: 0;}

body,html{height:100%;}

/* 背景图片在这里设置 */

body{background-image: url("images/beijing.jpg");background-size: 100% 100%;}

#box{width: 280px;

height: 400px;

position: fixed;

left: 0;

right: 0;

top:0;

bottom: 0;

margin: auto;

transform-style: preserve-3d;

transform: rotateX(0deg) rotateY(0deg);

animation: go 45s linear infinite;

}

#box img{width: 280px;

height: 400px;

position: absolute;

left: 0;

top: 0;

}

#box img:nth-child(1){

transform: rotateY(0deg) translateZ(650px);}

#box img:nth-child(2){

transform: rotateY(36deg) translateZ(650px);}

#box img:nth-child(3){

transform: rotateY(72deg) translateZ(650px);}

#box img:nth-child(4){

transform: rotateY(108deg) translateZ(650px);}

#box img:nth-child(5){

transform: rotateY(144deg) translateZ(650px);}

#box img:nth-child(6){

transform: rotateY(180deg) translateZ(650px);}

#box img:nth-child(7){

transform: rotateY(216deg) translateZ(650px);}

#box img:nth-child(8){

transform: rotateY(252deg) translateZ(650px);}

#box img:nth-child(9){

transform: rotateY(288deg) translateZ(650px);}

#box img:nth-child(10){

transform: rotateY(324deg) translateZ(650px);}

@keyframes go {

0%{transform: rotateX(0deg) rotateY(0deg);}

25%{transform: rotateX(20deg) rotateY(180deg);}

50%{transform: rotateX(0deg) rotateY(360deg);}

75%{transform: rotateX(-20deg) rotateY(540deg);}

100%{transform: rotateX(0deg) rotateY(720deg);}

}

原文链接:/qq_43144014/article/details/82778764

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。