25 lines
523 B
JavaScript
25 lines
523 B
JavaScript
window.addEventListener('load', () => {
|
|
const canvas = document.querySelector('#inventory');
|
|
const ctx = canvas.getContext("2d");
|
|
|
|
reloadEvent(canvas, ctx);
|
|
});
|
|
|
|
function reloadEvent(x, y){
|
|
window.addEventListener('resize', () => {
|
|
resize(x, y);
|
|
});
|
|
}
|
|
|
|
function draw(x) {
|
|
x.strokeStyle = 'blue';
|
|
x.lineWidth = '5';
|
|
x.strokeRect(0, 0, window.innerWidth, window.innerHeight);
|
|
}
|
|
|
|
function resize(x, y){
|
|
x.height = window.innerHeight;
|
|
x.width = window.innerWidth;
|
|
draw(y);
|
|
}
|