-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
100 lines (87 loc) · 3.89 KB
/
index.html
File metadata and controls
100 lines (87 loc) · 3.89 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rock Paper Scissors</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar">
<div class="nav-brand">RPS Game</div>
<div class="nav-links">
<a href="#" onclick="showMenu()">Home</a>
<a href="#" onclick="showAbout()">About</a>
<a href="#" onclick="showRules()">Rules</a>
<a href="#" onclick="startGame()">Play</a>
</div>
</nav>
<div class="menu" id="mainMenu">
<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZnJyZXA1dzlqZDlnaGp6eWc1d2dnMnA3YmpvZXZzZ3B3a2NsMmczNCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/ZNo3OCM9CoEVz71ilQ/giphy.gif" alt="Rock Paper Scissors"
class="menu-image">
<h1>Rock-Paper Scissors</h1>
<p>Challenge your friends or the computer in this classic game!</p>
<button class="start-btn" onclick="showModeSelection()">Start Game</button>
<div class="rules">
<h3>Rules:</h3>
<p>✊ Rock beats Scissors</p>
<p>✋ Paper beats Rock</p>
<p>✌️ Scissors beats Paper</p>
</div>
</div>
<div class="menu" id="modeSelection" style="display: none;">
<h1>Choose Game Mode</h1>
<p>Select how you want to play!</p>
<div class="game-modes">
<button class="mode-btn" onclick="startGame('computer')">
<span class="mode-icon">🤖</span>
<h3>VS Computer</h3>
<p>Play against AI</p>
</button>
<button class="mode-btn" onclick="startGame('player')">
<span class="mode-icon">👥</span>
<h3>VS Player</h3>
<p>Play with a friend</p>
</button>
</div>
<button class="start-btn" onclick="showMenu()" style="margin-top: 20px; background: #95a5a6;">Back</button>
</div>
<div class="container" id="gameContainer" style="display: none;">
<h1>Rock Paper Scissors</h1>
<div class="score">
<div><span id="player1Label">Player 1</span>: <span id="playerScore">0</span></div>
<div><span id="player2Label">Computer</span>: <span id="computerScore">0</span></div>
</div>
<div class="choices">
<button class="btn" onclick="playGame('rock')">✊ Rock</button>
<button class="btn" onclick="playGame('paper')">✋ Paper</button>
<button class="btn" onclick="playGame('scissors')">✌️ Scissors</button>
</div>
<div class="result">
<div id="playerChoice">You chose: -</div>
<div id="computerChoice">Computer chose: -</div>
<div id="winner">Choose your move!</div>
</div>
<button class="reset-btn" onclick="resetGame()">Reset Game</button>
<button class="menu-btn" onclick="backToMenu()">Back to Menu</button>
</div>
<div class="menu" id="aboutSection" style="display: none;">
<h1>About</h1>
<p>This is a classic Rock Paper Scissors game built with HTML, CSS, and JavaScript.</p>
<p>Created as a simple project to demonstrate basic web development skills.</p>
<button class="start-btn" onclick="showMenu()">Back</button>
</div>
<div class="menu" id="rulesSection" style="display: none;">
<h1>How to Play</h1>
<div class="rules">
<h3>Game Rules:</h3>
<p>✊ Rock beats Scissors (Rock crushes Scissors)</p>
<p>✋ Paper beats Rock (Paper covers Rock)</p>
<p>✌️ Scissors beats Paper (Scissors cuts Paper)</p>
<p>First to score the most points wins!</p>
</div>
<button class="start-btn" onclick="showMenu()" style="margin-top: 20px;">Back</button>
</div>
<script src="script.js"></script>
</body>
</html>