created src directory

This commit is contained in:
Clayton Voges 2022-01-05 20:03:08 +00:00
parent 9f5169bfc0
commit 322fd6e541

24
src/inventory.js Normal file
View 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);
}