Skip to content

Commit

Permalink
adds responsive padding
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenist committed Nov 24, 2023
1 parent 4947b9d commit 21d3948
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ function main() {
if (!root) {
throw new Error("Root element not found")
}
new WebDrawingApp(root, 500, 500)
const width = Math.min(window.innerWidth, 500)
const height = Math.min(window.innerHeight, 500)
new WebDrawingApp(root, width, height)
}
14 changes: 14 additions & 0 deletions apps/web/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ canvas {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
cursor: none;
}

@media (max-width: 564px) {
main {
padding-left: 0;
padding-right: 0;
}
}

@media (max-height: 564px) {
main {
padding-top: 0;
padding-bottom: 0;
}
}
2 changes: 1 addition & 1 deletion libs/webgl/src/WebDrawingApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VectorArray } from "./types/arrays"

export class WebDrawingApp {
public readonly canvas: HTMLCanvasElement
private engine: DrawingEngine
public readonly engine: DrawingEngine

constructor(
private readonly root: HTMLElement,
Expand Down

0 comments on commit 21d3948

Please sign in to comment.