diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..2ba986f
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,15 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "chrome",
+ "request": "launch",
+ "name": "Launch Chrome against localhost",
+ "url": "http://localhost:8080",
+ "webRoot": "${workspaceFolder}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/helpers.js b/helpers.js
new file mode 100644
index 0000000..98dfd3a
--- /dev/null
+++ b/helpers.js
@@ -0,0 +1,54 @@
+export function handleSearch() {
+ const searchTerm = this.value.trim().toLowerCase();
+ const episodes = document.getElementsByClassName("episode-container");
+
+ let matchedCount = 0;
+
+ for (const episode of episodes) {
+ const episodeName = episode.querySelector("h2").textContent.toLowerCase();
+ const episodeSummary = episode.querySelector("p").textContent.toLowerCase();
+
+ if (episodeName.includes(searchTerm) || episodeSummary.includes(searchTerm)) {
+ episode.style.display = "block";
+ matchedCount++;
+ } else {
+ episode.style.display = "none";
+ }
+ }
+
+ updateMatchedCount(matchedCount);
+ }
+
+ export function updateMatchedCount(count) {
+ const countElem = document.querySelector(".matched-count");
+
+ // Create the matched count element if it doesn't exist
+ if (!countElem) {
+ const parentElem = document.querySelector("main");
+ const newCountElem = document.createElement("p");
+ newCountElem.classList.add("matched-count");
+ parentElem.insertBefore(newCountElem, parentElem.firstChild);
+ countElem = newCountElem;
+ }
+
+ countElem.textContent = `Displaying ${count} episode(s)`;
+ }
+
+ export function getEpisodeCode(season, episode) {
+ const seasonCode = String(season).padStart(2, "0");
+ const episodeCode = String(episode).padStart(2, "0");
+ return `S${seasonCode}E${episodeCode}`;
+ }
+
+
+ export function handleEpisodeSelection(event) {
+ const selectedIndex = event.target.value;
+
+ document.querySelectorAll(".episode-container").forEach((container, index) => {
+ if (index === Number(selectedIndex)) {
+ container.style.display = "block";
+ } else {
+ container.style.display = "none";
+ }
+ })
+ }
diff --git a/index.html b/index.html
index 9a400d1..46baf37 100644
--- a/index.html
+++ b/index.html
@@ -16,6 +16,6 @@
-
+