免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
打字游戲

打字游戲:
開(kāi)始狀態(tài)時(shí),暫停按鈕禁用,開(kāi)始按鈕可用,點(diǎn)擊一次開(kāi)始按鈕后,開(kāi)始按鈕禁用,暫停按鈕可用,
然后開(kāi)始調(diào)用計(jì)時(shí)器不斷生成字母,每清除一次后加一分,每通過(guò)10個(gè),速度會(huì)逐漸遞增,掉落5個(gè)后游戲結(jié)束。點(diǎn)擊重新開(kāi)始刷新頁(yè)面。

<!DOCTYPE html><html>	<head>		<meta charset="UTF-8">		<title></title>		<style>			#container{				position:absolute;				top:0;				left: 0;				width:100%;				height: 100%;				background: url(img/bg.jpg) no-repeat;				background-size: 100% 100%;			}					#counter{				position: absolute;					width: 230px;				height: 250px;				right: 15px;				bottom: 15px;				background: url(img/score.png) no-repeat;				background-size: 100% 100%;			}						button{				position: absolute;				width: 100px;				height: 100px;				border:none;				color: transparent;			}					#start,#restart,#pause,#continue{				position: absolute;				display: block;				width: 200px;				height: 75px;				bottom: 50px;				left:30px;				background: url(img/stop.png) no-repeat;				background-size: 100% 100%;						}			#restart{				display: none;			}						#continue{				display: none;			}				#pause,#continue{				bottom: 50px;*/				left:250px;			}			#count{				display: block;				width: 30px;				height: 30px;				position: absolute;				top:32%;				right:40%;				font-size: 25px;				background: url(img/score.png) no-repeat;			}			.start,.restart,.pause,.continue{				background-color: transparent;				position: relative;				bottom: -20px;				left: 50px;				border: none;				color: #8B0000;				font-size: 20px;			}			#gameover span{				position: absolute;				width: 600px;				height: 150px;				margin: auto;				top: 0;				right: 0;				bottom: 0;				left: 0;				font-size:150px;				color: red;				display: none;			}		</style>	</head>	<body>		<div id="container">			<div id="start">				<input class="start" type="button" value="開(kāi)始游戲"/>			</div>			<div id="restart">				<input class="restart" type="button" value="重新游戲"/>			</div>			<div id="pause">				<input class="pause" type="button" value="暫停游戲"/>			</div>			<div id="continue">				<input class="continue" type="button" value="繼續(xù)游戲"/>			</div>			<div id="counter">				<span id="count">					0				</span>			</div>			<div id="gameover">				<span class="gameover">你輸啦!</span>			</div>		</div>		<script>			var letterArrs = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];			var btnArr = new Array();			var startInterval;			var moveInterval;			var speed = 0.5;			var con = document.getElementById("container");					var c = document.getElementById("count");			var over = document.getElementsByClassName("gameover")[0];			var startdiv = document.getElementById("start");			var restartdiv = document.getElementById("restart");			var pausediv = document.getElementById("pause");			var continuediv = document.getElementById("continue");			var startBtn = document.getElementsByClassName("start")[0];			var restartBtn = document.getElementsByClassName("restart")[0];			var pauseBtn = document.getElementsByClassName("pause")[0];			var continueBtn = document.getElementsByClassName("continue")[0];						startBtn.addEventListener("click",start,false);			restartBtn.addEventListener("click",restart,false);			pauseBtn.addEventListener("click",pause,false);				continueBtn.addEventListener("click",continue_,false);				console.log(startdiv);			var over_count = 0;			var count = 0;			pauseBtn.disabled = true;									function start(){				startBtn.disabled = true;				pauseBtn.disabled = false;				startInterval = window.setInterval(create,1000);				moveInterval = setInterval(move,10);			}						function restart(){				window.location.reload();			}						function pause(){				window.clearInterval(startInterval);				clearInterval(moveInterval);				pausediv.style.display = 'none';				continuediv.style.display = 'block';			}						function continue_(){				pausediv.style.display = 'block';				continuediv.style.display = 'none';				start();			}						function create(){						var btn = document.createElement("button");				var index = parseInt(Math.random()*26);				btn.innerHTML = letterArrs[index];				btn.style.background = 'url(img/' letterArrs[index] '.png)';								var distance = (Math.random()*1201 100) 'px';				btn.style.left = distance;				btn.style.top = 0;				con.appendChild(btn);				btnArr.push(btn);					}							function move(){				for(var i=0;i<btnArr.length;i  ){						var btn = btnArr[i];					btn.style.top = btn.offsetTop speed 'px';					if(btn.offsetTop>=600){						btnArr.shift();						con.removeChild(btn);						over_count  ;						if(over_count>=5){							stopGame();						}					}					if(count>=10){						speed = parseInt(count/10);					}				}			}									window.onkeyup = function(e){				console.log(e.keyCode);				for(var i=0;i<btnArr.length;i  ){										var btn = btnArr[i];					if(e.keyCode==btn.innerHTML.charCodeAt()){						count  ;						con.removeChild(btn);						btnArr.splice(i,1);						c.innerText = count;						break;					}				}			}						function stopGame(){				clearInterval(startInterval);				clearInterval(moveInterval);				startdiv.style.display = 'none';				restartdiv.style.display = 'block';				over.style.display = 'block';						pauseBtn.disabled = true;			}		</script>	</body></html>
來(lái)源:https://www.icode9.com/content-4-412201.html
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
javascript日歷控件——純javascript版
微信掃描打開(kāi)APP下載鏈接提示代碼優(yōu)化
前端 自定義確認(rèn)提示框
JS模擬彈力球--window.onload、clearInterval()防止計(jì)時(shí)器疊加
隱藏與顯示FLASH
CSS類(lèi)的操作
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服