<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>アリスの迷路 - ハイスコアリセット</title>
<style>
body {
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
background-color: #f0f0f0;
}
.container {
text-align: center;
padding: 40px;
border-radius: 10px;
background-color: white;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
h1 {
color: #333;
}
p {
color: #666;
margin-bottom: 25px;
}
button {
padding: 15px 30px;
font-size: 18px;
font-weight: bold;
color: white;
background-color: #e74c3c;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #c0392b;
}
</style>
</head>
<body>
<div class="container">
<h1>アリスの迷路 - ハイスコアリセット</h1>
<p>下のボタンを押すと、ブラウザに保存されているハイスコアの記録が削除されます。</p>
<button onclick="resetHiScore()">ハイスコアをリセットする</button>
</div>
<script>
function resetHiScore() {
// 'mazeHiScore'というキーで保存されたデータをlocalStorageから削除します。
localStorage.removeItem('mazeHiScore');
// 処理が完了したことをユーザーに知らせます。
alert('ハイスコアをリセットしました!');
}
</script>
</body>
</html>
使用変数
charset | |
class | |
lang | |
onclick | |
resetHiScore -------( Function ) |