update: 2026-03-28 20:59
This commit is contained in:
@@ -1,334 +1,102 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>别踩白方块</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(135deg, #a8e6cf 0%, #dcedc8 50%, #f1f8e9 100%);
|
||||
font-family: 'Arial', 'Microsoft YaHei', sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.game-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 10px 30px rgba(46,125,50,0.3);
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
border: 1px solid rgba(129,199,132,0.2);
|
||||
}
|
||||
|
||||
.game-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #1b5e20;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.score-display {
|
||||
position: relative;
|
||||
width: 300px;
|
||||
height: 60px;
|
||||
background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
|
||||
border-radius: 8px 8px 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 8px rgba(46,125,50,0.3);
|
||||
}
|
||||
|
||||
.game-container {
|
||||
position: relative;
|
||||
width: 300px;
|
||||
height: 600px;
|
||||
border: 3px solid #2e7d32;
|
||||
border-top: none;
|
||||
border-radius: 0 0 8px 8px;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
box-shadow: 0 4px 12px rgba(46,125,50,0.2);
|
||||
}
|
||||
|
||||
.control-panel {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.game-btn {
|
||||
padding: 12px 30px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.start-btn {
|
||||
background: linear-gradient(45deg, #66bb6a, #4caf50);
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(76,175,80,0.3);
|
||||
}
|
||||
|
||||
.start-btn:hover {
|
||||
background: linear-gradient(45deg, #4caf50, #388e3c);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(76,175,80,0.4);
|
||||
}
|
||||
|
||||
.pause-btn {
|
||||
background: linear-gradient(45deg, #81c784, #66bb6a);
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(129,199,132,0.3);
|
||||
}
|
||||
|
||||
.pause-btn:hover {
|
||||
background: linear-gradient(45deg, #66bb6a, #4caf50);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(129,199,132,0.4);
|
||||
}
|
||||
|
||||
.instructions {
|
||||
text-align: center;
|
||||
color: #2e7d32;
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 游戏结束弹窗 */
|
||||
.game-over-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0,0,0,0.7);
|
||||
display: none;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
|
||||
padding: 30px;
|
||||
border-radius: 15px;
|
||||
text-align: center;
|
||||
box-shadow: 0 20px 40px rgba(46,125,50,0.3);
|
||||
max-width: 300px;
|
||||
width: 90%;
|
||||
border: 1px solid rgba(129,199,132,0.3);
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #c62828;
|
||||
margin-bottom: 15px;
|
||||
text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.final-score, .final-speed {
|
||||
font-size: 18px;
|
||||
margin: 15px 0;
|
||||
color: #1b5e20;
|
||||
}
|
||||
|
||||
.final-speed {
|
||||
color: #2e7d32;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.modal-btn {
|
||||
padding: 10px 25px;
|
||||
margin: 5px;
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.restart-btn {
|
||||
background: linear-gradient(45deg, #66bb6a, #4caf50);
|
||||
color: white;
|
||||
box-shadow: 0 4px 12px rgba(76,175,80,0.3);
|
||||
}
|
||||
|
||||
.restart-btn:hover {
|
||||
background: linear-gradient(45deg, #4caf50, #388e3c);
|
||||
box-shadow: 0 6px 16px rgba(76,175,80,0.4);
|
||||
}
|
||||
/* 排行榜样式 */
|
||||
.leaderboard {
|
||||
margin-top: 15px;
|
||||
background: rgba(255,255,255,0.6);
|
||||
border: 1px solid rgba(129,199,132,0.3);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.leaderboard-title {
|
||||
background: linear-gradient(45deg, #66bb6a, #4caf50);
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
padding: 8px 12px;
|
||||
text-align: left;
|
||||
box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
|
||||
}
|
||||
.leaderboard-meta {
|
||||
color: #2e7d32;
|
||||
font-size: 13px;
|
||||
padding: 8px 12px;
|
||||
border-bottom: 1px solid rgba(129,199,132,0.2);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.leaderboard-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.leaderboard-table th, .leaderboard-table td {
|
||||
padding: 8px 6px;
|
||||
font-size: 13px;
|
||||
border-bottom: 1px solid rgba(129,199,132,0.2);
|
||||
color: #1b5e20;
|
||||
text-align: center;
|
||||
}
|
||||
.leaderboard-table th {
|
||||
background: rgba(129,199,132,0.2);
|
||||
font-weight: bold;
|
||||
color: #1b5e20;
|
||||
}
|
||||
.leaderboard-row-me {
|
||||
background: rgba(198,40,40,0.08);
|
||||
border-left: 3px solid #c62828;
|
||||
}
|
||||
.leaderboard-table tr:nth-child(even) {
|
||||
background: rgba(129,199,132,0.1);
|
||||
}
|
||||
|
||||
/* 移动端适配 */
|
||||
@media (max-width: 768px) {
|
||||
.game-wrapper {
|
||||
padding: 15px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.game-title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.game-container {
|
||||
width: 280px;
|
||||
height: 560px;
|
||||
}
|
||||
|
||||
.score-display {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
.instructions {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.game-container {
|
||||
width: 260px;
|
||||
height: 520px;
|
||||
}
|
||||
|
||||
.score-display {
|
||||
width: 260px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="game-wrapper">
|
||||
<h1 class="game-title">别踩白方块</h1>
|
||||
|
||||
<div class="score-display">
|
||||
<canvas id="score_bar" width="300" height="60"></canvas>
|
||||
<div style="position: absolute; color: white; font-size: 14px; display: flex; justify-content: space-between; width: 260px; padding: 0 20px;">
|
||||
<span>得分: <span id="score-value">0</span></span>
|
||||
<span>速度: <span id="speed-value">1.0</span>x</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="game-container">
|
||||
<canvas id="background" width="300" height="600"></canvas>
|
||||
<canvas id="piano" width="300" height="600" style="position: absolute; top: 0; left: 0;"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="control-panel">
|
||||
<button id="start_btn" class="game-btn start-btn">开始游戏</button>
|
||||
<div class="instructions">
|
||||
<div>电脑端:使用 A S D F 键</div>
|
||||
<div>手机端:直接点击黑色方块</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 游戏结束弹窗 -->
|
||||
<div id="game-over-modal" class="game-over-modal">
|
||||
<div class="modal-content">
|
||||
<h2 class="modal-title">游戏结束</h2>
|
||||
<div class="final-score">最终得分: <span id="final-score-value">0</span></div>
|
||||
<div class="final-speed">最高速度: <span id="final-speed-value">1.0</span>x</div>
|
||||
<!-- 排行榜区域 -->
|
||||
<div class="leaderboard">
|
||||
<div class="leaderboard-title">排行榜</div>
|
||||
<div class="leaderboard-meta">
|
||||
<span>我的排名:第 <span id="my-rank">-</span> 名</span>
|
||||
<span>我的分数:<span id="my-score">0</span></span>
|
||||
<span>时间:<span id="my-time">--</span></span>
|
||||
</div>
|
||||
<table class="leaderboard-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>排名</th>
|
||||
<th>名称</th>
|
||||
<th>分数</th>
|
||||
<th>时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="leaderboard-body"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<button id="restart-btn" class="modal-btn restart-btn">重新开始</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<audio id="music" src="MUSIC.mp3" loop></audio>
|
||||
<script src="gamedata.js"></script>
|
||||
<script src="game.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cmn-Hans">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>别踩白方块</title>
|
||||
<link rel="icon"
|
||||
href="favicon.png">
|
||||
<script>
|
||||
(function (doc, win) {
|
||||
var docEl = doc.documentElement
|
||||
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
|
||||
|
||||
function recalc() {
|
||||
var designWidth = 750
|
||||
var clientWidth = docEl.clientWidth
|
||||
if (!clientWidth || clientWidth > designWidth) {
|
||||
clientWidth = designWidth
|
||||
}
|
||||
docEl.style.fontSize = (100 * clientWidth / designWidth) + 'px'
|
||||
}
|
||||
|
||||
if (!doc.addEventListener) return
|
||||
win.addEventListener(resizeEvt, recalc, false)
|
||||
doc.addEventListener('DOMContentLoaded', recalc, false)
|
||||
recalc()
|
||||
})(document, window)
|
||||
</script>
|
||||
<link rel="stylesheet" href="./styles/basic.css?v=201902102023">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="modal white-bg" id="init-modal">
|
||||
<div class="init-modal-content">
|
||||
<!--<p class="title">别踩白方块</p>-->
|
||||
<div class="modal-btn" id="classics-btn">经典</div>
|
||||
<div class="modal-btn" id="topspeed-btn">极速</div>
|
||||
<div class="modal-btn disable" id="arcade-btn">街机</div>
|
||||
<div class="modal-btn" id="history-btn">历史记录</div>
|
||||
<a target="_blank" href="https://github.com/QiShaoXuan/dont-touch-white" class="modal-btn">原项目仓库</a>
|
||||
<a target="_blank" href="https://github.com/Firfr/dont-touch-white" class="modal-btn" style="background: #ebf4f4;">镜像制作仓库</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal dim-bg" id="score-modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<p class="title">游戏结束</p>
|
||||
<p class="content">得分:<span id="score"></span></p>
|
||||
<p class="content">历史最高分:<span id="history-score"></span></p>
|
||||
<div class="modal-btn" id="topspeed-reset" data-modal="#score-modal">重新开始</div>
|
||||
<div class="modal-btn back-btn" data-modal="#score-modal">返回首页</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal dim-bg" id="coding-modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<p class="title">正在开发 ...</p>
|
||||
<div class="modal-btn modal-close-btn" data-modal="#coding-modal">关闭</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal dim-bg" id="history-modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<p class="title">历史记录</p>
|
||||
<p class="content">极速模式:<span id="history-topspeed-score"></span></p>
|
||||
<p class="content">经典模式:<span id="history-classics-score">--</span></p>
|
||||
<div class="modal-btn back-btn" data-modal="#history-modal">返回首页</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="topspeed-container hide">
|
||||
<div class="score-container topspeed">0</div>
|
||||
<div class="container topspeed" id="topspeed-container"></div>
|
||||
</div>
|
||||
|
||||
<div class="classics-container">
|
||||
<div class="score-container classics">
|
||||
<div><span id="remaining-time">60</span>''</div>
|
||||
<!--<span id="classics-score">0</span>-->
|
||||
</div>
|
||||
<div class="container classics" id="classics-container"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--<div class="toggle-btn"></div>-->
|
||||
</body>
|
||||
<script src="./scripts/topspeed.js?v=201902102023"></script>
|
||||
<script src="./scripts/classics.js?v=201902102023"></script>
|
||||
<script src="./scripts/index.js?v=201902102023"></script>
|
||||
<script>
|
||||
// const btn = document.querySelector('.toggle-btn')
|
||||
//
|
||||
// btn.addEventListener('click', function () {
|
||||
// if (topspeed.status == 0) {
|
||||
// topspeed.start()
|
||||
// } else {
|
||||
// topspeed.pause()
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user