继续落子修复;新增战绩;优化UI

This commit is contained in:
icezhb 2024-12-29 18:03:09 +08:00
parent c2a44ba7c7
commit c389bb7d95
2 changed files with 9 additions and 14 deletions

View File

@ -230,8 +230,6 @@ export default {
current: 0,
max: 0,
maxLose: 0,
player: 0,
computer: 0,
},
},
winningPositions: null, //
@ -1238,14 +1236,15 @@ export default {
} else {
stats.playerWins++
stats.winningStreaks.current = Math.max(0, stats.winningStreaks.current) + 1
stats.winningStreaks.max = Math.max(
stats.winningStreaks.max,
stats.winningStreaks.current,
)
}
} else if (winner === (this.isPlayerBlack ? 1 : 2)) {
stats.playerWins++
stats.winningStreaks.current = Math.max(0, stats.winningStreaks.current) + 1
stats.winningStreaks.player = Math.max(
stats.winningStreaks.player,
stats.winningStreaks.current,
)
stats.winningStreaks.max = Math.max(stats.winningStreaks.max, stats.winningStreaks.current)
} else {
stats.computerWins++
stats.winningStreaks.current = Math.min(0, stats.winningStreaks.current) - 1
@ -1255,11 +1254,6 @@ export default {
)
}
stats.winningStreaks.max = Math.max(
stats.winningStreaks.player,
stats.winningStreaks.computer,
)
//
this.saveStatistics()
},
@ -1306,6 +1300,7 @@ export default {
<style>
/* 基础样式 */
.container {
width: 100vw;
display: flex;
justify-content: center;
align-items: center;

View File

@ -1,9 +1,9 @@
@import './base.css';
#app {
max-width: 1280px;
/* max-width: 1280px; */
margin: 0 auto;
padding: 2rem;
/* padding: 2rem; */
font-weight: normal;
}
@ -30,6 +30,6 @@ a,
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
/* padding: 0 2rem; */
}
}