Skip to content

Домашнє завдання 1 (HTML + CSS) - #16

Open
Vlada-sht wants to merge 3 commits into
seagullua:masterfrom
Vlada-sht:master
Open

Домашнє завдання 1 (HTML + CSS)#16
Vlada-sht wants to merge 3 commits into
seagullua:masterfrom
Vlada-sht:master

Conversation

@Vlada-sht

@Vlada-sht Vlada-sht commented May 16, 2026

Copy link
Copy Markdown

Note

Low Risk
Static front-end homework with no backend or auth; main caveat is reliance on an external WebDataRocks CDN and orphaned list assets not referenced by index.html.

Overview
Replaces the minimal Hello World index.html with a self-contained Ukrainian «П'ятнашки» (15-puzzle) game: board state, solvable shuffle, win check, shuffle button, and tile moves via WebDataRocks grid (cellclick + updateData), with styles inlined in the page and scripts loaded from the WebDataRocks CDN.

main.css is rewritten from a few demo rules into a full layout/theme for a two-column shopping UI (CSS variables, responsive .container, list items, button tooltips, .student-badge, print styles). New script.js implements a buy-list app (add/edit/delete, quantities, bought toggle, stats columns, localStorage persistence). New style.css provides a second, parallel stylesheet for the same shopping-list pattern (badge, print rules).

Note: the current index.html does not link main.css, script.js, or style.css—only the puzzle page is wired as the entry document; the list CSS/JS look like separate homework pieces unless another HTML file is added later.

Reviewed by Cursor Bugbot for commit fd8cc4d. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread index.html Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fd8cc4d. Configure here.

Comment thread index.html
setTimeout(() => {
document.getElementById("status").innerText = "Вітаю! Ви зібрали п'ятнашки!";
}, 100);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Win message stays after moves

Medium Severity

After a win, #status is set to the congratulations text, but later valid moves that leave the board unsolved never clear it. Players can see a victory message while the puzzle is still in progress.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd8cc4d. Configure here.

Comment thread index.html
if (checkWin()) {
setTimeout(() => {
document.getElementById("status").innerText = "Вітаю! Ви зібрали п'ятнашки!";
}, 100);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delayed win after shuffle

Medium Severity

The win message uses a 100ms setTimeout that is never cancelled. If the player hits «Перемішати» right after winning, restartGame clears #status but the pending timer can still show a victory message on the new shuffled board.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd8cc4d. Configure here.

Comment thread script.js
if (event.key === 'Enter') addItem();
});

loadState();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script crashes without markup

Medium Severity

New shopping-list logic calls addButton.addEventListener and render() using nodes from fixed selectors and ids without checking they exist. Any page that loads script.js without the full markup throws before the list can run.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd8cc4d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant