To create a square image with a rectangle in the middle using JavaScript, you can use the HTML5 Canvas element. Here's a simple example to achieve this:
index.tsx753 chars31 lines
This code creates a square canvas with a blue square in the middle and a red rectangle in the middle of the square. You can customize the sizes and colors as needed.
gistlibby LogSnag