This repository was archived by the owner on Jul 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (38 loc) · 1.72 KB
/
Copy pathindex.html
File metadata and controls
41 lines (38 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>剪刀石頭布</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 min-h-screen flex items-center justify-center">
<div class="bg-white rounded-lg shadow-lg p-6 w-full max-w-md mx-4">
<h1 class="text-2xl font-bold text-center mb-6">剪刀石頭布</h1>
<div class="text-center mb-6">
<div class="flex justify-between text-lg font-semibold mb-4">
<span>你: <span id="playerScore">0</span></span>
<span>電腦: <span id="computerScore">0</span></span>
</div>
<div id="result" class="text-xl font-bold mb-4 h-6"></div>
<div class="flex justify-between text-4xl mb-4">
<span id="playerChoice">❓</span>
<span>VS</span>
<span id="computerChoice">❓</span>
</div>
</div>
<div class="grid grid-cols-3 gap-4">
<button onclick="play('rock')" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-4 px-4 rounded-lg text-2xl transition-colors">
🪨
</button>
<button onclick="play('paper')" class="bg-green-500 hover:bg-green-600 text-white font-bold py-4 px-4 rounded-lg text-2xl transition-colors">
📄
</button>
<button onclick="play('scissors')" class="bg-red-500 hover:bg-red-600 text-white font-bold py-4 px-4 rounded-lg text-2xl transition-colors">
✂️
</button>
</div>
</div>
<script src="script.js"></script>
</body>
</html>