php立方体相册源码,css+html实现立方体相册

本文介绍了一个使用CSS实现的3D翻转相册效果,通过transform-style: preserve-3d和关键帧动画@keyframes实现3D旋转。相册包含六个面,分别显示不同的图片,当鼠标悬停在元素上时,动画暂停。涉及到的技术包括CSS3的transform、动画、背景图片设置等。
摘要由CSDN通过智能技术生成
cube

* {

margin: 0;

padding: 0;

}

body {

background: #333;

}

ul {

width: 300px;

height: 300px;

position: absolute;

top: 0;

bottom: 0;

left: 0;

right: 0;

margin: auto;

/*3d空间*/

transform-style: preserve-3d;

animation: box 20s linear infinite;

}

@keyframes box {

/*3d旋转 x y z deg*/

from {

transform: rotate3d(0, 0, 0, 0deg);

}

to {

transform: rotate3d(1, 1, 1, 360deg);

}

}

li {

width: 300px;

height: 300px;

list-style: none;

border: 1px solid black;

position: absolute;

opacity: 0.8;

box-shadow: 0px 0px 10px white;

}

li:nth-child(1) {

background: url(./../../正面.jpg);

background-position: center;

background-size: cover;

transform: translateZ(150px);

}

/*后*/

li:nth-child(2) {

background: url(./../../反面.jpg);

background-position: center;

background-size: cover;

transform: translateZ(-150px);

}

/*左*/

li:nth-child(3) {

background: url(./../../xuanjiezhimou.jpg);

background-position: center;

background-size: cover;

transform: rotateY(90deg) translateZ(-150px);

}

/*右*/

li:nth-child(4) {

background: url(./../../码上说故事_690.jpeg);

background-position: center;

background-size: cover;

transform: rotateY(90deg) translateZ(150px);

}

/*上*/

li:nth-child(5) {

background: url(./../../1.jpg);

background-position: center;

background-size: cover;

transform: rotateX(90deg) translateZ(150px);

}

li:nth-child(6) {

background: url(./../../3.PNG);

background-position: center;

background-size: cover;

transform: rotateX(90deg) translateZ(-150px);

}

ul:hover {

animation-play-state: paused;

}

————————————————

版权声明:本文为CSDN博主「一殿」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_41866776/article/details/96695938

————————————————

版权声明:本文为CSDN博主「一殿」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_41866776/article/details/96695938

标签:相册,..,translateZ,transform,li,html,background,position,css

来源: https://www.cnblogs.com/ciscolee/p/12386819.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值