Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/maladr0it/ggj2024
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-r committed Jan 28, 2024
2 parents 84944a1 + 3fe164c commit 3e3b052
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ <h1 jstcache="0">
<li>
Checking the
<span class="objective objective-eth-cable">network cables</span
>, <span class="objective objective-2">modem</span>, and
<span class="objective objective-3">router</span>
>, <span class="objective objective-modem">modem</span>, and
<span class="objective objective-router">router</span>
</li>
<li>
<span class="objective objective-4"
<span class="objective objective-reconnect"
>Reconnecting to Wi-Fi</span
>
</li>
Expand Down
21 changes: 21 additions & 0 deletions src/entities/Objective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@ export const createEthCableObjective = (x: number) =>
.classList.add("objective-complete");
});

export const createModemObjective = (x: number) =>
new Objective(x, [sprites["eth-cable.png"]], () => {
document
.querySelector(".objective-modem")!
.classList.add("objective-complete");
});

export const createRouterObjective = (x: number) =>
new Objective(x, [sprites["eth-cable.png"]], () => {
document
.querySelector(".objective-router")!
.classList.add("objective-complete");
});

export const createReconnectObjective = (x: number) =>
new Objective(x, [sprites["eth-cable.png"]], () => {
document
.querySelector(".objective-reconnect")!
.classList.add("objective-complete");
});

export const resetObjectives = () => {
for (const element of document.querySelectorAll(".objective")) {
element.classList.remove("objective-complete");
Expand Down

0 comments on commit 3e3b052

Please sign in to comment.