超简单:很火的3D立体动态相册,送给心爱的那个人

1.首先,我们一共需要三个文件,目录关系如下所示。先建index.html文件吧,电脑上先创建一个.txt文件,在里面加入代码后保存,重命名为index.html(记得把原来的.txt后缀覆盖)。html我用的谷歌浏览器。
总的三个文件,层级关系如图。
index.html代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>photo-3d</title>
        <link rel="stylesheet" href="css/index.css" />
    </head>
    <body>
        <!--/*外层最大容器*/-->
        <div class="wrap">
    <!--    /*包裹所有元素的容器*/-->
        <div class="cube">
            <!--前面图片 -->
            <div class="out_front">
                <img src="img/1.jpg"  class="pic"/>
            </div>
            <!--后面图片 -->
            <div class="out_back">
                <img src="img/2.jpg"  class="pic"/>
            </div>
            <!--左图片 -->
            <div class="out_left">
                <img src="img/3.jpg"  class="pic"/>
            </div>
            <div class="out_right">
                <img src="img/4.jpg"  class="pic"/>
            </div>
            <div class="out_top">
                <img src="img/5.jpg"  class="pic"/>
            </div>
            <div class="out_bottom">
                <img src="img/6.jpg"  class="pic"/>
            </div>
            <!--小正方体 --> 
            <span class="in_front">
                <img src="img/7.jpg" class="in_pic" />
            </span>
            <span class="in_back">
                 <img src="img/8.jpg" class="in_pic" />
            </span>
            <span class="in_left">
                <img src="img/9.jpg" class="in_pic" />
            </span>
            <span class="in_right">
                <img src="img/10.jpg" class="in_pic" />
            </span>
            <span class="in_top">
                <img src="img/11.jpg" class="in_pic" />
            </span>
            <span class="in_bottom">
                <img src="img/12.jpg" class="in_pic" />
            </span>
        </div>
        </div>
    </body>
</html>

2.同样的制作index.css文件。css目录下为index.css文件,创建.txt文件,在里面加入代码后保存,重命名为index.css。
css目录下为index.css文件,代码如下
index.css代码

html{
    background: #000;
    height: 100%;    
}
/*最外层容器样式*/
.wrap{
    position: relative;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 200px;
    margin: auto;
    /*改变左右上下,图片方块移动*/
    
}
/*包裹所有容器样式*/
.cube{
    width: 200px;
    height: 200px;
    margin: 0 auto;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(-80deg);
    -webkit-animation: rotate 20s infinite;
    /*匀速*/
    animation-timing-function: linear;
}
@-webkit-keyframes rotate{
    from{transform: rotateX(0deg) rotateY(0deg);}
    to{transform: rotateX(360deg) rotateY(360deg);}
}
.cube div{
    position: absolute;
    width: 200px;
    height: 200px;
    opacity: 0.8;
    transition: all .4s;
}
/*定义所有图片样式*/
.pic{
    width: 200px;
    height: 200px;
}
.cube .out_front{
    transform: rotateY(0deg) translateZ(100px);
}
.cube .out_back{
    transform: translateZ(-100px) rotateY(180deg);
}
.cube .out_left{
    transform: rotateY(90deg) translateZ(100px);
}
.cube .out_right{
    transform: rotateY(-90deg) translateZ(100px);
}
.cube .out_top{
    transform: rotateX(90deg) translateZ(100px);
}
.cube .out_bottom{
    transform: rotateX(-90deg) translateZ(100px);
}
/*定义小正方体样式*/
.cube span{
    display: bloack;
    width: 100px;
    height: 100px;
    position: absolute;
    top: 50px;
    left: 50px;
}
.cube .in_pic{
    width: 100px;
    height: 100px;
}
.cube .in_front{
    transform: rotateY(0deg) translateZ(50px);
}
.cube .in_back{
    transform: translateZ(-50px) rotateY(180deg);
}
.cube .in_left{
    transform: rotateY(90deg) translateZ(50px);
}
.cube .in_right{
    transform: rotateY(-90deg) translateZ(50px);
}
.cube .in_top{
    transform: rotateX(90deg) translateZ(50px);
}
.cube .in_bottom{
    transform: rotateX(-90deg) translateZ(50px);
}
/*鼠标移入后样式*/
.cube:hover .out_front{
    transform: rotateY(0deg) translateZ(200px);
}
.cube:hover .out_back{
    transform: translateZ(-200px) rotateY(180deg);
}
.cube:hover .out_left{
    transform: rotateY(90deg) translateZ(200px);
}
.cube:hover .out_right{
    transform: rotateY(-90deg) translateZ(200px);
}
.cube:hover .out_top{
    transform: rotateX(90deg) translateZ(200px);
}
.cube:hover .out_bottom{
    transform: rotateX(-90deg) translateZ(200px);
}

3.下载一些照片放在img文件夹里面。照片名字命名为1.jpg这种。图片大小设置为同样的,比如400*400,可以直接用·电脑上自带的绘图软件,打开编辑后保存即可。
图片大小设置为同样的,比如400*400,可以直接用·电脑上自带的绘图软件,打开编辑后保存即可。
4.OK,准备工作都好了,我们直接点击index.html就可以看到成果了。(博主还不会整动态视频,各位见谅)
在这里插入图片描述
在这里插入图片描述
有什么不懂得的,欢迎各位咨询!!!

  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
CSS实现鼠标经过3D立体动态展示图片特效代码 @charset "utf-8"; *{ margin:0; padding:0; } body{ max-width: 100%; min-width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-size:100% 100%; position: absolute; margin-left: auto; margin-right: auto; } li{ list-style: none; } .box{ width:200px; height:200px; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-size:100% 100%; position: absolute; margin-left: 42%; margin-top: 22%; -webkit-transform-style:preserve-3d; -webkit-transform:rotateX(13deg); -webkit-animation:move 5s linear infinite; } .minbox{ width:100px; height:100px; position: absolute; left:50px; top:30px; -webkit-transform-style:preserve-3d; } .minbox li{ width:100px; height:100px; position: absolute; left:0; top:0; } .minbox li:nth-child(1){ background: url(img/01.png) no-repeat 0 0; -webkit-transform:translateZ(50px); } .minbox li:nth-child(2){ background: url(img/02.png) no-repeat 0 0; -webkit-transform:rotateX(180deg) translateZ(50px); } .minbox li:nth-child(3){ background: url(img/03.png) no-repeat 0 0; -webkit-transform:rotateX(-90deg) translateZ(50px); } .minbox li:nth-child(4){ background: url(img/04.png) no-repeat 0 0; -webkit-transform:rotateX(90deg) translateZ(50px); } .minbox li:nth-child(5){ background: url(img/05.png) no-repeat 0 0; -webkit-transform:rotateY(-90deg) translateZ(50px); } .minbox li:nth-child(6){ background: url(img/06.png) no-repeat 0 0; -webkit-transform:rotateY(90deg) translateZ(50px); } .maxbox li:nth-child(1){ background: url(img/1.png) no-repeat 0 0; -webkit-transform:translateZ(50px); } .maxbox li:nth-child(2){ background: url(img/2.png) no-repeat 0 0; -webkit-transform:translateZ(50px); } .maxbox li:nth-child(3){ background: url(img/3.png) no-repeat 0 0; -webkit-transform:rotateX(-90deg) translateZ(50px); } .maxbox li:nth-child(4){ background: url(img/4.png) no-repeat 0 0; -webkit-transform:rotateX(90deg) translateZ(50px); } .maxbox li:nth-child(5){ background: url(img/5.png) no-repeat 0 0; -webkit-transform:rotateY(-90deg) translateZ(50px); } .maxbox li:nth-child(6){ background: url(img/6.png) no-repeat 0 0; -webkit-transform:rotateY(90deg) translateZ(50px); } .maxbox{ width: 800px; height: 400px; position: absolute; left: 0; top: -20px; -webkit-transform-style: preserve-3d; } .maxbox li{ width: 200px; height: 200px; background: #fff; border:1px solid #ccc; position: absolute; left: 0; top: 0; opacity: 0.2; -webkit-transition:all 1s ease; } .maxbox li:nth-child(1){ -webkit-transform:translateZ(100px); } .maxbox li:nth-child(2){ -webkit-transform:rotateX(180deg) translateZ(100px); } .maxbox li:nth-child(3){ -webkit-transform:rotateX(-90deg) translateZ(100px); } .maxbox li:nth-child(4){ -webkit-transform:rotateX(90deg) translateZ(100px); } .maxbox li:nth-child(5){ -webkit-transform:rotateY(-90deg) translateZ(100px); } .maxbox li:nth-child(6){ -webkit-transform:rotateY(90deg) translateZ(100px); } .box:hover ol li:nth-child(1){ -webkit-transform:translateZ(300px); width: 400px; height: 400px; opacity: 0.8; left: -100px; top: -100px; } .box:hover ol li:nth-child(2){ -webkit-transform:rotateX(180deg) translateZ(300px); width: 400px; height: 400px; opacity: 0.8; left: -100px; top: -100px; } .box:hover ol li:nth-child(3){ -webkit-transform:rotateX(-90deg) translateZ(300px); width: 400px; height: 400px; opacity: 0.8; left: -100px; top: -100px; } .box:hover ol li:nth-child(4){ -webkit-transform:rotateX(90deg) translateZ(300px); width: 400px; height: 400px; opacity: 0.8; left: -100px; top: -100px; } .box:hover ol li:nth-child(5){ -webkit-transform:rotateY(-90deg) translateZ(300px); width: 400px; height: 400px; opacity: 0
3D Flash Gallery提供一种非常简单的方式让你建立自己的3D相册。通过3D Flash Gallery提供的模板你可以做出很多很炫的3D相册。最重要的是用户不需要复杂的操作,对于那些怕麻烦的同学来说自然是福音。步骤1:添加到数码照片和整理所需的顺序。您可以方便的使用Aneesoft 3D Flash Gallery 来调整和编辑相片。步骤2:选择一个Flash动态模板,并可以添加适当的背景音乐,以丰富内容。第3步:保存为SWF,HTML格式或EXE文件,或者使一个窗口发布动感相册。只要将您制作的Flash画廊嵌入到您的首选网站或博客,就可以与您的朋友或家人一起分享它。 简单的来说建立3D相册只需要三个步骤: 1、添加照片 2、选择模板 3、发布。当然每一个步骤中还有些细微的操作,但也不复杂。 添加照片 将照片添加到Portable Aneesoft 3D Flash Gallery中,当然你也可以在软件中对图片进行稍微的处理。 选择模板 有三种类型的模板可供选择,每种类型中又有很多的模板可供选择。可以点击Add music按钮添加音乐,在setting中可以对模板进行简单的设置。 发布 这个步骤就更简单了,我们可以将其直接发布为swf格式,或者还可以存为HTML格式。这样我们可以将其发布到我们的网站。看到最后的SCR没,我们还可以将我们的3D相册存为屏幕保护程序,炫吧? 怎么样是不是很简单?轻轻松松一个3D相册就做出来了 提示: 首次使用前请先执行绿化安装.cmd进行配置,卸载时运行卸载清理.cmd。 注册码:Flash3DGMAZEtDSObhGr
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值