传递游戏,每个人只能添加一个创意,然后传递给下一位

代码要有创意,感官很重要


直接上代码:

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		* {
			margin: 0;
			padding: 0;
		}

		.box {
			width: 200px;
			height: 200px;
			border: 1px solid #ffffff;
			position: relative;
			margin: 0 auto;
		}

		.show {
			width: 160px;
			height: 160px;
			border: 1px solid #6666;
			box-shadow: 10px 10px 10px #cccccc;
			margin-top: 10px;
			/* 先隐藏div框,监听input框,input框里有值以后,在显示div框 */
			display: none;
			position: absolute;
			background-color: skyblue;
			line-height: 160px;
			border-radius: 80px;
		}



		input {
			margin-top: 200px;
		}
	</style>
</head>

<body>
	<div class="box">
		<div class="show"></div>
		<input type="text" placeholder="请输入您的快递单号">
	</div>

	<script>

		var show = document.querySelector('.show');
		var input = document.querySelector('input');
		input.addEventListener('keyup', function () {
			if (input.value == '') {
				show.style.display = 'none';
			}
			else {
				show.style.display = 'block';
				show.innerHTML = this.value;
			}
		})
		input.addEventListener('blur', function () {
			show.style.display = 'none';
		})
		input.addEventListener('focus', function () {
			if (input.value !== '') {
				show.style.display = 'block';
			}

		})
	</script>
</body>

</html>

效果图:
给代码继续改善,添加动画,传递一次,只能加一个创意内容,要@上一个修改者,看看传递下去,最后会变成什么,这个游戏希望能传递下去

- 给代码继续改善,添加动画,传递一次,只能加一个创意内容,要@上一个修改者,看看传递下去,最后会变成什么,这个游戏希望能传递下去

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值