Works!
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
4a6351ccd1
commit
f692fa9575
1
client/.env
Normal file
1
client/.env
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
@ -9,6 +9,7 @@
|
|||||||
"@testing-library/jest-dom": "^5.16.1",
|
"@testing-library/jest-dom": "^5.16.1",
|
||||||
"@testing-library/react": "^12.1.2",
|
"@testing-library/react": "^12.1.2",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
|
"moment": "^2.29.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-moment": "^1.1.1",
|
"react-moment": "^1.1.1",
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
body {
|
body {
|
||||||
font-family: 'Droid Sans', 'Arial Narrow', Arial, sans-serif;
|
font-family: 'Droid Sans', 'Arial Narrow', Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#root {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
@ -633,13 +633,15 @@ class Board extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateDimensions() {
|
updateDimensions() {
|
||||||
|
const hasToolbar = false;
|
||||||
|
|
||||||
if (this.updateSizeTimer) {
|
if (this.updateSizeTimer) {
|
||||||
clearTimeout(this.updateSizeTimer);
|
clearTimeout(this.updateSizeTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateSizeTimer = setTimeout(() => {
|
this.updateSizeTimer = setTimeout(() => {
|
||||||
const container = document.getElementById("root"),
|
const container = document.getElementById("root"),
|
||||||
offset = container.firstChild.offsetHeight,
|
offset = hasToolbar ? container.firstChild.offsetHeight : 0,
|
||||||
height = window.innerHeight - offset;
|
height = window.innerHeight - offset;
|
||||||
|
|
||||||
this.offsetY = offset;
|
this.offsetY = offset;
|
||||||
@ -665,12 +667,16 @@ class Board extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.canvas.width === 0 || this.canvas.height === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const ctx = this.canvas.getContext("2d");
|
const ctx = this.canvas.getContext("2d");
|
||||||
ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.strokeStyle = 'white';
|
ctx.strokeStyle = 'white';
|
||||||
ctx.filleStyle = 'rgba(0, 0, 0, 0)';
|
ctx.fillStyle = 'rgba(0, 0, 0, 0)';
|
||||||
|
|
||||||
this.minSize = Math.min(this.canvas.height, this.canvas.width);
|
this.minSize = Math.min(this.canvas.height, this.canvas.width);
|
||||||
/*
|
/*
|
||||||
@ -726,6 +732,7 @@ class Board extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
|
|
||||||
ctx.scale(this.minSize / hexagonRatio, this.minSize / hexagonRatio);
|
ctx.scale(this.minSize / hexagonRatio, this.minSize / hexagonRatio);
|
||||||
ctx.translate(0.5 * hexagonRatio, 0.5 * hexagonRatio);
|
ctx.translate(0.5 * hexagonRatio, 0.5 * hexagonRatio);
|
||||||
ctx.lineWidth = 2. / this.minSize;
|
ctx.lineWidth = 2. / this.minSize;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peddlers-of-ketran-server",
|
"name": "peddlers-of-ketran-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -30,5 +30,5 @@
|
|||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@git.ketrenos.com:jketreno/peddlers-of-ketran"
|
"url": "git@git.ketrenos.com:jketreno/peddlers-of-ketran"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user