抖音3d相册html代码,抖音上很火的3D立体动态相册.html

纯CSS实现鼠标经过3D立体动态展示图片特效代码

*{

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(01.png) no-repeat 0 0;

-webkit-transform:translateZ(50px);

}

.minbox li:nth-child(2){

background: url(02.png) no-repeat 0 0;

-webkit-transform:rotateX(180deg) translateZ(50px);

}

.minbox li:nth-child(3){

background: url(03.png) no-repeat 0 0;

-webkit-transform:rotateX(-90deg) translateZ(50px);

}

.minbox li:nth-child(4){

background: url(04.png) no-repeat 0 0;

-webkit-transform:rotateX(90deg) translateZ(50px);

}

.minbox li:nth-child(5){

background: url(05.png) no-repeat 0 0;

-webkit-transform:rotateY(-90deg) translateZ(50px);

}

.minbox li:nth-child(6){

background: url(06.png) no-repeat 0 0;

-webkit-transform:rotateY(90deg) translateZ(50px);

}

.maxbox li:nth-child(1){

background: url(1.png) no-repeat 0 0;

-webkit-transform:translateZ(50px);

}

.maxbox li:nth-child(2){

background: url(2.png) no-repeat 0 0;

-webkit-transform:translateZ(50px);

}

.maxbox li:nth-child(3){

background: url(3.png) no-repeat 0 0;

-webkit-transform:rotateX(-90deg) translateZ(50px);

}

.maxbox li:nth-child(4){

background: url(4.png) no-repeat 0 0;

-webkit-transform:rotateX(90deg) translateZ(50px);

}

.maxbox li:nth-child(5){

background: url(5.png) no-repeat 0 0;

-webkit-transform:rotateY(-90deg) translateZ(50px);

}

.maxbox li:nth-child(6){

background: url(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.8;

left: -100px;

top: -100px;

}

.box:hover ol li:nth-child(6){

-webkit-transform:rotateY(90deg) translateZ(300px);

width: 400px;

height: 400px;

opacity: 0.8;

left: -100px;

top: -100px;

}

@keyframes move{

0%{

-webkit-transform: rotateX(13deg) rotateY(0deg);

}

100%{

-webkit-transform:rotateX(13deg) rotateY(360deg);

}

}

/*背景音乐*/

.m-main{width:1200px; height: 60px;margin: 0 auto}

.m-main video{display: none; }

.m-main .player {

width: 100%;

height: 60px;

position: relative;

bottom: 0;

}

.m-main .player>a{display: inline-block; width: 20px; margin: 0 auto; padding: 10px; color: #FFF; text-align: center;float: left;font-size: 12px}

.m-main .player>a img{

width: 20px;

height: 20px;

position: absolute;

top: 20px;

left: 41px;

}

#img1{

display: block;

}

#img2{

display: none;

}

.m-main .play-box {

width: 1070px;

height: 60px;

margin: 0 auto;

position: absolute;

top: 0;

right: 0;

}

.m-main .play-box .left {

width: 100%;

float: left;

}

.m-main .play-box .left p.timeline { width: 83%;height: 10px; background-color: rgba(216, 216, 216, 0.5); border-radius: 5px; margin:30px auto 0; position: relative; z-index: 2; }

.m-main .play-box .left p.timeline span {position: relative; width: 0; height: 10px; background-color: #D3EEDF; border-radius: 5px; display: block; -webkit-transition: width ease-out 0.3s;-o-transition: width ease-out 0.3s;transition: width ease-out 0.3s;}

.m-main .play-box .left p.timeline span:after{content: ""; position: absolute; top: -4px; right:-0.6rem;width: 1.2rem; height:1.2rem; border-radius: 50%;background-color: green;}

.m-main .play-box .left div.info { height: 26px; line-height: 26px; font-size: 14px; color: #9A9A9A; position: relative; top: -18px; margin:0 10px; z-index: 1;}

.m-main .play-box .left div.info .size { float: left; display: block;}

.m-main .play-box .left div.info .timeshow { float: right; display: block;margin-right: 30px}

00:00

00:00

抖音3D旋转相册效果通常是一种基于JavaScript和CSS3动画的技术实现,它并不是直接提供HTML代码片段。这种交互式的体验涉及到WebGL、CSS3 Transform以及可能的JavaScript库如Three.js或者AOS等。 一个简单的HTML结构可能会包含轮播图的容器和图片元素,而JavaScript部分则负责处理旋转动画。下面是一个基本框架的示例: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>3D旋转相册</title> <style> .carousel { perspective: 1000px; } .item { width: 150px; height: 150px; position: absolute; transition: transform 0.5s ease-in-out; } .active { transform-style: preserve-3d; } </style> </head> <body> <div class="carousel"> <div class="item active" style="background-image: url('image1.jpg');"></div> <div class="item" style="background-image: url('image2.jpg');"></div> <!-- 添加更多的图片 --> </div> <script src="path/to/three.min.js"></script> <script> // JavaScript 代码来初始化并控制旋转 var items = document.querySelectorAll('.item'); let rotationIndex = 0; function rotateCarousel() { items.forEach((item, index) => { item.style.transform = `rotateY(${index * 60}deg)`; }); } // 可能需要添加事件监听器来自动切换 setInterval(rotateCarousel, 4000); </script> </body> </html> ``` 请注意这只是一个非常基础的示例,并未涉及真正的3D效果,实际项目可能还需要更复杂的动画处理。此外,你需要将`<script>`标签中的Three.js路径替换为你项目的实际位置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值