memoscan
← all memos

Memo 0xd5601e0c…2c4a76 on Ethereum

let img; function preload() { const selectedImage = tokenData.tokenId - 20000000; let CID = "QmcSk8MmroYi37VBWVsFhwvuC5Puiqg24zKBBpSkefUbYG"; img = loadImage(`https://ipfs.io/ipfs/${CID}/${selectedImage}.png`); } function setup() { createCanvas(windowWidth, windowHeight); } function draw() { background(255); let imgAspectRatio = img.width / img.height; let newWidth = width; let newHeight = newWidth / imgAspectRatio; if (newHeight > height) { newHeight = height; newWidth = newHeight * imgAspectRatio; } let x = (width - newWidth) / 2; let y = (height - newHeight) / 2; image(img, x, y, newWidth, newHeight); } function windowResized() { resizeCanvas(windowWidth, windowHeight); }