【css】七夕程序员的浪漫,3d旋转相册


<template>
	<div class="max">
		<div class="box">
			<p></p>
			<p></p>
			<p></p>
			<p></p>
			<p></p>
			<p></p>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy1.webp" mode=""></image>
			</div>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy2.webp" mode=""></image>
			</div>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy3.webp" mode=""></image>
			</div>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy4.webp" mode=""></image>
			</div>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy5.webp" mode=""></image>
			</div>
			<div class="box-item">
				<image src="../../../static/images/managementCenter/card/jjy6.webp" mode=""></image>
			</div>
		</div>
	</div>
</template>
<style>
	uni-page-body {
		height: 100%;
	}

	image {
		width: 100%;
		height: 100%;
	}
	* {
		margin: 0px;
		padding: 0px;
	}

	.max {
		margin: 250px auto;
	}

	.max,
	.box {
		position: relative;
		width: 200px;
		height: 200px;
		perspective: 5000px;
	}

	.box {
		transform-style: preserve-3d;
		transition: all 4.5s ease;
		animation: xz 6s linear infinite normal;
	}
	@keyframes xz{
		0%{
			transform: rotateX(0deg) rotateY(0deg);
		}100%{
			transform: rotateX(360deg) rotateY(720deg);
		}
	}
	.box p {
		position: absolute;
		left: 0px;
		top: 0px;
		width: 200px;
		height: 200px;
		font: bold 50px/200px "微软雅黑";
		text-align: center;
	}

	.box p:nth-child(1) {
		background-color: rgba(87,250,255, 0.3);
		transform: rotateX(360deg) translateZ(-100px);
	}

	.box p:nth-child(6) {
		background-color: rgba(87,250,255,0.3);
		transform: translateZ(100px);
	}

	.box p:nth-child(2) {
		background-color: rgba(233, 1, 111, 0.3);
		transform: rotateY(90deg) translateZ(100px);
	}

	.box p:nth-child(5) {
		background-color: rgba(241, 187, 10, 0.3);
		transform: rotateY(-90deg) translateZ(100px);
	}

	.box p:nth-child(3) {
		background-color: rgba(133, 223, 16, 0.3);
		transform: rotateX(-270deg) translateZ(100px);
	}

	.box p:nth-child(4) {
		background-color: rgba(26, 151, 135, 0.3);
		transform: rotateX(-90deg) translateZ(100px);
	}
	.box-item{
		position: absolute;
		left: 25%;
		top: 25%;
		width: 100px;
		height: 100px;
		display: flex;
		align-items: center;
	}
	.box-item:nth-of-type(1) {
		transform: rotateX(360deg) translateZ(-50px);
	}
	
	.box-item:nth-of-type(6) {
		transform: translateZ(50px);
	}
	
	.box-item:nth-of-type(2) {
		transform: rotateY(90deg) translateZ(50px);
	}
	
	.box-item:nth-of-type(5) {
		transform: rotateY(-90deg) translateZ(50px);
	}
	
	.box-item:nth-of-type(3) {
		transform: rotateX(-270deg) translateZ(50px);
	}
	
	.box-item:nth-of-type(4) {
		transform: rotateX(-90deg) translateZ(50px);
	}
	
	.box:hover p:nth-child(1) {
		background-color: rgba(87,250,255, 0.3);
		transform: rotateX(360deg) translateZ(-150px);
	}
	
	.box:hover p:nth-child(6) {
		background-color: rgba(87,250,255,0.3);
		transform: translateZ(150px);
	}
	
	.box:hover p:nth-child(2) {
		background-color: rgba(233, 1, 111,0.3);
		transform: rotateY(90deg) translateZ(150px);
	}
	
	.box:hover p:nth-child(5) {
		background-color: rgba(241, 187, 10,0.3);
		transform: rotateY(-90deg) translateZ(150px);
	}
	
	.box:hover p:nth-child(3) {
		background-color: rgba(133, 223, 16, 0.3);
		transform: rotateX(-270deg) translateZ(150px);
	}
	
	.box:hover p:nth-child(4) {
		background-color: rgba(26, 151, 135,0.3);
		transform: rotateX(-90deg) translateZ(150px);
	}
</style>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值