Skip to content

Commit 4cf2fc9

Browse files
committed
fix: add canvas-wrapper to breakout task
1 parent 2ac2d80 commit 4cf2fc9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/instrument-library/src/interactive/breakout-task/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ export default defineInstrument({
1212
render(done) {
1313
const startTime = Date.now();
1414

15+
const wrapper = document.createElement('div');
16+
wrapper.classList.add('canvas-wrapper');
17+
1518
const canvas = document.createElement('canvas');
1619
canvas.height = 320;
1720
canvas.width = 480;
18-
document.body.appendChild(canvas);
21+
22+
wrapper.appendChild(canvas);
23+
document.body.appendChild(wrapper);
1924

2025
const ctx = canvas.getContext('2d')!;
2126
const ballRadius = 10;

packages/instrument-library/src/interactive/breakout-task/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ canvas {
88
display: block;
99
margin: 0 auto;
1010
}
11+
12+
.canvas-wrapper {
13+
display: flex;
14+
justify-content: center;
15+
align-items: center;
16+
height: 100vh;
17+
width: 100vw;
18+
}

0 commit comments

Comments
 (0)