栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

HTML+CSS案例展示(CSS3Dphoto)

HTML+CSS案例展示(CSS3Dphoto)

参考来源:

黑马程序员pink老师前端入门教程,零基础必看的h5(html5)+css3+移动端前端视频教程_哔哩哔哩_bilibili

总结:
    transform:translate(x,y) rotate(180deg) scale() ... 顺序对最后的效果有影响,需要根据需求安排位移和其他属性的顺序;实现暂停动画效果:animation-play-state:paused; 经常和鼠标经过等其他配合使用;实现动画走回来,而不是跳回来:animation-direction:alternate; ;实现动画结束后,停在结束位置:animation-fill-mode:forwards; ;实现打字机动画效果:steps() 指定时间函数的间隔步长,用来分几步完成动画,有了 steps() 就不要写 ease 或 linear ;实现大数据热点图时,不要用 scale ,会把阴影放大;3D透视 perspective 和 3D呈现 transform-style:preserve-3d; 需要写在被观察盒子的父级盒子里面;
网页如下:

css3dphoto

网页代码如下:

HTML+CSS:




    
    
    
    css3dphoto
    
        * {
            margin: 0;
            padding: 0;
        }
        body {
            perspective: 1500px;
        }
        section {
            position: relative;
            margin: 500px auto;
            width: 300px;
            height: 206px;
            transform-style: preserve-3d;
            animation: rotatephoto  10s linear;
            background: url(img1.jpg) no-repeat;
        }
        section:hover {
            animation-play-state: paused;
        }
        @keyframes rotatephoto {
            0% {
                transform: rotateY(0);
            }
            100% {
                transform: rotateY(360deg);
            }
        }
        section div {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url(img.jpg) no-repeat;
        }
        section div:nth-child(1) {
            transform: translateZ(300px);
        }
        section div:nth-child(2) {
            transform: rotateY(60deg) translateZ(300px);
        }
        section div:nth-child(3) {
            transform: rotateY(120deg) translateZ(300px);
        }
        section div:nth-child(4) {
            transform: rotateY(180deg) translateZ(300px);
        }
        section div:nth-child(5) {
            transform: rotateY(240deg) translateZ(300px);
        }
        section div:nth-child(6) {
            transform: rotateY(300deg) translateZ(300px);
        }
    


    

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/721841.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号