0xab368307…603fsent to0x7c3ea2b7…0b18·#18,735,400·view on Etherscan
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);
}