Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Make css-grid example more semantic #421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
36 changes: 27 additions & 9 deletions css-grid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,33 @@ <h1 class="puzzle-title">CSS Grid Paradise Puzzle</h1>
<a href="#playing-the-game" class="button button--primary">How to play</a>
</header>
<div class="puzzle-game">
<img tabindex=0 id="piece-1" src="./images/grid_1.png" class="puzzle-game-image" aria-label="The">
<img tabindex=0 id="piece-2" src="./images/grid_2.png" class="puzzle-game-image" aria-label="only">
<img tabindex=0 id="piece-3" src="./images/grid_3.png" class="puzzle-game-image" aria-label="disability">
<img tabindex=0 id="piece-4" src="./images/grid_4.png" class="puzzle-game-image" aria-label="in">
<img tabindex=0 id="piece-5" src="./images/grid_5.png" class="puzzle-game-image" aria-label="life">
<img tabindex=0 id="piece-6" src="./images/grid_6.png" class="puzzle-game-image" aria-label="is">
<img tabindex=0 id="piece-7" src="./images/grid_7.png" class="puzzle-game-image" aria-label="a">
<img tabindex=0 id="piece-8" src="./images/grid_8.png" class="puzzle-game-image" aria-label="bad">
<img tabindex=0 id="piece-9" src="./images/grid_9.png" class="puzzle-game-image" aria-label="attitude">
<button id="piece-1" class="puzzle-game-image" type="button">
<img src="./images/grid_1.png" aria-label="The">
</button>
<button id="piece-2" class="puzzle-game-image" type="button">
<img src="./images/grid_2.png" aria-label="only">
</button>
<button id="piece-3" class="puzzle-game-image" type="button">
<img src="./images/grid_3.png" aria-label="disability">
</button>
<button id="piece-4" class="puzzle-game-image" type="button">
<img src="./images/grid_4.png" aria-label="in">
</button>
<button id="piece-5" class="puzzle-game-image" type="button">
<img src="./images/grid_5.png" aria-label="life">
</button>
<button id="piece-6" class="puzzle-game-image" type="button">
<img src="./images/grid_6.png" aria-label="is">
</button>
<button id="piece-7" class="puzzle-game-image" type="button">
<img src="./images/grid_7.png" aria-label="a">
</button>
<button id="piece-8" class="puzzle-game-image" type="button">
<img src="./images/grid_8.png" aria-label="bad">
</button>
<button id="piece-9" class="puzzle-game-image" type="button">
<img src="./images/grid_9.png" aria-label="attitude">
</button>
</div>
<aside class="puzzle-score">
Clicks: <span id="clicks">0</span>
Expand Down
2 changes: 1 addition & 1 deletion css-grid/scripts/grid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function () {
'use strict';

const pieces = [...document.querySelectorAll('.puzzle-game > img')];
const pieces = [...document.querySelectorAll('.puzzle-game > button')];
const clickScore = document.getElementById('clicks');
const soundButton = document.getElementById('toggle-audio');
const congratulations = document.getElementsByClassName('congratulations')[0];
Expand Down
1 change: 1 addition & 0 deletions css-grid/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ body {
margin: 0;
outline: 1px solid #000;
outline-offset: -1px;
padding: 0;
}

.hidden-piece {
Expand Down