Spaces:
Running
Running
Commit ·
9b11c4a
1
Parent(s): 7dd19ac
New
Browse files- index.html +20 -31
index.html
CHANGED
|
@@ -13,37 +13,28 @@
|
|
| 13 |
flex-direction: column;
|
| 14 |
height: 100vh;
|
| 15 |
}
|
| 16 |
-
|
| 17 |
header {
|
| 18 |
padding: 10px;
|
| 19 |
background-color: #1f1f1f;
|
| 20 |
display: flex;
|
| 21 |
gap: 10px;
|
| 22 |
-
align-items: center;
|
| 23 |
}
|
| 24 |
-
|
| 25 |
-
input[type="text"] {
|
| 26 |
flex: 1;
|
| 27 |
padding: 8px;
|
| 28 |
-
background
|
| 29 |
-
color:
|
| 30 |
border: 1px solid #444;
|
| 31 |
border-radius: 4px;
|
| 32 |
}
|
| 33 |
-
|
| 34 |
button {
|
| 35 |
-
padding: 8px
|
| 36 |
-
background
|
| 37 |
color: white;
|
| 38 |
border: none;
|
| 39 |
border-radius: 4px;
|
| 40 |
cursor: pointer;
|
| 41 |
}
|
| 42 |
-
|
| 43 |
-
button:hover {
|
| 44 |
-
background-color: #555;
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
iframe {
|
| 48 |
flex: 1;
|
| 49 |
border: none;
|
|
@@ -53,26 +44,24 @@
|
|
| 53 |
</head>
|
| 54 |
<body>
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<iframe id="viewer" src="#"></iframe>
|
| 62 |
|
| 63 |
-
|
| 64 |
-
function loadWebsite() {
|
| 65 |
-
const url = document.getElementById('urlInput').value;
|
| 66 |
-
const iframe = document.getElementById('viewer');
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
-
|
|
|
|
| 76 |
|
| 77 |
</body>
|
| 78 |
</html>
|
|
|
|
| 13 |
flex-direction: column;
|
| 14 |
height: 100vh;
|
| 15 |
}
|
|
|
|
| 16 |
header {
|
| 17 |
padding: 10px;
|
| 18 |
background-color: #1f1f1f;
|
| 19 |
display: flex;
|
| 20 |
gap: 10px;
|
|
|
|
| 21 |
}
|
| 22 |
+
input {
|
|
|
|
| 23 |
flex: 1;
|
| 24 |
padding: 8px;
|
| 25 |
+
background: #2a2a2a;
|
| 26 |
+
color: white;
|
| 27 |
border: 1px solid #444;
|
| 28 |
border-radius: 4px;
|
| 29 |
}
|
|
|
|
| 30 |
button {
|
| 31 |
+
padding: 8px 16px;
|
| 32 |
+
background: #333;
|
| 33 |
color: white;
|
| 34 |
border: none;
|
| 35 |
border-radius: 4px;
|
| 36 |
cursor: pointer;
|
| 37 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
iframe {
|
| 39 |
flex: 1;
|
| 40 |
border: none;
|
|
|
|
| 44 |
</head>
|
| 45 |
<body>
|
| 46 |
|
| 47 |
+
<header>
|
| 48 |
+
<input type="text" id="urlInput" placeholder="Masukkan URL">
|
| 49 |
+
<button onclick="loadWebsite()">Load</button>
|
| 50 |
+
</header>
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
<iframe id="viewer"></iframe>
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
<script>
|
| 55 |
+
function loadWebsite() {
|
| 56 |
+
const url = document.getElementById("urlInput").value;
|
| 57 |
+
const iframe = document.getElementById("viewer");
|
| 58 |
+
if (url.startsWith("http://") || url.startsWith("https://")) {
|
| 59 |
+
iframe.src = url;
|
| 60 |
+
} else {
|
| 61 |
+
alert("URL harus diawali dengan http:// atau https://");
|
| 62 |
}
|
| 63 |
+
}
|
| 64 |
+
</script>
|
| 65 |
|
| 66 |
</body>
|
| 67 |
</html>
|