xxxxxxxxxx
let word = "BLOKADE";
let pulseFactor = 1;
function setup() {
createCanvas(600, 600); // Larger canvas size
textSize(18); // Adjust text size for the heart
textAlign(CENTER, CENTER);
textFont('monospace');
}
function draw() {
background('#F8F1AE'); // Pastel yellow background
// Apply pulsation effect: Use sine function for smooth scaling
pulseFactor = 1 + 0.25 * sin(frameCount * 0.05); // Pulsates the heart size
// Set the color for the heart (neon pink)
fill('#FF10F0');
// Draw the heart using ASCII "BLOKADE"
drawHeart(width / 2, height / 2, 200 * pulseFactor); // Adjusted for pulsation
}
function drawHeart(x, y, size) {
// ASCII Heart shape using the word "BLOKADE"
let heartShape = [
" BBBBB BBBBB ",
" BBBBBBBB BBBBBBBB ",
" BBBBBBBBBBB BBBBBBBBBBB ",
" BBBBBBBBBBBBBBBBBBBBBBBB ",
" BBBBBBBBBBBBBBBBBBBBBBBB ",
" BBBBBBBBBBBBBBBBBBBBB ",
" BBBBBBBBBBBBBBBBB ",
" BBBBBBBBBBBBB ",
" BBBBBBBBB ",
" BBBBB ",
" B "
];
let rowHeight = size / heartShape.length; // Dynamically adjust row height based on the size
let totalHeight = heartShape.length * rowHeight; // Total height of the heart
let wordIndex = 0; // To cycle through the letters of "BLOKADE"
// Loop through each row of the heart
for (let i = 0; i < heartShape.length; i++) {
let row = heartShape[i];
let textRow = "";
// For each character in the row, use the word "BLOKADE"
for (let j = 0; j < row.length; j++) {
if (row[j] === "B") {
textRow += word[wordIndex % word.length]; // Cycle through the word "BLOKADE"
wordIndex++;
} else {
textRow += " "; // Space where there are no "B"s
}
}
// Position the heart in the middle and draw the row of text
textSize(size / 12); // Adjust text size for better fit
text(textRow, x, y - totalHeight / 2 + i * rowHeight); // Center the heart vertically
}
}