🎮ArcadeLab

🎃 SONG CHAOS

by BoldPenguin14
421 lines8.3 KB
▶ Play

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#251632">
<title>🎃 SONG CHAOS</title>

<style>
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 18px;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  text-align: center;
  color: white;
  background: linear-gradient(145deg,#170c29,#552044,#b64b21);
}

main {
  max-width: 550px;
  margin: 20px auto;
  padding: 24px 19px;
  border: 2px solid #ff9c50;
  border-radius: 25px;
  background: #251632;
  box-shadow: 0 10px 35px #0008;
}

h1 {
  color: #ffb36b;
  font-size: 36px;
}

h2 { color: #ffd1a3; }

input, select, button {
  width: 100%;
  padding: 16px;
  margin: 9px 0;
  border: none;
  border-radius: 13px;
  font-size: 16px;
}

input, select {
  background: white;
  color: #251632;
}

button {
  background: #ff963e;
  color: #251632;
  font-weight: bold;
  cursor: pointer;
}

button:active { transform: scale(.97); }

#result {
  display: none;
  margin-top: 22px;
  padding: 22px;
  border-radius: 18px;
  background: #392346;
}

#emoji { font-size: 65px; }

#name {
  color: #ffb36b;
  font-size: 25px;
  overflow-wrap: anywhere;
}

#creator, #reason { color: #ffd1a3; }

.result-link {
  display: block;
  padding: 15px;
  margin: 12px 0;
  border-radius: 12px;
  color: #251632;
  background: #ffb36b;
  text-decoration: none;
  font-weight: bold;
}

#status {
  min-height: 25px;
  color: #ffd1a3;
}

footer {
  margin-top: 25px;
  color: #ffd1a3;
  font-size: 12px;
}
</style>
</head>

<body>

<main>

<h1>🎃 SONG CHAOS 🎧</h1>
<h2>The Music & Podcast Finder</h2>

<p>Tell me what you love. I'll find your match!</p>

<input
  id="ask"
  type="text"
  placeholder="Try Stranger Things, Michael Myers..."
>

<select id="kind">
  <option value="song">🎵 Song</option>
  <option value="podcast">🎙️ Podcast</option>
  <option value="both">🎲 Surprise Me!</option>
</select>

<button onclick="findIt()">
✨ FIND IT NOW!
</button>

<p id="status" aria-live="polite"></p>

<div id="result">

  <h2 id="headline"></h2>
  <div id="emoji">🎃</div>

  <h2 id="name"></h2>
  <p id="creator"></p>
  <p id="reason"></p>

  <a id="apple" class="result-link"
     target="_blank" rel="noopener noreferrer">
     🍎 SEARCH APPLE MUSIC / PODCASTS
  </a>

  <a id="amazon" class="result-link"
     target="_blank" rel="noopener noreferrer">
     📦 SEARCH AMAZON MUSIC
  </a>

  <button onclick="findIt()">
    🎲 GIVE ME ANOTHER!
  </button>

</div>

<footer>
🎃 Music chaos, all year long!
</footer>

</main>

<script>

const $ = id => document.getElementById(id);

const recommendations = {

  strangerThings: {
    songs: [
      {
        name: "Running Up That Hill",
        creator: "Kate Bush",
        emoji: "🚲",
        reason: "A legendary song featured in Stranger Things!"
      },
      {
        name: "Master of Puppets",
        creator: "Metallica",
        emoji: "🎸",
        reason: "Eddie Munson's unforgettable guitar moment!"
      },
      {
        name: "Should I Stay or Should I Go",
        creator: "The Clash",
        emoji: "📼",
        reason: "A classic connected to the early Stranger Things story!"
      }
    ],
    podcasts: [
      {
        name: "Stranger Things: The Official Podcast",
        creator: "Netflix",
        emoji: "🚲",
        reason: "Explore the world and making of Stranger Things. Search for official and related episodes."
      },
      {
        name: "Stranger Things podcasts and fan discussions",
        creator: "Multiple creators",
        emoji: "🔦",
        reason: "Discover fan theories, episode discussions and Hawkins mysteries!"
      }
    ]
  },

  halloween: {
    songs: [
      {
        name: "Halloween Theme (Main Title)",
        creator: "John Carpenter",
        emoji: "🔪",
        reason: "The chilling Michael Myers theme!"
      },
      {
        name: "Thriller",
        creator: "Michael Jackson",
        emoji: "🧟",
        reason: "A Halloween classic!"
      },
      {
        name: "Monster Mash",
        creator: "Bobby Pickett",
        emoji: "👻",
        reason: "A monster party classic!"
      }
    ],
    podcasts: [
      {
        name: "Lore",
        creator: "Aaron Mahnke",
        emoji: "👻",
        reason: "Creepy folklore and strange real-life history."
      },
      {
        name: "Spooked",
        creator: "Snap Judgment",
        emoji: "😱",
        reason: "People share their frightening real-life experiences."
      }
    ]
  },

  christmas: {
    songs: [
      {
        name: "All I Want for Christmas Is You",
        creator: "Mariah Carey",
        emoji: "🎄",
        reason: "Christmas chaos is here!"
      },
      {
        name: "Last Christmas",
        creator: "Wham!",
        emoji: "🎅",
        reason: "A Christmas favorite!"
      }
    ],
    podcasts: [
      {
        name: "Christmas podcast episodes",
        creator: "Multiple creators",
        emoji: "🎄",
        reason: "Find festive stories and holiday conversations."
      }
    ]
  },

  comedy: {
    songs: [
      {
        name: "Never Gonna Give You Up",
        creator: "Rick Astley",
        emoji: "😂",
        reason: "You've been Rickrolled!"
      }
    ],
    podcasts: [
      {
        name: "SmartLess",
        creator: "SmartLess",
        emoji: "😂",
        reason: "Funny conversations with celebrity guests."
      },
      {
        name: "Conan O'Brien Needs a Friend",
        creator: "Team Coco",
        emoji: "🤣",
        reason: "Comedy and entertaining interviews."
      }
    ]
  },

  general: {
    songs: [
      {
        name: "Dancing Queen",
        creator: "ABBA",
        emoji: "🪩",
        reason: "Time for a dance party!"
      },
      {
        name: "Ghostbusters",
        creator: "Ray Parker Jr.",
        emoji: "👻",
        reason: "Who you gonna call?"
      },
      {
        name: "Bohemian Rhapsody",
        creator: "Queen",
        emoji: "🎤",
        reason: "An unforgettable musical classic!"
      }
    ],
    podcasts: [
      {
        name: "Stuff You Should Know",
        creator: "iHeartPodcasts",
        emoji: "🧠",
        reason: "Learn fascinating things about the world."
      },
      {
        name: "The Moth",
        creator: "The Moth",
        emoji: "🎙️",
        reason: "Real people telling incredible stories."
      }
    ]
  }

};

let lastName = "";

function findCategory(prompt) {

  if (/stranger things|hawkins|eleven|demogorgon|eddie munson|vecna|upside down/i.test(prompt)) {
    return "strangerThings";
  }

  if (/michael myers|halloween|horror|scary|creepy|ghost|spooky|slasher/i.test(prompt)) {
    return "halloween";
  }

  if (/christmas|xmas|santa|holiday/i.test(prompt)) {
    return "christmas";
  }

  if (/funny|comedy|laugh|joke/i.test(prompt)) {
    return "comedy";
  }

  return "general";
}

function findIt() {

  let kind = $("kind").value;
  const prompt = $("ask").value.trim();

  if (kind === "both") {
    kind = Math.random() < 0.5 ? "song" : "podcast";
  }

  const category = findCategory(prompt);

  const collection = recommendations[category][
    kind === "podcast" ? "podcasts" : "songs"
  ];

  let available = collection.filter(
    item => item.name !== lastName
  );

  if (!available.length) available = collection;

  const choice = available[
    Math.floor(Math.random() * available.length)
  ];

  lastName = choice.name;

  $("headline").textContent =
    "✨ OK! THE BEST " +
    (kind === "podcast" ? "PODCAST" : "SONG") +
    " FOR YOU IS...";

  $("emoji").textContent = choice.emoji;
  $("name").textContent = choice.name;
  $("creator").textContent = "By " + choice.creator;
  $("reason").textContent = choice.reason;

  const query = encodeURIComponent(
    choice.name + " " + choice.creator
  );

  $("apple").href = kind === "podcast"
    ? "https://podcasts.apple.com/us/search?term=" + query
    : "https://music.apple.com/us/search?term=" + query;

  $("amazon").href =
    "https://music.amazon.com/search/" + query;

  $("status").textContent = "🎉 YOUR MATCH IS READY!";

  $("result").style.display = "block";

  $("result").scrollIntoView({
    behavior: "smooth",
    block: "nearest"
  });
}

$("ask").addEventListener("keydown", event => {
  if (event.key === "Enter") findIt();
});

</script>

</body>
</html>

Game Source: 🎃 SONG CHAOS

Creator: BoldPenguin14

Libraries: none

Complexity: complex (421 lines, 8.3 KB)

The full source code is displayed above on this page.

Remix Instructions

To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: song-chaos-boldpenguin14" to link back to the original. Then publish at arcadelab.ai/publish.