add apu bingo
This commit is contained in:
@@ -367,14 +367,16 @@
|
||||
}
|
||||
const category = (window.memeTemplate && window.memeTemplate.category) ? window.memeTemplate.category.toLowerCase() : '';
|
||||
const subCategory = (window.memeTemplate && window.memeTemplate.sub_category) ? window.memeTemplate.sub_category.toLowerCase() : '';
|
||||
const templateId = (window.memeTemplate && window.memeTemplate.id) ? window.memeTemplate.id.toLowerCase() : '';
|
||||
|
||||
const isOrakelVon10 = subCategory === 'von10';
|
||||
const isOrakelUser = subCategory === 'user';
|
||||
const isOrakelNormal = category === 'orakel' && !isOrakelUser && !isOrakelVon10;
|
||||
const isOrakelBingoApu = subCategory === 'bingoapu' || templateId === 'bingoapu';
|
||||
const isOrakelNormal = category === 'orakel' && !isOrakelUser && !isOrakelVon10 && !isOrakelBingoApu;
|
||||
|
||||
let uploadCanvas = canvas;
|
||||
|
||||
if (isOrakelNormal || isOrakelUser || isOrakelVon10) {
|
||||
if (isOrakelNormal || isOrakelUser || isOrakelVon10 || isOrakelBingoApu) {
|
||||
// Create an off-screen canvas to apply the orakel answer silently
|
||||
uploadCanvas = document.createElement('canvas');
|
||||
uploadCanvas.width = canvas.width;
|
||||
@@ -385,6 +387,7 @@
|
||||
uCtx.drawImage(canvas, 0, 0);
|
||||
|
||||
let result = '';
|
||||
let selectedCorner = null;
|
||||
if (isOrakelNormal) {
|
||||
const outcomes = ['JA', 'NEIN', 'VIELLEICHT', 'AUF JEDEN FALL', 'NIEMALS', 'SOWAS VON JA', 'VERGISS ES', 'FRAG SPÄTER', 'KOMMT DRAUF AN'];
|
||||
result = outcomes[Math.floor(Math.random() * outcomes.length)];
|
||||
@@ -398,10 +401,32 @@
|
||||
}
|
||||
} else if (isOrakelVon10) {
|
||||
result = Math.floor(Math.random() * 11).toString();
|
||||
} else if (isOrakelBingoApu) {
|
||||
const corners = [
|
||||
{ x: 60, y: 100, label: 'YES' },
|
||||
{ x: 573, y: 100, label: 'NO' },
|
||||
{ x: 60, y: 615, label: 'NO' },
|
||||
{ x: 573, y: 615, label: 'YES' }
|
||||
];
|
||||
selectedCorner = corners[Math.floor(Math.random() * corners.length)];
|
||||
result = selectedCorner.label;
|
||||
}
|
||||
|
||||
// Draw Orakel result on the hidden canvas
|
||||
uCtx.save();
|
||||
if (isOrakelBingoApu) {
|
||||
// Draw "KOPS" in normal meme text style on the selected corner
|
||||
uCtx.font = `bold 28px ${memeFont}`;
|
||||
uCtx.textAlign = 'center';
|
||||
uCtx.textBaseline = 'middle';
|
||||
uCtx.fillStyle = '#fff';
|
||||
uCtx.strokeStyle = '#000';
|
||||
uCtx.lineWidth = 4;
|
||||
uCtx.miterLimit = 2;
|
||||
|
||||
uCtx.strokeText('KOPS', selectedCorner.x, selectedCorner.y);
|
||||
uCtx.fillText('KOPS', selectedCorner.x, selectedCorner.y);
|
||||
} else {
|
||||
uCtx.font = (isOrakelVon10) ? 'bold 150px Impact' : 'bold 80px Impact'; // Bigger font for the rating
|
||||
uCtx.textAlign = 'center';
|
||||
uCtx.textBaseline = 'middle';
|
||||
@@ -485,6 +510,7 @@
|
||||
uCtx.strokeText(result, xPos, yPos);
|
||||
uCtx.fillText(result, xPos, yPos);
|
||||
}
|
||||
}
|
||||
uCtx.restore();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user