html/css canvas width/height handling
i'm trying to code snake as a browsergame in javascript for a school project and i want to do it with an external .js file - not just in the .html. my problem now is: when i call the main…
i'm trying to code snake as a browsergame in javascript for a school project and i want to do it with an external .js file - not just in the .html. my problem now is: when i call the main…
I am currently working on a project where I record every individual gammon an NFL season, edit it, and post it on the website. I have a bunch of images from the retro bowl source code that I want to…
I would like to make a very basic layout designer website, where users could drag and drop rectangles onto a planning area, where they could then resize the rectangles. The rectangles would need to be some sort of objects, as…
I'm trying to get my canvas element to take up the whole width/height of the document body, and have it resize when the body size changes (such as a cell phone going from portrait to landscape). The canvas resizes as…
I am creating an White-board application and I am tying to draw with my mouse using different color pen. I was trying to use ctx.strokeStyle to change the color of pen but for some reason it is not working. I…
I am building an whiteboard application and to create the white board I was playing with html canvas element. I was trying to print a word on canvas but I really don't understand why but it is putting it twice…
An html5 template I downloaded has red icons as shown in the image here . I want to change the color of icons to #628e7f. I inserted the following codes in the main.css file . Instead of changing the icon…
I am making a program in JavaScript that uses the canvas. I want to get user input from the prompt() function, but that has been deprecated in Electron Fiddle that I am using. What is an alternative to prompt() that…
I want to display a stream of images in a browser component. So far I've tried something like function fetchData() { fetch("data.png?") .then((response) => response.blob()) .then((blob) => { var ctx = canvas.getContext("2d"); var width = canvas.width; var height = canvas.height…
i want the canvas to fill the whole webpage under the heading, maybe with a small margin between the edge of the canvas and the edge of the window. but i can't get it to fill the screen and now…