Bingo Card

I'll create an HTML template for a 25-square bingo card that supports both images and text, with randomization built in.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Customizable Bingo Card Generator</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 20px auto;
            padding: 20px;
            background-color: #f5f5f5;
        }

        h1 {
            text-align: center;
            color: #333;
        }

        .controls {
            margin-bottom: 20px;
            text-align: center;
        }

        button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin: 5px;
        }

        button:hover {
            background-color: #45a049;
        }

        .bingo-card {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 2px;
            background-color: #333;
            border: 3px solid #333;
            max-width: 600px;
            margin: 0 auto;
            aspect-ratio: 1;
        }

        .bingo-square {
            background-color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 10px;
            text-align: center;
            font-size: 14px;
            min-height: 100px;
            position: relative;
        }

        .bingo-square.free-space {
            background-color: #FFD700;
            font-weight: bold;
        }

        .bingo-square img {
            max-width: 80%;
            max-height: 60px;
            object-fit: contain;
            margin-bottom: 5px;
        }

        .bingo-square .text {
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        @media print {
            body {
                background-color: white;
            }
            .controls {
                display: none;
            }
            .bingo-card {
                page-break-inside: avoid;
            }
        }
    </style>
</head>
<body>
    <h1>🎉 Bingo Card Generator</h1>
    
    <div class="controls">
        <button onclick="generateNewCard()">Generate New Card</button>
        <button onclick="window.print()">Print Card</button>
    </div>

    <div class="bingo-card" id="bingoCard"></div>

    <script>
        // Define your bingo items here
        // Each item can have text, an image URL, or both
        const bingoItems = [
            { text: "Yellow Tang", image: "https://goetc.com/Yellow%20Tang.jpg" },
            { text: "Item 2", image: "" },
            { text: "Item 3", image: "" },
            { text: "Item 4", image: "" },
            { text: "Item 5", image: "" },
            { text: "Item 6", image: "" },
            { text: "Item 7", image: "" },
            { text: "Item 8", image: "" },
            { text: "Item 9", image: "" },
            { text: "Item 10", image: "" },
            { text: "Item 11", image: "" },
            { text: "Item 12", image: "" },
            // Center square will be FREE SPACE
            { text: "Item 13", image: "" },
            { text: "Item 14", image: "" },
            { text: "Item 15", image: "" },
            { text: "Item 16", image: "" },
            { text: "Item 17", image: "" },
            { text: "Item 18", image: "" },
            { text: "Item 19", image: "" },
            { text: "Item 20", image: "" },
            { text: "Item 21", image: "" },
            { text: "Item 22", image: "" },
            { text: "Item 23", image: "" },
            { text: "Item 24", image: "" }
        ];

        // Shuffle array function
        function shuffleArray(array) {
            const newArray = [...array];
            for (let i = newArray.length - 1; i > 0; i--) {
                const j = Math.floor(Math.random() * (i + 1));
                [newArray[i], newArray[j]] = [newArray[j], newArray[i]];
            }
            return newArray;
        }

        // Generate bingo card
        function generateNewCard() {
            const card = document.getElementById('bingoCard');
            card.innerHTML = '';

            // Shuffle the items
            const shuffledItems = shuffleArray(bingoItems);

            // Create 25 squares
            for (let i = 0; i < 25; i++) {
                const square = document.createElement('div');
                square.className = 'bingo-square';

                // Make center square (index 12) a free space
                if (i === 12) {
                    square.classList.add('free-space');
                    square.innerHTML = '<div class="text">FREE<br>SPACE</div>';
                } else {
                    // Adjust index to account for free space
                    const itemIndex = i < 12 ? i : i - 1;
                    const item = shuffledItems[itemIndex];

                    // Add image if provided
                    if (item.image) {
                        const img = document.createElement('img');
                        img.src = item.image;
                        img.alt = item.text;
                        square.appendChild(img);
                    }

                    // Add text
                    const textDiv = document.createElement('div');
                    textDiv.className = 'text';
                    textDiv.textContent = item.text;
                    square.appendChild(textDiv);
                }

                card.appendChild(square);
            }
        }

        // Generate initial card on page load
        generateNewCard();
    </script>
</body>
</html>

How to create BINGO cards

  1. Customize Your Items: Edit the bingoItems array in the JavaScript section (around line 107). Each item can have:

  2. Add Images: To include images, simply add the image URL to the image property:

    { text: "Cat", image: "https://example.com/cat.jpg" }
    
  3. Generate Cards: Click "Generate New Card" to create a new randomized layout. The center square is always a FREE SPACE.

  4. Print: Use the "Print Card" button to print multiple unique cards—just generate a new card and print each time.