created src directory
This commit is contained in:
parent
9f5169bfc0
commit
322fd6e541
1 changed files with 0 additions and 0 deletions
24
src/inventory.js
Normal file
24
src/inventory.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue