-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
291 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,104 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
font-family: system-ui; | ||
background-color: #f0f0f0; | ||
overflow: hidden; | ||
} | ||
|
||
#app-container { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100vh; | ||
width: 100vw; | ||
} | ||
|
||
#turn-display { | ||
text-align: center; | ||
padding: 10px; | ||
font-size: 24px; | ||
font-weight: bold; | ||
background-color: #e0e0e0; | ||
} | ||
|
||
#game-container { | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
#board-canvas { | ||
flex-grow: 1; | ||
max-width: 100%; | ||
max-height: 100%; | ||
object-fit: contain; | ||
margin: 0 auto; /* Center the canvas */ | ||
} | ||
|
||
#action-panels { | ||
width: 100%; | ||
background-color: #e0e0e0; | ||
padding: 10px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
|
||
#action-panels > div { | ||
flex: 1; | ||
text-align: center; | ||
padding: 5px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
hello tazar steve | ||
<div id="app-container"> | ||
<div id="turn-display">Red Player's Turn</div> | ||
<div id="game-container"> | ||
<canvas id="board-canvas"></canvas> | ||
<div id="action-panels"> | ||
<div id="piece-actions">Piece Actions</div> | ||
<div id="available-moves">Available Moves</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script> | ||
let canvas = document.getElementById('board-canvas'); | ||
let ctx = canvas.getContext('2d'); | ||
|
||
function resizeCanvas() { | ||
// Get the game container's dimensions | ||
let container = document.getElementById('game-container'); | ||
let actionPanels = document.getElementById('action-panels'); | ||
|
||
// Calculate available height | ||
let availableHeight = container.clientHeight - actionPanels.clientHeight; | ||
|
||
// Set canvas dimensions | ||
canvas.width = container.clientWidth * window.devicePixelRatio; | ||
canvas.height = availableHeight * window.devicePixelRatio; | ||
|
||
// Scale the context | ||
ctx.scale(window.devicePixelRatio, window.devicePixelRatio); | ||
|
||
// Ensure canvas fits within container | ||
canvas.style.width = container.clientWidth + 'px'; | ||
canvas.style.height = availableHeight + 'px'; | ||
} | ||
|
||
// Initial resize | ||
resizeCanvas(); | ||
|
||
// Resize on window change | ||
window.addEventListener('resize', resizeCanvas); | ||
</script> | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,8 @@ | |
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
typedef struct { | ||
|
||
} Game; | ||
|
||
#endif // TAZAR_H |