Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update game landscape #26

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Update game landscape #26

merged 5 commits into from
Jul 9, 2024

Conversation

rajbos
Copy link
Collaborator

@rajbos rajbos commented Jul 9, 2024

This pull request primarily focuses on enhancing the responsiveness of the game interface for smaller screen sizes (<= 820px). The changes include modifying the CSS and JavaScript files to adjust the game layout, canvas size, and tooltip styles based on the screen width.

Here are the key changes:

CSS adjustments for smaller screens:

  • game-landscape.html and styles.css: Added media queries for screens with a maximum width of 820px. The game container's flex direction is set to column and the game canvas width is set to 100% with auto height. The canvas position is also adjusted to accommodate the header height. [1] [2] [3]

JavaScript changes for dynamic canvas size and game layout:

  • game-landscape.js: Introduced a new function adjustCanvasSize to dynamically adjust the canvas size based on the screen width. This function is called on window resize and at the start of the script.
  • game-landscape.js: The number of game levels per row is now dynamically set based on the screen width.
  • game-landscape.js: Added a window resize event listener to adjust the canvas size and redraw the game landscape when the window size changes.

Tooltip style enhancements:

  • game-landscape.js: Enhanced the tooltip styles by adding color, font weight, and font size.

rajbos added 5 commits July 5, 2024 09:53
* Show 'coming soon' in detail page if the video url does not exists

* Support showing "coming soon" in the sku page
Closes #51

Update `game-landscape.html`, `styles.css`, and `game-landscape.js` to support mobile phones

* **game-landscape.html**
  - Add media queries to support vertical phone screens.
  - Adjust the canvas size for screens 820 pixels wide or less.

* **styles.css**
  - Add media queries to support vertical phone screens.
  - Adjust the layout for screens 820 pixels wide or less.
  - Ensure the game container and canvas adapt to vertical screens.

* **game-landscape.js**
  - Add logic to handle screen widths of 820 pixels or less.
  - Adjust the canvas setup for vertical screens.
  - Convert the game layout to a vertical setup with two columns instead of four.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/rajbos/copilot-videos/issues/51?shareId=1f8f2543-bca4-441f-ae9d-f3dbd8896d29).
@rajbos rajbos merged commit d060335 into xebia:main Jul 9, 2024
1 check passed
@rajbos rajbos deleted the update-game-landscape branch July 9, 2024 19:42
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