3d小相册1

查看

代码

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>3d相册</title>
		<style type="text/css">
			*{
				margin: 0px;
				padding: 0px;
				
			}
			html,body{
				height: 100%;
				width: 100%;
			}
			.my-cantainer{ 	
				height: 200px;
				width: 200px;
				margin: 150px auto;
				/*background-color: red;*/
			}
			.photo{
				height: 100%;
				width: 100%;
				perspective: 1200px;
				perspective-origin: -5px -300px ;
			    
				
			}
			.cantainer{
				height: 200px;
				width: 200px;
				/*display: flex;*/
				transform-style: preserve-3d;
				position: relative;
				animation: zhuan 5s linear infinite;
				cursor: pointer;
			}
			@keyframes zhuan{
				from{
					transform: rotateX(0deg) rotateX(0deg) rotateZ(0deg);
				}
				to{
					transform: rotateX(360deg) rotateX(360deg) rotateZ(360deg);
				}
			}
			.cantainer:hover .img1{
				transform: translateZ(300px);
			}
			.cantainer:hover .img2{
				transform: translateZ(-300px);
			}
			.cantainer:hover .img3{
				transform:rotateY(90deg) translateZ(200px);
			}
			.cantainer:hover .img4{
				transform:rotateY(-90deg) translateZ(200px);
			}
			.cantainer:hover .img5{
				transform:rotateX(90deg) translateZ(200px);
			}
			.cantainer:hover .img6{
				transform:rotateX(-90deg) translateZ(200px);
			}
			
			.img{
				height: 200px;
				width: 200px;
				/*background-color: black;*/
				position: absolute;
				border-radius: 20px;
			}
			.img1{
				transform: translateZ(100px);
				background-color: red;
				transition: 1s linear;
			}
			.img.img2{
				transform: translateZ(-100px);
				background-color: royalblue;
				transition: 1s linear;
			}
			.img3{
				transform: rotateY(90deg) translateZ(100px);
				background-color: aquamarine;
				transition: 1s linear;
			}
			.img4{
				transform: rotateY(-90deg) translateZ(100px);
				background-color: chartreuse;
				transition: 1s linear;
			}
			.img5{
				transform: rotateX(90deg) translateZ(100px);
				background-color: darkgoldenrod;
				transition: 1s linear;
			}
			.img6{
				transform: rotateX(-90deg) translateZ(100px);
				background-color: indianred;
				transition: 1s linear;
			}
			img {
				height: 200px;
				width:200px ;
				display: inline;
			}
		</style>
		
	</head>
	<body>
		<div class="my-cantainer">
			<div class="photo">
				<div class="cantainer">
					<div class="img img1">
						
					</div>
					<div class="img img2">
						
					</div>
					<div class="img img3">
						
					</div>
					<div class="img img0 ">
						<img src="img/WIN_20191009_16_29_02_Pro.jpg"/>
					</div>
					<div class="img img4">
						
					</div>
					<div class="img img5">
						
					</div>
					<div class="img img6">
						
					</div>
				</div>
			</div>
		</div>
		
		
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值