图片3D旋转

 

<!DOCTYPE html5>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D旋转幻灯片</title>
</head>
<style type="text/css">
    body{
        perspective:500px;
        perspective-origin:50% 30%;/*坐标基点(X,Y)*/
        background: #ff9;
        overflow: hidden;/*隐藏溢出*/
    }
    #zhuan{
        position: relative;
        width: 900px;
        height: 350px;
        margin: 150px auto;
        transform-style:preserve-3d;
        animation:xuanzhuan 9s steps(35) infinite;
    }
    @keyframes xuanzhuan{
            to{
                transform:rotateY(1080deg);
            }
        }
    #zhuan div{
        position: absolute;
        width: 100px;
        height: 111px;
        left: calc(50% - 50px);
        bottom: 50%;
        transform-origin:50% 0;

        background-repeat: no-repeat;
        transform-style:preserve-3d;
        background-size: 1200px 111px;
    }

    #zhuan div:after{
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        transform-origin:50% 100%;
        transform:rotateX(90deg) translateZ(-3px) translateY(-5px);
        box-shadow: inset 0px -100px 100px -100px #000;
    }

    #zhuan div:nth-child(0){
        transform:rotateY(0deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(1){
        transform:rotateY(30deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(2){
        transform:rotateY(60deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(3){
        transform:rotateY(90deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(4){
        transform:rotateY(120deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(5){
        transform:rotateY(150deg) translateZ(-300px);
        background-image: url(1.jpg);
    }

    #zhuan div:nth-child(6){
        transform:rotateY(180deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(7){
        transform:rotateY(210deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(8){
        transform:rotateY(240deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(9){
        transform:rotateY(270deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(10){
        transform:rotateY(300deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(11){
        transform:rotateY(330deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
    #zhuan div:nth-child(12){
        transform:rotateY(360deg) translateZ(-300px);
        background-image: url(1.jpg);
    }
</style>
<body>
    <div id="zhuan">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>

        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>

 

转载于:https://www.cnblogs.com/Harold-Hua/p/5245126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值