const house = document.getElementById("house")
const body = document.getElementById("body")
const song = new Audio("piano.mp3")
const decorator = document.getElementById("decorator")
decorator.addEventListener("click", deckTheHalls)
function deckTheHalls() {
// Task:
// Write a function to add decorations (e.g. ☃️, 🎄, etc) next to the house when the switch is
toggled.
if (decorator.checked === true){
house.textContent = `🔔☃️🎉🏡🎅🎁🎄`
body.classList.add("decoration")
song.play()
} else {
house.textContent = "🏡"
body.classList.remove("decoration")
song.pause()
}
}
// Stretch goals:
// - Make sure that the house & decorations all stay on one line, even if there are a lot of
decorations.
// - Allow the user to select different decorations.