Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions examples/Rock-Paper-Scissors/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ <h3 id="computerChoiceText">Waiting...</h3>
</div>

<div class="controls">
<button type="button" class="choice-btn rock" id="rockBtn" data-choice="rock" aria-keyshortcuts="R">
<button type="button" class="choice-btn rock" id="rockBtn" data-choice="rock" aria-keyshortcuts="R" aria-label="Select Rock (R)">
<span class="emoji">🪨</span>
<span class="label">Rock</span>
</button>
<button type="button" class="choice-btn paper" id="paperBtn" data-choice="paper" aria-keyshortcuts="P">
<button type="button" class="choice-btn paper" id="paperBtn" data-choice="paper" aria-keyshortcuts="P" aria-label="Select Paper (P)">
<span class="emoji">📄</span>
<span class="label">Paper</span>
</button>
<button type="button" class="choice-btn scissors" id="scissorsBtn" data-choice="scissors" aria-keyshortcuts="S">
<button type="button" class="choice-btn scissors" id="scissorsBtn" data-choice="scissors" aria-keyshortcuts="S" aria-label="Select Scissors (S)">
<span class="emoji">✂️</span>
<span class="label">Scissors</span>
</button>
</div>

<button type="button" class="reset-btn" id="resetBtn" aria-keyshortcuts="X">
<button type="button" class="reset-btn" id="resetBtn" aria-keyshortcuts="X" aria-label="Reset Game (X)">
<span class="reset-icon">🔄</span>
Reset Game
</button>
Expand All @@ -71,7 +71,9 @@ <h3 id="computerChoiceText">Waiting...</h3>
<div class="round-history" id="roundHistory">
<h3>Round History</h3>
<div class="history-list" id="historyList">
<p class="no-history">No rounds played yet. Make your first move!</p>
<ul id="historyUl">
<li class="no-history">No rounds played yet. Make your first move!</li>
</ul>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions examples/Rock-Paper-Scissors/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RockPaperScissorsGame {
this.paperBtn = document.getElementById('paperBtn');
this.scissorsBtn = document.getElementById('scissorsBtn');
this.resetBtn = document.getElementById('resetBtn');
this.historyListEl = document.getElementById('historyList');
this.historyListEl = document.getElementById('historyUl');
}

bindEvents() {
Expand Down Expand Up @@ -143,14 +143,14 @@ if (playerBtn) {

displayHistory() {
if (this.gameHistory.length === 0) {
this.historyListEl.innerHTML = '<p class="no-history">No rounds played yet. Make your first move!</p>';
this.historyListEl.innerHTML = '<li class="no-history">No rounds played yet. Make your first move!</li>';
return;
}

this.historyListEl.innerHTML = '';

this.gameHistory.slice(0, 10).forEach(item => {
const historyItemEl = document.createElement('div');
const historyItemEl = document.createElement('li');
historyItemEl.className = `history-item ${item.result}`;

historyItemEl.innerHTML = `
Expand Down
Loading