折扇小demo

今天回翻了一下好久没用的transform,用其属性值rotate做一个小玩意 有兴趣的可以进来看看

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.box{
			width: 600px;
			height: 270px;
			border-bottom:2px solid black;
			position:relative;
			margin:60px auto;
		}
		.box div{
			
			width: 60px;
			height:230px;
			transition:2s;
			position:absolute;
			transform-origin:center bottom;
			top:0;
			left:250px;
			box-shadow:2px 2px 3px #ccc;
		}
		.box div:nth-child(1){
			background-color:lightblue;
		}
		.box:hover div:nth-child(2){
			background-color:lightyellow;
			transform:rotate(15deg);
		}
		.box:hover div:nth-child(3){
			background-color:rgb(95, 140, 148);
			transform:rotate(30deg);
		}
		.box:hover div:nth-child(4){
			background-color:lightpink;
			transform:rotate(45deg);
		}
		.box:hover div:nth-child(5){
			background-color:lightyellow ;
			transform:rotate(60deg);
		}
		.box:hover div:nth-child(6){
			background-color:rgb(233, 203, 147);
			transform:rotate(75deg);
		}
		.box:hover div:nth-child(7){
			background-color:lightgreen;
			transform:rotate(90deg);
		}
		.box:hover div:nth-child(8){
			background-color:rgb(241, 241, 55);
			transform:rotate(-15deg);
		}
		.box:hover div:nth-child(9){
			background-color:blue;
			transform:rotate(-30deg);
		}
		.box:hover div:nth-child(10){
			background-color:lightpink;
			transform:rotate(-45deg);
		}
		.box:hover div:nth-child(11){
			background-color:yellow ;
			transform:rotate(-60deg);
		}
		.box:hover div:nth-child(12){
			background-color:orange;
			transform:rotate(-75deg);
		}
		.box:hover div:nth-child(13){
			background-color:lightgreen;
			transform:rotate(-90deg);
		}



	</style>

</head>
<body>
	<div class="box">
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
		<div>7</div>
		<div>6</div>
		<div>5</div>
		<div>4</div>
		<div>3</div>
		<div>2</div>
		<div>1</div>
	</div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值