Spaces:
Running
Running
- Follow Up Deployment
Browse files- index.html +198 -351
index.html
CHANGED
|
@@ -1,357 +1,204 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
| 10 |
-
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
-
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
-
<style>
|
| 13 |
-
.gradient-text {
|
| 14 |
-
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
|
| 15 |
-
-webkit-background-clip: text;
|
| 16 |
-
background-clip: text;
|
| 17 |
-
color: transparent;
|
| 18 |
-
}
|
| 19 |
-
.article-card:hover {
|
| 20 |
-
transform: translateY(-5px);
|
| 21 |
-
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 22 |
-
}
|
| 23 |
-
.category-badge {
|
| 24 |
-
transition: all 0.3s ease;
|
| 25 |
-
}
|
| 26 |
-
.category-badge:hover {
|
| 27 |
-
transform: scale(1.05);
|
| 28 |
-
}
|
| 29 |
-
</style>
|
| 30 |
</head>
|
| 31 |
-
<body class="bg-gray-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
<p class="text-sm text-gray-500">8 Articles</p>
|
| 181 |
-
</a>
|
| 182 |
-
|
| 183 |
-
<a href="#" class="bg-white p-6 rounded-lg shadow-sm hover:shadow-md transition text-center" data-aos="fade-up" data-aos-delay="200">
|
| 184 |
-
<div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 185 |
-
<i data-feather="file-text" class="text-purple-600 w-8 h-8"></i>
|
| 186 |
-
</div>
|
| 187 |
-
<h3 class="text-lg font-medium text-gray-900 mb-1">Ms Word</h3>
|
| 188 |
-
<p class="text-sm text-gray-500">5 Articles</p>
|
| 189 |
-
</a>
|
| 190 |
-
|
| 191 |
-
<a href="#" class="bg-white p-6 rounded-lg shadow-sm hover:shadow-md transition text-center" data-aos="fade-up" data-aos-delay="300">
|
| 192 |
-
<div class="w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-4">
|
| 193 |
-
<i data-feather="info" class="text-yellow-600 w-8 h-8"></i>
|
| 194 |
-
</div>
|
| 195 |
-
<h3 class="text-lg font-medium text-gray-900 mb-1">Pengetahuan</h3>
|
| 196 |
-
<p class="text-sm text-gray-500">10 Articles</p>
|
| 197 |
-
</a>
|
| 198 |
-
</div>
|
| 199 |
-
</div>
|
| 200 |
-
</section>
|
| 201 |
-
|
| 202 |
-
<!-- Recent Articles -->
|
| 203 |
-
<section class="py-16 bg-white">
|
| 204 |
-
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 205 |
-
<div class="text-center mb-12">
|
| 206 |
-
<h2 class="text-3xl font-bold text-gray-900 mb-4" data-aos="fade-up">Recent Articles</h2>
|
| 207 |
-
<p class="text-lg text-gray-600 max-w-2xl mx-auto" data-aos="fade-up" data-aos-delay="100">
|
| 208 |
-
Stay updated with our latest content
|
| 209 |
-
</p>
|
| 210 |
-
</div>
|
| 211 |
-
|
| 212 |
-
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 213 |
-
<!-- Article 4 -->
|
| 214 |
-
<article class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition duration-300" data-aos="fade-up">
|
| 215 |
-
<a href="#">
|
| 216 |
-
<img src="http://static.photos/education/1024x576/4" alt="Linguistics" class="w-full h-48 object-cover">
|
| 217 |
-
</a>
|
| 218 |
-
<div class="p-6">
|
| 219 |
-
<div class="flex items-center mb-3">
|
| 220 |
-
<span class="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded category-badge">Bahasa</span>
|
| 221 |
-
<span class="text-gray-500 text-sm ml-auto">June 25, 2025</span>
|
| 222 |
-
</div>
|
| 223 |
-
<h3 class="text-lg font-bold mb-2 hover:text-indigo-600 transition">
|
| 224 |
-
<a href="#">Pengertian Linguistik, Ciri, Tatanan, Aliran, Jenis dan Hakikat</a>
|
| 225 |
-
</h3>
|
| 226 |
-
<p class="text-gray-600 text-sm mb-3">Pengertian Linguistik, Ciri, Tatanan, Aliran, Jenis & Hakikat Pengertian Linguistik Secara umum lingu...</p>
|
| 227 |
-
<a href="#" class="text-indigo-600 text-sm font-medium inline-flex items-center hover:text-indigo-800 transition">
|
| 228 |
-
Read more <i data-feather="arrow-right" class="w-4 h-4 ml-1"></i>
|
| 229 |
-
</a>
|
| 230 |
-
</div>
|
| 231 |
-
</article>
|
| 232 |
-
|
| 233 |
-
<!-- Article 5 -->
|
| 234 |
-
<article class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition duration-300" data-aos="fade-up" data-aos-delay="100">
|
| 235 |
-
<a href="#">
|
| 236 |
-
<img src="http://static.photos/education/1024x576/5" alt="Language Extinction" class="w-full h-48 object-cover">
|
| 237 |
-
</a>
|
| 238 |
-
<div class="p-6">
|
| 239 |
-
<div class="flex items-center mb-3">
|
| 240 |
-
<span class="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded category-badge">Bahasa</span>
|
| 241 |
-
<span class="text-gray-500 text-sm ml-auto">Oct 04, 2023</span>
|
| 242 |
-
</div>
|
| 243 |
-
<h3 class="text-lg font-bold mb-2 hover:text-indigo-600 transition">
|
| 244 |
-
<a href="#">Kajian Musnahnya sebuah bahasa</a>
|
| 245 |
-
</h3>
|
| 246 |
-
<p class="text-gray-600 text-sm mb-3">Kajian Musnahnya sebuah bahasa Musnahnya Sebuah Bahasa Bahasa merupakan aspek penting dalam...</p>
|
| 247 |
-
<a href="#" class="text-indigo-600 text-sm font-medium inline-flex items-center hover:text-indigo-800 transition">
|
| 248 |
-
Read more <i data-feather="arrow-right" class="w-4 h-4 ml-1"></i>
|
| 249 |
-
</a>
|
| 250 |
-
</div>
|
| 251 |
-
</article>
|
| 252 |
-
|
| 253 |
-
<!-- Article 6 -->
|
| 254 |
-
<article class="bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition duration-300" data-aos="fade-up" data-aos-delay="200">
|
| 255 |
-
<a href="#">
|
| 256 |
-
<img src="http://static.photos/technology/1024x576/6" alt="Blog Visitors" class="w-full h-48 object-cover">
|
| 257 |
-
</a>
|
| 258 |
-
<div class="p-6">
|
| 259 |
-
<div class="flex items-center mb-3">
|
| 260 |
-
<span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded category-badge">Tutorial</span>
|
| 261 |
-
<span class="text-gray-500 text-sm ml-auto">Oct 04, 2023</span>
|
| 262 |
-
</div>
|
| 263 |
-
<h3 class="text-lg font-bold mb-2 hover:text-indigo-600 transition">
|
| 264 |
-
<a href="#">Cara Meningkatkan pengunjung Blog</a>
|
| 265 |
-
</h3>
|
| 266 |
-
<p class="text-gray-600 text-sm mb-3">Cara Meningkatkan pengunjung Blog Untuk meningkatkan pengunjung blog secara organik, b...</p>
|
| 267 |
-
<a href="#" class="text-indigo-600 text-sm font-medium inline-flex items-center hover:text-indigo-800 transition">
|
| 268 |
-
Read more <i data-feather="arrow-right" class="w-4 h-4 ml-1"></i>
|
| 269 |
-
</a>
|
| 270 |
-
</div>
|
| 271 |
-
</article>
|
| 272 |
-
</div>
|
| 273 |
-
</div>
|
| 274 |
-
</section>
|
| 275 |
-
|
| 276 |
-
<!-- Newsletter -->
|
| 277 |
-
<section class="py-16 bg-gradient-to-r from-indigo-500 to-purple-600 text-white">
|
| 278 |
-
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
|
| 279 |
-
<h2 class="text-3xl font-bold mb-6" data-aos="fade-up">Stay Updated</h2>
|
| 280 |
-
<p class="text-xl mb-8 max-w-2xl mx-auto" data-aos="fade-up" data-aos-delay="100">
|
| 281 |
-
Subscribe to our newsletter to get the latest articles delivered to your inbox.
|
| 282 |
-
</p>
|
| 283 |
-
<form class="max-w-md mx-auto" data-aos="fade-up" data-aos-delay="200">
|
| 284 |
-
<div class="flex">
|
| 285 |
-
<input type="email" placeholder="Your email address" class="flex-grow px-4 py-3 rounded-l-lg focus:outline-none text-gray-900">
|
| 286 |
-
<button type="submit" class="bg-indigo-800 hover:bg-indigo-900 px-6 py-3 rounded-r-lg font-medium transition">
|
| 287 |
-
Subscribe
|
| 288 |
-
</button>
|
| 289 |
-
</div>
|
| 290 |
-
</form>
|
| 291 |
-
</div>
|
| 292 |
-
</section>
|
| 293 |
-
|
| 294 |
-
<!-- Footer -->
|
| 295 |
-
<footer class="bg-gray-900 text-white py-12">
|
| 296 |
-
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 297 |
-
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 298 |
-
<div>
|
| 299 |
-
<h3 class="text-lg font-bold mb-4 flex items-center">
|
| 300 |
-
<i data-feather="book-open" class="mr-2"></i> Agi Balaja
|
| 301 |
-
</h3>
|
| 302 |
-
<p class="text-gray-400">
|
| 303 |
-
Exploring the intersection of linguistics and technology through insightful articles.
|
| 304 |
-
</p>
|
| 305 |
-
</div>
|
| 306 |
-
<div>
|
| 307 |
-
<h4 class="text-lg font-bold mb-4">Quick Links</h4>
|
| 308 |
-
<ul class="space-y-2">
|
| 309 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Home</a></li>
|
| 310 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Articles</a></li>
|
| 311 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Categories</a></li>
|
| 312 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">About</a></li>
|
| 313 |
-
</ul>
|
| 314 |
-
</div>
|
| 315 |
-
<div>
|
| 316 |
-
<h4 class="text-lg font-bold mb-4">Categories</h4>
|
| 317 |
-
<ul class="space-y-2">
|
| 318 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Bahasa</a></li>
|
| 319 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Tutorial</a></li>
|
| 320 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Ms Word</a></li>
|
| 321 |
-
<li><a href="#" class="text-gray-400 hover:text-white transition">Pengetahuan</a></li>
|
| 322 |
-
</ul>
|
| 323 |
-
</div>
|
| 324 |
-
<div>
|
| 325 |
-
<h4 class="text-lg font-bold mb-4">Connect</h4>
|
| 326 |
-
<div class="flex space-x-4">
|
| 327 |
-
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 328 |
-
<i data-feather="facebook"></i>
|
| 329 |
-
</a>
|
| 330 |
-
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 331 |
-
<i data-feather="twitter"></i>
|
| 332 |
-
</a>
|
| 333 |
-
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 334 |
-
<i data-feather="instagram"></i>
|
| 335 |
-
</a>
|
| 336 |
-
<a href="#" class="text-gray-400 hover:text-white transition">
|
| 337 |
-
<i data-feather="linkedin"></i>
|
| 338 |
-
</a>
|
| 339 |
-
</div>
|
| 340 |
-
</div>
|
| 341 |
-
</div>
|
| 342 |
-
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
|
| 343 |
-
<p>© 2025 Agi Balaja. All rights reserved.</p>
|
| 344 |
-
</div>
|
| 345 |
-
</div>
|
| 346 |
-
</footer>
|
| 347 |
-
|
| 348 |
-
<script>
|
| 349 |
-
AOS.init({
|
| 350 |
-
duration: 800,
|
| 351 |
-
easing: 'ease-in-out',
|
| 352 |
-
once: true
|
| 353 |
});
|
| 354 |
-
|
| 355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
</body>
|
| 357 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="id">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Beautify HTML - Versi Gabungan</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify-html.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
</head>
|
| 10 |
+
<body class="bg-gray-100 min-h-screen flex items-center justify-center p-6 font-sans">
|
| 11 |
+
|
| 12 |
+
<div class="w-full max-w-6xl bg-white rounded-xl shadow-xl border border-gray-200">
|
| 13 |
+
<!-- Header -->
|
| 14 |
+
<div class="bg-gradient-to-r from-blue-600 to-blue-500 text-white px-6 py-4 rounded-t-xl">
|
| 15 |
+
<h1 class="text-2xl font-bold">🤖 HTML Beautifier & Cleaner</h1>
|
| 16 |
+
<p class="text-sm opacity-90">Versi gabungan Tailwind + gaya ala BeautifyTools</p>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
<!-- Tombol aksi -->
|
| 20 |
+
<div class="p-4 flex flex-wrap gap-3 border-b border-gray-200 bg-gray-50">
|
| 21 |
+
<button onclick="perbaikiHtml()"
|
| 22 |
+
class="px-4 py-2 bg-blue-600 text-white rounded-lg shadow hover:bg-blue-700 transition">
|
| 23 |
+
Perbaiki
|
| 24 |
+
</button>
|
| 25 |
+
<button onclick="beautifyHtml()"
|
| 26 |
+
class="px-4 py-2 bg-purple-600 text-white rounded-lg shadow hover:bg-purple-700 transition">
|
| 27 |
+
Beautify
|
| 28 |
+
</button>
|
| 29 |
+
<button onclick="copyOutput()"
|
| 30 |
+
class="px-4 py-2 bg-green-600 text-white rounded-lg shadow hover:bg-green-700 transition">
|
| 31 |
+
Copy
|
| 32 |
+
</button>
|
| 33 |
+
<button onclick="reviewOutput()"
|
| 34 |
+
class="px-4 py-2 bg-yellow-500 text-white rounded-lg shadow hover:bg-yellow-600 transition">
|
| 35 |
+
Preview
|
| 36 |
+
</button>
|
| 37 |
+
<button onclick="clearInput()"
|
| 38 |
+
class="px-4 py-2 bg-red-600 text-white rounded-lg shadow hover:bg-red-700 transition">
|
| 39 |
+
Clear
|
| 40 |
+
</button>
|
| 41 |
+
|
| 42 |
+
</div>
|
| 43 |
+
|
| 44 |
+
<!-- Tabs -->
|
| 45 |
+
<div class="px-6 pt-4">
|
| 46 |
+
<div class="flex space-x-2 border-b border-gray-200">
|
| 47 |
+
<button id="tab-input"
|
| 48 |
+
class="tab-btn px-4 py-2 font-medium border-b-2 border-blue-600 text-blue-600 bg-white rounded-t-lg">
|
| 49 |
+
Input
|
| 50 |
+
</button>
|
| 51 |
+
<button id="tab-output"
|
| 52 |
+
class="tab-btn px-4 py-2 font-medium border-b-2 border-transparent text-gray-600 hover:text-blue-600">
|
| 53 |
+
Hasil Script
|
| 54 |
+
</button>
|
| 55 |
+
<button id="tab-preview"
|
| 56 |
+
class="tab-btn px-4 py-2 font-medium border-b-2 border-transparent text-gray-600 hover:text-blue-600">
|
| 57 |
+
Live Preview
|
| 58 |
+
</button>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
<!-- Panels -->
|
| 63 |
+
<div class="p-6">
|
| 64 |
+
<!-- Input -->
|
| 65 |
+
<div id="panel-input" class="tab-panel">
|
| 66 |
+
<textarea id="inputHtml"
|
| 67 |
+
class="w-full h-72 p-3 border rounded-lg shadow-inner font-mono text-sm focus:ring focus:ring-blue-300"
|
| 68 |
+
placeholder="<h1>Halo Dunia"></textarea>
|
| 69 |
+
</div>
|
| 70 |
+
|
| 71 |
+
<!-- Output -->
|
| 72 |
+
<div id="panel-output" class="tab-panel hidden">
|
| 73 |
+
<textarea id="outputHtml"
|
| 74 |
+
class="w-full h-96 p-3 border rounded-lg shadow-inner bg-gray-50 font-mono text-sm"
|
| 75 |
+
readonly></textarea>
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<!-- Preview -->
|
| 79 |
+
<div id="panel-preview" class="tab-panel hidden">
|
| 80 |
+
<iframe id="previewFrame"
|
| 81 |
+
class="w-full h-96 border rounded-lg shadow bg-white"></iframe>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<script>
|
| 87 |
+
// Tab system
|
| 88 |
+
const tabs = ["input", "output", "preview"];
|
| 89 |
+
function switchTab(name) {
|
| 90 |
+
tabs.forEach(t => {
|
| 91 |
+
const btn = document.getElementById(`tab-${t}`);
|
| 92 |
+
const panel = document.getElementById(`panel-${t}`);
|
| 93 |
+
if (t === name) {
|
| 94 |
+
btn.classList.add("border-blue-600","text-blue-600","bg-white","rounded-t-lg");
|
| 95 |
+
btn.classList.remove("border-transparent","text-gray-600");
|
| 96 |
+
panel.classList.remove("hidden");
|
| 97 |
+
} else {
|
| 98 |
+
btn.classList.remove("border-blue-600","text-blue-600","bg-white","rounded-t-lg");
|
| 99 |
+
btn.classList.add("border-transparent","text-gray-600");
|
| 100 |
+
panel.classList.add("hidden");
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
}
|
| 104 |
+
switchTab("input");
|
| 105 |
+
|
| 106 |
+
document.getElementById("tab-input").addEventListener("click", () => switchTab("input"));
|
| 107 |
+
document.getElementById("tab-output").addEventListener("click", () => switchTab("output"));
|
| 108 |
+
document.getElementById("tab-preview").addEventListener("click", () => { ensurePreview(); switchTab("preview"); });
|
| 109 |
+
|
| 110 |
+
// Logic utama
|
| 111 |
+
function perbaikiHtml() {
|
| 112 |
+
const input = document.getElementById("inputHtml").value.trim();
|
| 113 |
+
const parser = new DOMParser();
|
| 114 |
+
const doc = parser.parseFromString(input || "<!DOCTYPE html><html><head></head><body></body></html>", "text/html");
|
| 115 |
+
|
| 116 |
+
let cleaned = "<!DOCTYPE html>\n" + doc.documentElement.outerHTML;
|
| 117 |
+
|
| 118 |
+
const needs = [];
|
| 119 |
+
if (!doc.querySelector("meta[charset]")) needs.push(" <meta charset='UTF-8'>");
|
| 120 |
+
if (!doc.querySelector("meta[name='viewport']")) needs.push(" <meta name='viewport' content='width=device-width, initial-scale=1.0'>");
|
| 121 |
+
if (!doc.querySelector("title")) needs.push(" <title>DokumenBaru</title>");
|
| 122 |
+
if (needs.length) cleaned = cleaned.replace("</head>", needs.join("\n") + "\n</head>");
|
| 123 |
+
|
| 124 |
+
document.getElementById("outputHtml").value = html_beautify(cleaned, {
|
| 125 |
+
indent_size: 2,
|
| 126 |
+
wrap_line_length: 100,
|
| 127 |
+
preserve_newlines: true
|
| 128 |
+
});
|
| 129 |
+
switchTab("output");
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
function beautifyHtml() {
|
| 133 |
+
const output = document.getElementById("outputHtml");
|
| 134 |
+
if (!output.value.trim()) {
|
| 135 |
+
alert("⚠️ Tidak ada hasil untuk Beautify. Klik Perbaiki dulu!");
|
| 136 |
+
return;
|
| 137 |
+
}
|
| 138 |
+
const beautified = html_beautify(output.value, {
|
| 139 |
+
indent_size: 2,
|
| 140 |
+
wrap_line_length: 100,
|
| 141 |
+
preserve_newlines: true
|
| 142 |
+
});
|
| 143 |
+
output.value = beautified;
|
| 144 |
+
switchTab("output");
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
function copyOutput() {
|
| 148 |
+
const output = document.getElementById("outputHtml");
|
| 149 |
+
if (!output.value.trim()) {
|
| 150 |
+
alert("⚠️ Tidak ada hasil untuk dicopy. Klik Perbaiki dulu!");
|
| 151 |
+
return;
|
| 152 |
+
}
|
| 153 |
+
navigator.clipboard.writeText(output.value)
|
| 154 |
+
.then(() => alert("✅ Script HTML berhasil dicopy!"))
|
| 155 |
+
.catch(() => {
|
| 156 |
+
output.select();
|
| 157 |
+
document.execCommand("copy");
|
| 158 |
+
alert("✅ Script HTML berhasil dicopy (fallback)!");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
});
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
function ensurePreview() {
|
| 163 |
+
const output = document.getElementById("outputHtml").value.trim();
|
| 164 |
+
const iframe = document.getElementById("previewFrame");
|
| 165 |
+
if (output) {
|
| 166 |
+
iframe.srcdoc = output;
|
| 167 |
+
} else {
|
| 168 |
+
const raw = document.getElementById("inputHtml").value.trim();
|
| 169 |
+
iframe.srcdoc = raw || "<h3 style='font-family:sans-serif'>Tidak ada konten untuk dipreview</h3>";
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
function reviewOutput() {
|
| 174 |
+
ensurePreview();
|
| 175 |
+
switchTab("preview");
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
function clearInput() {
|
| 179 |
+
document.getElementById("inputHtml").value = "";
|
| 180 |
+
document.getElementById("outputHtml").value = "";
|
| 181 |
+
switchTab("input");
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
function downloadOutput() {
|
| 185 |
+
const output = document.getElementById("outputHtml").value;
|
| 186 |
+
if (!output.trim()) {
|
| 187 |
+
alert("⚠️ Tidak ada hasil untuk diunduh.");
|
| 188 |
+
return;
|
| 189 |
+
}
|
| 190 |
+
const blob = new Blob([output], { type: "text/html" });
|
| 191 |
+
const url = URL.createObjectURL(blob);
|
| 192 |
+
const a = document.createElement("a");
|
| 193 |
+
a.href = url;
|
| 194 |
+
a.download = "hasil.html";
|
| 195 |
+
a.click();
|
| 196 |
+
URL.revokeObjectURL(url);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
// Auto focus ke textarea input saat load
|
| 200 |
+
window.onload = () => document.getElementById("inputHtml").focus();
|
| 201 |
+
</script>
|
| 202 |
+
|
| 203 |
</body>
|
| 204 |
</html>
|