From 2af37ad9eae01a8cd3f8967489891ab7191a8084 Mon Sep 17 00:00:00 2001 From: yokoberek <144463414+yokoberek@users.noreply.github.com> Date: Mon, 6 May 2024 19:30:06 +0700 Subject: [PATCH] chore: delete script.js --- script.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 script.js diff --git a/script.js b/script.js deleted file mode 100644 index fc7a74c..0000000 --- a/script.js +++ /dev/null @@ -1,39 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - const storiesContainer = document.getElementById("stories-container"); - - // Ambil data cerita dari URL - fetch("https://raw.githubusercontent.com/papua-opensource/mops/master/data.json") - .then(response => response.json()) - .then(data => { - // Tampilkan cerita dalam HTML - data.stories.forEach(story => { - const storyElement = document.createElement("div"); - storyElement.classList.add("story"); - - const titleElement = document.createElement("h2"); - titleElement.textContent = story.title; - storyElement.appendChild(titleElement); - - const descriptionElement = document.createElement("p"); - descriptionElement.textContent = story.description; - storyElement.appendChild(descriptionElement); - - const scenesElement = document.createElement("ul"); - story.scenes.forEach(scene => { - const sceneElement = document.createElement("li"); - if (scene.type === "description") { - sceneElement.textContent = scene.content; - } else if (scene.type === "dialogue") { - sceneElement.textContent = `${scene.speaker}: ${scene.message}`; - } - scenesElement.appendChild(sceneElement); - }); - storyElement.appendChild(scenesElement); - - storiesContainer.appendChild(storyElement); - }); - }) - .catch(error => { - console.error("Error fetching stories:", error); - }); -});