GilbertClaus commited on
Commit
ae53ac4
·
1 Parent(s): a521068
Files changed (2) hide show
  1. ArkReCode/script.js +1 -1
  2. index.html +8 -9
ArkReCode/script.js CHANGED
@@ -9,7 +9,7 @@ function playVideo(charName) {
9
  video.width = 360;
10
  video.controls = true;
11
  video.autoplay = true;
12
- video.volume = 0.1;
13
  video.style.marginTop = "20px";
14
  wrapper.appendChild(video);
15
  }
 
9
  video.width = 360;
10
  video.controls = true;
11
  video.autoplay = true;
12
+ video.volume = 0.05;
13
  video.style.marginTop = "20px";
14
  wrapper.appendChild(video);
15
  }
index.html CHANGED
@@ -53,10 +53,14 @@
53
  <iframe id="viewer"></iframe>
54
 
55
  <script>
56
- function loadWebsite() {
57
- const url = document.getElementById("urlInput").value;
58
  const iframe = document.getElementById("viewer");
59
- if (url.startsWith("http://") || url.startsWith("https://")) {
 
 
 
 
60
  iframe.src = url;
61
  } else if (url.endsWith(".html")) {
62
  iframe.src = url;
@@ -65,14 +69,9 @@
65
  }
66
  }
67
 
68
- // function ark() {
69
- // window.location.href = "./Ark%20ReCode";
70
- // }
71
-
72
  function ark() {
73
  const urlInput = document.getElementById("urlInput");
74
- urlInput.value = "./ArkReCode/index.html";
75
- loadWebsite();
76
  }
77
 
78
  </script>
 
53
  <iframe id="viewer"></iframe>
54
 
55
  <script>
56
+ function loadWebsite(urlInject = "") {
57
+ const inputField = document.getElementById("urlInput");
58
  const iframe = document.getElementById("viewer");
59
+
60
+ // Gunakan urlInject jika disediakan, jika tidak pakai input dari user
61
+ const url = urlInject !== "" ? urlInject : inputField.value;
62
+
63
+ if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith(".")) {
64
  iframe.src = url;
65
  } else if (url.endsWith(".html")) {
66
  iframe.src = url;
 
69
  }
70
  }
71
 
 
 
 
 
72
  function ark() {
73
  const urlInput = document.getElementById("urlInput");
74
+ loadWebsite("./ArkReCode");
 
75
  }
76
 
77
  </script>