diff --git a/bingo.js b/bingo.js new file mode 100644 index 0000000..f2fb2f2 --- /dev/null +++ b/bingo.js @@ -0,0 +1,75 @@ +const squares = [ + "Single deck instead of double deck", + "Driving past you waiting at the stop", + "Standing room only", + "Ticket printer jammed", + "Card reader not working", + "Broken CCTV display", + "Smell of weed", + "Smell of piss", + "Someone swears at the driver for doing their job", + "Leaky beer can rolling around", + "10-year-old vaping at the back", + "Elaborate driver changeover mid-route", + "Broken stop-button", + "Discarded takeaway on floor", + "Unidentified stain on last seat", + "'We are being held at this stop to regulate the service'", + "Mother with pram even though it's 11pm", + "Driver ignores the stop request", + "Someone talking to themselves", + "Loud phone conversation, with gossip", + "Someone taking 10 minutes to get change/card from bag to pay", + "Harsh braking for no apparent reason" +] + +const backgrounds = [ + "first.jpg", + "first.webp", + "london.jpg", + "london2.jpg", + "stagecoach.webp", + "stagecoach2.jpg", + "travel-west-mids.jpg" +] + +document.getElementById("bg").style.backgroundImage = `url('moquettes/${backgrounds[Math.floor(Math.random() * backgrounds.length)]}')`; + +function generateBoard(size) { + document.getElementById("game-board").innerHTML = ""; + const toPick = size * size; + + const picked = []; + + document.getElementById("game-board").style.gridTemplateColumns = `repeat(${size}, 1fr)`; + document.getElementById("game-board").style.gridTemplateRows = `repeat(${size}, 1fr)`; + + for (let i = 0; i < toPick; i++) { + if (i == Math.floor(toPick / 2)) { + picked.push("LATE (free space)"); + continue; + } + + const index = Math.floor(Math.random() * squares.length); + picked.push(squares.splice(index, 1)[0]); + } + + for (const s of picked) { + const sqE = document.createElement("div"); + sqE.classList.add("square"); + sqE.innerHTML = `
${s}
`; + sqE.onclick = () => { sqE.classList.toggle("selected") }; + document.getElementById("game-board").appendChild(sqE); + } +} + +function closeIntro() { + document.getElementById('intro').remove(); + localStorage.setItem('intro', 'seen'); +} + +// if (localStorage.getItem('intro') === 'seen') { +// document.getElementById('intro').remove(); +// } + +generateBoard(3); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..4c76ec5 --- /dev/null +++ b/index.html @@ -0,0 +1,189 @@ + + + + + + British Bus Bingo + + + + + + + + + + + + + +
+
+ + + + \ No newline at end of file diff --git a/moquettes/first.jpg b/moquettes/first.jpg new file mode 100644 index 0000000..7ef044d Binary files /dev/null and b/moquettes/first.jpg differ diff --git a/moquettes/first.webp b/moquettes/first.webp new file mode 100644 index 0000000..4a77c66 Binary files /dev/null and b/moquettes/first.webp differ diff --git a/moquettes/london.jpg b/moquettes/london.jpg new file mode 100644 index 0000000..97a8478 Binary files /dev/null and b/moquettes/london.jpg differ diff --git a/moquettes/london2.jpg b/moquettes/london2.jpg new file mode 100644 index 0000000..dbba6b0 Binary files /dev/null and b/moquettes/london2.jpg differ diff --git a/moquettes/stagecoach.webp b/moquettes/stagecoach.webp new file mode 100644 index 0000000..611019c Binary files /dev/null and b/moquettes/stagecoach.webp differ diff --git a/moquettes/stagecoach2.jpg b/moquettes/stagecoach2.jpg new file mode 100644 index 0000000..6e4f32e Binary files /dev/null and b/moquettes/stagecoach2.jpg differ diff --git a/moquettes/travel-west-mids.jpg b/moquettes/travel-west-mids.jpg new file mode 100644 index 0000000..7bc7926 Binary files /dev/null and b/moquettes/travel-west-mids.jpg differ