• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

如何利用景深效果,使图片近大远小,我的demo怎么是近小远大,代码如下:

想要的效果是,旋转到屏幕前变大,旋转到屏幕里面变小(近大远小)。



   
    img_3D


    @keyframes an1{
        0%{
            transform: rotateY(0deg)  ;
        }
        50%{
            transform: rotateY(180deg)  ;
        }
        100%{
            transform: rotateY(360deg) ;
        }
    }
    .container{
        margin: 200px auto;
        perspective: 2000px;
        transform-style: preserve-3d;
        animation: an1 18s linear 0s infinite;
    }
    .container img{
        width: 80px;
        height: 100px;
        margin: auto;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        position: absolute;
    }
    .container img:nth-child(1){
        transform: rotateY(0deg) translateZ(300px);
    }
    .container img:nth-child(2){
        transform: rotateY(36deg) translateZ(300px);
    }
    .container img:nth-child(3){
        transform: rotateY(72deg) translateZ(300px);
    }
    .container img:nth-child(4){
        transform: rotateY(108deg) translateZ(300px);
    }
    .container img:nth-child(5){
        transform: rotateY(144deg) translateZ(300px);
    }
    .container img:nth-child(6){
        transform: rotateY(180deg) translateZ(300px);
    }


   
        

        

        

        

        

        

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!