Spaces:
Running
Running
Fix responsive layout
Browse files- .gitignore +13 -0
- frontend/about.html +120 -130
- frontend/index.html +62 -62
- papua-lora-ckpt-168 +0 -1
.gitignore
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
.venv/
|
| 4 |
+
env/
|
| 5 |
+
.vscode/
|
| 6 |
+
# model/artefak besar – jangan dipush
|
| 7 |
+
*.pt
|
| 8 |
+
*.ckpt
|
| 9 |
+
*.safetensors
|
| 10 |
+
*.bin
|
| 11 |
+
*.onnx
|
| 12 |
+
/tmp/
|
| 13 |
+
papua-lora-ckpt-168/
|
frontend/about.html
CHANGED
|
@@ -2,160 +2,150 @@
|
|
| 2 |
<html lang="id">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8"/>
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1
|
| 6 |
<title>Tentang — PapuaTranslate</title>
|
| 7 |
<style>
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
nav
|
| 17 |
-
|
| 18 |
-
.
|
| 19 |
-
.
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
.label{color:#666}
|
| 24 |
.value{color:#111}
|
| 25 |
-
.title{font-size:18px;font-weight:800;margin-bottom:8px}
|
| 26 |
-
footer{background:#fff;color:#000;padding:20px 0;border-top:1px solid #eee;margin-top:20px;text-align:center;font-size:13px}
|
| 27 |
|
| 28 |
-
.team
|
| 29 |
-
.
|
| 30 |
-
.
|
| 31 |
-
.
|
| 32 |
-
.
|
| 33 |
-
.
|
| 34 |
-
.
|
| 35 |
|
| 36 |
/* Modal */
|
| 37 |
-
.modal{display:none;position:fixed;z-index:1000;
|
| 38 |
-
.modal
|
| 39 |
-
.modal
|
| 40 |
-
.close{position:absolute;top:
|
| 41 |
-
.close:hover{color:#ccc}
|
| 42 |
|
| 43 |
-
@media (max-width:
|
|
|
|
| 44 |
.meta{grid-template-columns:1fr}
|
| 45 |
-
.
|
| 46 |
}
|
|
|
|
| 47 |
</style>
|
| 48 |
</head>
|
| 49 |
<body>
|
| 50 |
-
<header>
|
| 51 |
-
<div class="container hc">
|
| 52 |
-
<div class="logo"><h1>PapuaTranslate</h1></div>
|
| 53 |
-
<nav>
|
| 54 |
-
<ul>
|
| 55 |
-
<li><a href="/">Beranda</a></li>
|
| 56 |
-
<li><a href="/about">About</a></li>
|
| 57 |
-
<li><a href="/#history">History</a></li>
|
| 58 |
-
</ul>
|
| 59 |
-
</nav>
|
| 60 |
-
</div>
|
| 61 |
-
</header>
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
</div>
|
|
|
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
onerror="this.style.display='none'; this.parentNode.innerHTML='<div style="color:#999;font-size:14px;">Foto Tidak Ditemukan</div>';"/>
|
| 89 |
-
</div>
|
| 90 |
-
<div class="member-name">Amos Valentino Nababan</div>
|
| 91 |
-
<div class="member-role">Pembuat</div>
|
| 92 |
</div>
|
| 93 |
-
|
| 94 |
-
<div class="
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
</div>
|
| 99 |
-
<div class="member-name">Viny Christanti Mawardi, S.Kom., M.Kom.</div>
|
| 100 |
-
<div class="member-role">Dosen Pembimbing</div>
|
| 101 |
</div>
|
| 102 |
-
|
| 103 |
-
<div class="
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
</div>
|
| 108 |
-
<div class="member-name">Manatap Dolok Lauro, S.Kom., M.M.S.I.</div>
|
| 109 |
-
<div class="member-role">Dosen Pendamping</div>
|
| 110 |
</div>
|
|
|
|
|
|
|
| 111 |
</div>
|
| 112 |
</div>
|
|
|
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
</p>
|
| 120 |
-
</div>
|
| 121 |
-
</main>
|
| 122 |
-
|
| 123 |
-
<footer>
|
| 124 |
-
<div class="container">© 2025 PapuaTranslate • Halaman About</div>
|
| 125 |
-
</footer>
|
| 126 |
-
|
| 127 |
-
<!-- Modal Pop-up -->
|
| 128 |
-
<div id="modal1" class="modal">
|
| 129 |
-
<span class="close" onclick="closeModal('modal1')">×</span>
|
| 130 |
-
<img class="modal-content" src="{{ url_for('static', filename='image/pembuat.jpg') }}" alt="Amos Valentino Nababan">
|
| 131 |
-
<div class="modal-caption">Amos Valentino Nababan — Pembuat</div>
|
| 132 |
-
</div>
|
| 133 |
-
|
| 134 |
-
<div id="modal2" class="modal">
|
| 135 |
-
<span class="close" onclick="closeModal('modal2')">×</span>
|
| 136 |
-
<img class="modal-content" src="{{ url_for('static', filename='image/dosen1.jpg') }}" alt="Viny Christanti Mawardi">
|
| 137 |
-
<div class="modal-caption">Viny Christanti Mawardi, S.Kom., M.Kom.</div>
|
| 138 |
-
</div>
|
| 139 |
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
<div class="modal-caption">Manatap Dolok Lauro, S.Kom., M.M.S.I.</div>
|
| 144 |
</div>
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
</body>
|
| 161 |
</html>
|
|
|
|
| 2 |
<html lang="id">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8"/>
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
|
| 6 |
<title>Tentang — PapuaTranslate</title>
|
| 7 |
<style>
|
| 8 |
+
:root{
|
| 9 |
+
--bg:#f6f7f9; --card:#fff; --ink:#111; --sub:#666; --line:#e9ecef;
|
| 10 |
+
--shadow:0 8px 24px rgba(0,0,0,.08); --radius:14px; --pad:clamp(12px,2.5vw,20px); --maxw:1120px;
|
| 11 |
+
}
|
| 12 |
+
*{box-sizing:border-box}
|
| 13 |
+
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Noto Sans,Arial,sans-serif;color:var(--ink);background:var(--bg);line-height:1.6}
|
| 14 |
+
|
| 15 |
+
header{position:sticky;top:0;z-index:30;background:var(--card);box-shadow:0 4px 16px rgba(0,0,0,.06)}
|
| 16 |
+
.nav{max-width:var(--maxw);margin:auto;display:flex;align-items:center;justify-content:space-between;padding:var(--pad)}
|
| 17 |
+
.logo{font-weight:800;font-size:clamp(18px,4vw,22px)}
|
| 18 |
+
.menu{display:flex;gap:8px;flex-wrap:wrap}
|
| 19 |
+
.pill{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border:1px solid var(--ink);border-radius:999px;min-height:42px}
|
| 20 |
+
.pill:hover{background:var(--ink);color:#fff}
|
| 21 |
+
|
| 22 |
+
.hero{background:var(--card);border-bottom:1px solid var(--line)}
|
| 23 |
+
.hero-inner{max-width:var(--maxw);margin:auto;text-align:center;padding:clamp(18px,6vw,30px) var(--pad)}
|
| 24 |
+
.hero h2{margin:0 0 6px;font-size:clamp(20px,6vw,28px)}
|
| 25 |
+
.hero p{margin:0;color:var(--sub)}
|
| 26 |
+
|
| 27 |
+
.wrap{max-width:var(--maxw);margin:auto;padding:var(--pad)}
|
| 28 |
+
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:var(--pad);margin-bottom:clamp(12px,2vw,16px)}
|
| 29 |
+
.title{font-weight:800;margin:0 0 8px;font-size:clamp(16px,4.5vw,18px)}
|
| 30 |
+
.meta{display:grid;grid-template-columns:minmax(120px,160px) 1fr;gap:8px;margin-top:8px}
|
| 31 |
.label{color:#666}
|
| 32 |
.value{color:#111}
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
.team{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(12px,2.4vw,18px)}
|
| 35 |
+
.member{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 14px rgba(0,0,0,.06);padding:clamp(12px,2.2vw,18px);text-align:center}
|
| 36 |
+
.avatar{width:clamp(120px,28vw,160px);height:clamp(120px,28vw,160px);border-radius:50%;margin-inline:auto 10px auto;display:flex;align-items:center;justify-content:center;overflow:hidden;border:2px solid #ddd;cursor:pointer;transition:transform .2s}
|
| 37 |
+
.avatar:hover{transform:scale(1.03)}
|
| 38 |
+
.avatar img{width:100%;height:100%;object-fit:cover}
|
| 39 |
+
.m-name{font-weight:800;margin-top:8px}
|
| 40 |
+
.m-role{color:#666;font-size:clamp(12px,3.3vw,14px)}
|
| 41 |
|
| 42 |
/* Modal */
|
| 43 |
+
.modal{display:none;position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.8)}
|
| 44 |
+
.modal img{display:block;margin:auto;max-width:86vw;max-height:86vh;border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.35)}
|
| 45 |
+
.modal .caption{color:#fff;text-align:center;padding:8px;font-size:clamp(12px,3.2vw,16px)}
|
| 46 |
+
.close{position:absolute;top:14px;right:18px;color:#fff;font-size:34px;font-weight:800;cursor:pointer}
|
|
|
|
| 47 |
|
| 48 |
+
@media (max-width:900px){ .team{grid-template-columns:repeat(2,1fr)} }
|
| 49 |
+
@media (max-width:600px){
|
| 50 |
.meta{grid-template-columns:1fr}
|
| 51 |
+
.team{grid-template-columns:1fr}
|
| 52 |
}
|
| 53 |
+
body{padding-bottom:env(safe-area-inset-bottom)}
|
| 54 |
</style>
|
| 55 |
</head>
|
| 56 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
<header>
|
| 59 |
+
<div class="nav" role="navigation" aria-label="Menu about">
|
| 60 |
+
<div class="logo">PapuaTranslate</div>
|
| 61 |
+
<nav class="menu">
|
| 62 |
+
<a class="pill" href="/">Beranda</a>
|
| 63 |
+
<a class="pill" href="/about">About</a>
|
| 64 |
+
<a class="pill" href="/#history">History</a>
|
| 65 |
+
</nav>
|
| 66 |
+
</div>
|
| 67 |
+
</header>
|
| 68 |
|
| 69 |
+
<section class="hero">
|
| 70 |
+
<div class="hero-inner">
|
| 71 |
+
<h2>Tentang Proyek</h2>
|
| 72 |
+
<p>Informasi singkat mengenai skripsi & pembimbing.</p>
|
| 73 |
+
</div>
|
| 74 |
+
</section>
|
| 75 |
+
|
| 76 |
+
<main class="wrap">
|
| 77 |
+
<section class="card">
|
| 78 |
+
<h3 class="title">Judul Skripsi</h3>
|
| 79 |
+
<p><b>Penerapan Causal Encoder Decoder Natural Language Instructions in Indonesian (CENDOL) untuk Translasi Bahasa Papua ke Bahasa Indonesia Baku</b></p>
|
| 80 |
+
<div class="meta" style="margin-top:10px">
|
| 81 |
+
<div class="label">Dosen Pembimbing</div><div class="value">Viny Christanti Mawardi, S.Kom., M.Kom.</div>
|
| 82 |
+
<div class="label">Dosen Pendamping</div><div class="value">Manatap Dolok Lauro, S.Kom., M.M.S.I.</div>
|
| 83 |
+
<div class="label">Program/Kampus</div><div class="value">Teknik Informatika, Universitas Tarumanagara</div>
|
| 84 |
+
<div class="label">Tahun</div><div class="value">2025</div>
|
| 85 |
</div>
|
| 86 |
+
</section>
|
| 87 |
|
| 88 |
+
<section class="card">
|
| 89 |
+
<h3 class="title">Tim Pengembang</h3>
|
| 90 |
+
<div class="team">
|
| 91 |
+
<div class="member">
|
| 92 |
+
<div class="avatar" onclick="openModal('m1')">
|
| 93 |
+
<img src="{{ url_for('static', filename='image/pembuat.jpg') }}" alt="Amos Valentino Nababan" onerror="this.style.display='none'; this.parentNode.innerHTML='<div style="color:#999">Foto Tidak Ditemukan</div>'"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
</div>
|
| 95 |
+
<div class="m-name">Amos Valentino Nababan</div>
|
| 96 |
+
<div class="m-role">Pembuat</div>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="member">
|
| 99 |
+
<div class="avatar" onclick="openModal('m2')">
|
| 100 |
+
<img src="{{ url_for('static', filename='image/dosen1.jpg') }}" alt="Viny Christanti Mawardi" onerror="this.style.display='none'; this.parentNode.innerHTML='<div style="color:#999">Foto Tidak Ditemukan</div>'"/>
|
|
|
|
|
|
|
| 101 |
</div>
|
| 102 |
+
<div class="m-name">Viny Christanti Mawardi, S.Kom., M.Kom.</div>
|
| 103 |
+
<div class="m-role">Dosen Pembimbing</div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="member">
|
| 106 |
+
<div class="avatar" onclick="openModal('m3')">
|
| 107 |
+
<img src="{{ url_for('static', filename='image/dosen2.jpg') }}" alt="Manatap Dolok Lauro" onerror="this.style.display='none'; this.parentNode.innerHTML='<div style="color:#999">Foto Tidak Ditemukan</div>'"/>
|
|
|
|
|
|
|
| 108 |
</div>
|
| 109 |
+
<div class="m-name">Manatap Dolok Lauro, S.Kom., M.M.S.I.</div>
|
| 110 |
+
<div class="m-role">Dosen Pendamping</div>
|
| 111 |
</div>
|
| 112 |
</div>
|
| 113 |
+
</section>
|
| 114 |
|
| 115 |
+
<section class="card">
|
| 116 |
+
<h3 class="title">Deskripsi Singkat</h3>
|
| 117 |
+
<p>Aplikasi ini menerapkan arsitektur <i>Causal Encoder-Decoder</i> (CENDOL) berbasis mT5 dengan LoRA Adapter untuk translasi dialek Papua ke Bahasa Indonesia baku.</p>
|
| 118 |
+
</section>
|
| 119 |
+
</main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
+
<footer>
|
| 122 |
+
<div class="wrap" style="text-align:center;padding-top:8px;border-top:1px solid var(--line)">
|
| 123 |
+
© 2025 PapuaTranslate • Halaman About
|
|
|
|
| 124 |
</div>
|
| 125 |
+
</footer>
|
| 126 |
+
|
| 127 |
+
<!-- Modals -->
|
| 128 |
+
<div id="m1" class="modal" role="dialog" aria-modal="true" aria-label="Foto Amos">
|
| 129 |
+
<span class="close" onclick="closeModal('m1')">×</span>
|
| 130 |
+
<img src="{{ url_for('static', filename='image/pembuat.jpg') }}" alt="Amos Valentino Nababan">
|
| 131 |
+
<div class="caption">Amos Valentino Nababan — Pembuat</div>
|
| 132 |
+
</div>
|
| 133 |
+
<div id="m2" class="modal" role="dialog" aria-modal="true" aria-label="Foto Viny">
|
| 134 |
+
<span class="close" onclick="closeModal('m2')">×</span>
|
| 135 |
+
<img src="{{ url_for('static', filename='image/dosen1.jpg') }}" alt="Viny Christanti Mawardi">
|
| 136 |
+
<div class="caption">Viny Christanti Mawardi, S.Kom., M.Kom.</div>
|
| 137 |
+
</div>
|
| 138 |
+
<div id="m3" class="modal" role="dialog" aria-modal="true" aria-label="Foto Manatap">
|
| 139 |
+
<span class="close" onclick="closeModal('m3')">×</span>
|
| 140 |
+
<img src="{{ url_for('static', filename='image/dosen2.jpg') }}" alt="Manatap Dolok Lauro">
|
| 141 |
+
<div class="caption">Manatap Dolok Lauro, S.Kom., M.M.S.I.</div>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
<script>
|
| 145 |
+
function openModal(id){ document.getElementById(id).style.display = 'block'; }
|
| 146 |
+
function closeModal(id){ document.getElementById(id).style.display = 'none'; }
|
| 147 |
+
window.addEventListener('keydown', e => { if (e.key === 'Escape') ['m1','m2','m3'].forEach(closeModal) });
|
| 148 |
+
window.addEventListener('click', e => { if (e.target.classList.contains('modal')) e.target.style.display='none'; });
|
| 149 |
+
</script>
|
| 150 |
</body>
|
| 151 |
</html>
|
frontend/index.html
CHANGED
|
@@ -9,90 +9,83 @@
|
|
| 9 |
:root{
|
| 10 |
--bg:#f6f7f9; --card:#fff; --ink:#111; --sub:#666; --line:#e9ecef;
|
| 11 |
--shadow:0 8px 24px rgba(0,0,0,.08); --brand:#000; --brand-ink:#fff;
|
|
|
|
|
|
|
| 12 |
}
|
| 13 |
*{box-sizing:border-box}
|
| 14 |
-
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,
|
| 15 |
-
|
| 16 |
/* Header */
|
| 17 |
header{position:sticky;top:0;z-index:50;background:var(--card);box-shadow:0 4px 16px rgba(0,0,0,.06)}
|
| 18 |
-
.nav{max-width:
|
| 19 |
-
.logo{font-weight:800;font-size:clamp(18px,
|
| 20 |
-
.menu{display:flex;gap:
|
| 21 |
-
.pill{display:inline-
|
| 22 |
.pill:hover{background:var(--ink);color:#fff}
|
| 23 |
-
.badge{background:#000;color:#fff;border-radius:999px;padding:
|
| 24 |
-
.spacer{flex:1}
|
| 25 |
|
| 26 |
/* Hero */
|
| 27 |
.hero{border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--card)}
|
| 28 |
-
.hero-inner{max-width:
|
| 29 |
-
.hero h1{margin:0 0 6px;font-size:clamp(
|
| 30 |
-
.hero p{margin:0;color:var(--sub)}
|
| 31 |
-
|
| 32 |
-
/* Main
|
| 33 |
-
.wrap{max-width:
|
| 34 |
-
.card{background:var(--card);border:1px solid var(--line);border-radius:
|
| 35 |
-
.card-pad{padding:
|
| 36 |
-
.title{margin:0 0 12px;text-align:center;font-size:clamp(16px,
|
| 37 |
-
|
| 38 |
-
/* Translator
|
| 39 |
-
.input-group{margin-bottom:
|
| 40 |
-
.lbl{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;color:#222;font-weight:
|
| 41 |
-
.hint{font-size:
|
| 42 |
textarea{
|
| 43 |
-
width:100%;min-height:
|
| 44 |
-
padding:14px 12px;font-size:16px;background:#fafafa;outline:none;transition:border .2s,background .2s;
|
| 45 |
}
|
| 46 |
textarea:focus{border-color:#555;background:#fff}
|
| 47 |
.btn{
|
| 48 |
-
width:100%;display:inline-flex;align-items:center;justify-content:center;gap:
|
| 49 |
-
padding:14px
|
| 50 |
-
font-weight:
|
| 51 |
}
|
| 52 |
-
.btn
|
| 53 |
-
.
|
| 54 |
-
|
| 55 |
-
.result{
|
| 56 |
-
.
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
.history{margin-top:18px}
|
| 62 |
-
.list{margin:0;padding-left:18px}
|
| 63 |
.list li{margin-bottom:6px}
|
| 64 |
|
| 65 |
/* Footer */
|
| 66 |
-
footer{margin-top:
|
| 67 |
-
.foot{max-width:
|
| 68 |
-
.copy{font-size:12px;color:var(--sub)}
|
| 69 |
-
|
| 70 |
-
/* Mobile tweaks */
|
| 71 |
-
@media (max-width: 680px){
|
| 72 |
-
.nav{padding:12px 14px}
|
| 73 |
-
.hero-inner{padding:22px 14px 16px}
|
| 74 |
-
.wrap{padding:14px}
|
| 75 |
-
}
|
| 76 |
body{padding-bottom:env(safe-area-inset-bottom)}
|
| 77 |
</style>
|
| 78 |
</head>
|
| 79 |
<body>
|
| 80 |
|
| 81 |
<header>
|
| 82 |
-
<div class="nav">
|
| 83 |
<div class="logo">PapuaTranslate</div>
|
| 84 |
-
<
|
| 85 |
<a class="pill" href="/">Home</a>
|
| 86 |
<a class="pill" href="/about">About</a>
|
| 87 |
<a class="pill" href="/#history">History</a>
|
| 88 |
{% if logged_in %}
|
| 89 |
-
<span class="badge">Aktif</span>
|
| 90 |
<a class="pill" href="/logout">Logout</a>
|
| 91 |
{% else %}
|
| 92 |
<a class="pill" href="/login">Login</a>
|
| 93 |
<a class="pill" href="/register">Daftar</a>
|
| 94 |
{% endif %}
|
| 95 |
-
</
|
| 96 |
</div>
|
| 97 |
</header>
|
| 98 |
|
|
@@ -110,23 +103,23 @@
|
|
| 110 |
|
| 111 |
<div class="input-group">
|
| 112 |
<div class="lbl">
|
| 113 |
-
<
|
| 114 |
<span class="hint">Masukkan teks berlogat Papua</span>
|
| 115 |
</div>
|
| 116 |
-
<textarea id="papua-input" placeholder="Contoh: 'ko su makan' → 'Kamu sudah makan.'"></textarea>
|
| 117 |
</div>
|
| 118 |
|
| 119 |
-
<button class="btn" id="translate-btn" onclick="translateText()">
|
| 120 |
<span id="btn-text">Terjemahkan</span>
|
| 121 |
<span id="btn-spin" aria-hidden="true" style="display:none">⏳</span>
|
| 122 |
</button>
|
| 123 |
|
| 124 |
-
<div class="input-group" style="margin-top:
|
| 125 |
<div class="lbl">
|
| 126 |
-
<
|
| 127 |
<span class="hint">Hasil terjemahan</span>
|
| 128 |
</div>
|
| 129 |
-
<div class="result">
|
| 130 |
<h4>Terjemahan:</h4>
|
| 131 |
<div id="indonesia-output" class="result-text">Hasil terjemahan akan ditampilkan di sini…</div>
|
| 132 |
</div>
|
|
@@ -135,7 +128,7 @@
|
|
| 135 |
</section>
|
| 136 |
|
| 137 |
<!-- History under translator -->
|
| 138 |
-
<section class="card card-pad history" id="history">
|
| 139 |
<h2 class="title">Riwayat Terakhir</h2>
|
| 140 |
<ul class="list" id="history-list">
|
| 141 |
{% for it in recent %}
|
|
@@ -155,6 +148,11 @@
|
|
| 155 |
</footer>
|
| 156 |
|
| 157 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
async function translateText() {
|
| 159 |
const input = document.getElementById('papua-input');
|
| 160 |
const out = document.getElementById('indonesia-output');
|
|
@@ -163,7 +161,7 @@
|
|
| 163 |
const btnSpin = document.getElementById('btn-spin');
|
| 164 |
|
| 165 |
const text = input.value.trim();
|
| 166 |
-
if (!text) { out.textContent = "Silakan masukkan teks logat Papua."; return; }
|
| 167 |
|
| 168 |
out.textContent = "Menerjemahkan…";
|
| 169 |
btn.disabled = true; btnText.style.display='none'; btnSpin.style.display='inline';
|
|
@@ -172,13 +170,15 @@
|
|
| 172 |
const r = await fetch('/translate', {
|
| 173 |
method: 'POST',
|
| 174 |
headers: {'Content-Type':'application/json'},
|
| 175 |
-
credentials: 'same-origin',
|
| 176 |
body: JSON.stringify({ text, max_new_tokens: 24 })
|
| 177 |
});
|
| 178 |
const data = await r.json();
|
| 179 |
if (r.ok && data && (data.mt || data.result)) {
|
| 180 |
out.textContent = data.mt || data.result;
|
| 181 |
loadHistory();
|
|
|
|
|
|
|
| 182 |
} else {
|
| 183 |
out.textContent = 'Error: ' + ((data && (data.error || data.detail)) || 'Terjadi kesalahan.');
|
| 184 |
}
|
|
@@ -209,7 +209,7 @@
|
|
| 209 |
}
|
| 210 |
|
| 211 |
// Ctrl/Cmd + Enter shortcut
|
| 212 |
-
|
| 213 |
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) translateText();
|
| 214 |
});
|
| 215 |
</script>
|
|
|
|
| 9 |
:root{
|
| 10 |
--bg:#f6f7f9; --card:#fff; --ink:#111; --sub:#666; --line:#e9ecef;
|
| 11 |
--shadow:0 8px 24px rgba(0,0,0,.08); --brand:#000; --brand-ink:#fff;
|
| 12 |
+
--radius:14px; --gap:clamp(12px,2vw,20px); --pad:clamp(12px,2.5vw,20px);
|
| 13 |
+
--maxw:1120px; --fx:clamp(14px,2.6vw,16px);
|
| 14 |
}
|
| 15 |
*{box-sizing:border-box}
|
| 16 |
+
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Noto Sans,Arial,sans-serif;color:var(--ink);background:var(--bg);line-height:1.6;font-size:var(--fx)}
|
| 17 |
+
a{color:inherit;text-decoration:none}
|
| 18 |
/* Header */
|
| 19 |
header{position:sticky;top:0;z-index:50;background:var(--card);box-shadow:0 4px 16px rgba(0,0,0,.06)}
|
| 20 |
+
.nav{max-width:var(--maxw);margin:auto;display:flex;align-items:center;gap:10px;justify-content:space-between;padding:var(--pad)}
|
| 21 |
+
.logo{font-weight:800;font-size:clamp(18px,4vw,24px)}
|
| 22 |
+
.menu{display:flex;gap:8px;flex-wrap:wrap}
|
| 23 |
+
.pill{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border:1px solid var(--ink);border-radius:999px;min-height:42px}
|
| 24 |
.pill:hover{background:var(--ink);color:#fff}
|
| 25 |
+
.badge{background:#000;color:#fff;border-radius:999px;padding:6px 12px;font-size:12px}
|
|
|
|
| 26 |
|
| 27 |
/* Hero */
|
| 28 |
.hero{border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--card)}
|
| 29 |
+
.hero-inner{max-width:var(--maxw);margin:auto;text-align:center;padding:clamp(16px,6vw,30px) var(--pad)}
|
| 30 |
+
.hero h1{margin:0 0 6px;font-size:clamp(20px,6vw,32px)}
|
| 31 |
+
.hero p{margin:0;color:var(--sub);font-size:clamp(13px,3.5vw,15px)}
|
| 32 |
+
|
| 33 |
+
/* Main */
|
| 34 |
+
.wrap{max-width:var(--maxw);margin:auto;padding:var(--pad)}
|
| 35 |
+
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
|
| 36 |
+
.card-pad{padding:var(--pad)}
|
| 37 |
+
.title{margin:0 0 12px;text-align:center;font-weight:800;font-size:clamp(16px,4.5vw,20px)}
|
| 38 |
+
|
| 39 |
+
/* Translator full width */
|
| 40 |
+
.input-group{margin-bottom:12px}
|
| 41 |
+
.lbl{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;color:#222;font-weight:700;font-size:clamp(13px,3.6vw,15px)}
|
| 42 |
+
.hint{font-size:clamp(11px,3.2vw,13px);color:var(--sub);margin-left:8px}
|
| 43 |
textarea{
|
| 44 |
+
width:100%;min-height:clamp(140px,30vh,220px);resize:vertical;border:1px solid #ddd;border-radius:12px;
|
| 45 |
+
padding:14px 12px;font-size:clamp(14px,3.6vw,16px);background:#fafafa;outline:none;transition:border .2s,background .2s;
|
| 46 |
}
|
| 47 |
textarea:focus{border-color:#555;background:#fff}
|
| 48 |
.btn{
|
| 49 |
+
width:100%;display:inline-flex;align-items:center;justify-content:center;gap:10px;
|
| 50 |
+
padding:clamp(12px,3.5vw,14px);border:none;border-radius:12px;background:var(--brand);color:var(--brand-ink);
|
| 51 |
+
font-weight:900;cursor:pointer;touch-action:manipulation;min-height:48px;
|
| 52 |
}
|
| 53 |
+
.btn[disabled]{opacity:.6}
|
| 54 |
+
.result{border:1px solid var(--line);background:#fafafa;border-radius:12px;padding:14px;min-height:clamp(84px,16vh,120px)}
|
| 55 |
+
.result h4{margin:0 0 6px;font-size:clamp(12px,3.2vw,13px);color:var(--sub)}
|
| 56 |
+
.result-text{font-size:clamp(14px,3.6vw,16px);white-space:pre-wrap;color:#000}
|
| 57 |
+
.note{font-size:clamp(11px,3vw,12px);color:var(--sub);margin-top:8px}
|
| 58 |
+
|
| 59 |
+
/* History under translator */
|
| 60 |
+
.history{margin-top:var(--gap)}
|
| 61 |
+
.list{margin:0;padding-left:20px}
|
|
|
|
|
|
|
| 62 |
.list li{margin-bottom:6px}
|
| 63 |
|
| 64 |
/* Footer */
|
| 65 |
+
footer{margin-top:var(--gap);background:var(--card);border-top:1px solid var(--line)}
|
| 66 |
+
.foot{max-width:var(--maxw);margin:auto;padding:var(--pad);text-align:center}
|
| 67 |
+
.copy{font-size:clamp(11px,3vw,12px);color:var(--sub)}
|
| 68 |
+
/* Safe area iphones */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
body{padding-bottom:env(safe-area-inset-bottom)}
|
| 70 |
</style>
|
| 71 |
</head>
|
| 72 |
<body>
|
| 73 |
|
| 74 |
<header>
|
| 75 |
+
<div class="nav" role="navigation" aria-label="Menu utama">
|
| 76 |
<div class="logo">PapuaTranslate</div>
|
| 77 |
+
<nav class="menu">
|
| 78 |
<a class="pill" href="/">Home</a>
|
| 79 |
<a class="pill" href="/about">About</a>
|
| 80 |
<a class="pill" href="/#history">History</a>
|
| 81 |
{% if logged_in %}
|
| 82 |
+
<span class="badge" aria-label="Status login aktif">Aktif</span>
|
| 83 |
<a class="pill" href="/logout">Logout</a>
|
| 84 |
{% else %}
|
| 85 |
<a class="pill" href="/login">Login</a>
|
| 86 |
<a class="pill" href="/register">Daftar</a>
|
| 87 |
{% endif %}
|
| 88 |
+
</nav>
|
| 89 |
</div>
|
| 90 |
</header>
|
| 91 |
|
|
|
|
| 103 |
|
| 104 |
<div class="input-group">
|
| 105 |
<div class="lbl">
|
| 106 |
+
<label for="papua-input">Bahasa Papua</label>
|
| 107 |
<span class="hint">Masukkan teks berlogat Papua</span>
|
| 108 |
</div>
|
| 109 |
+
<textarea id="papua-input" inputmode="text" autocomplete="off" spellcheck="false" placeholder="Contoh: 'ko su makan' → 'Kamu sudah makan.'"></textarea>
|
| 110 |
</div>
|
| 111 |
|
| 112 |
+
<button class="btn" id="translate-btn" onclick="translateText()" aria-label="Terjemahkan">
|
| 113 |
<span id="btn-text">Terjemahkan</span>
|
| 114 |
<span id="btn-spin" aria-hidden="true" style="display:none">⏳</span>
|
| 115 |
</button>
|
| 116 |
|
| 117 |
+
<div class="input-group" style="margin-top:12px">
|
| 118 |
<div class="lbl">
|
| 119 |
+
<label for="indonesia-output">Bahasa Indonesia Baku</label>
|
| 120 |
<span class="hint">Hasil terjemahan</span>
|
| 121 |
</div>
|
| 122 |
+
<div class="result" id="indonesia-output-wrap">
|
| 123 |
<h4>Terjemahan:</h4>
|
| 124 |
<div id="indonesia-output" class="result-text">Hasil terjemahan akan ditampilkan di sini…</div>
|
| 125 |
</div>
|
|
|
|
| 128 |
</section>
|
| 129 |
|
| 130 |
<!-- History under translator -->
|
| 131 |
+
<section class="card card-pad history" id="history" aria-live="polite">
|
| 132 |
<h2 class="title">Riwayat Terakhir</h2>
|
| 133 |
<ul class="list" id="history-list">
|
| 134 |
{% for it in recent %}
|
|
|
|
| 148 |
</footer>
|
| 149 |
|
| 150 |
<script>
|
| 151 |
+
// Auto-resize textarea (nyaman di HP)
|
| 152 |
+
const ta = document.getElementById('papua-input');
|
| 153 |
+
function autoresize(){ ta.style.height='auto'; ta.style.height=(ta.scrollHeight+6)+'px'; }
|
| 154 |
+
ta.addEventListener('input', autoresize); window.addEventListener('load', autoresize);
|
| 155 |
+
|
| 156 |
async function translateText() {
|
| 157 |
const input = document.getElementById('papua-input');
|
| 158 |
const out = document.getElementById('indonesia-output');
|
|
|
|
| 161 |
const btnSpin = document.getElementById('btn-spin');
|
| 162 |
|
| 163 |
const text = input.value.trim();
|
| 164 |
+
if (!text) { out.textContent = "Silakan masukkan teks logat Papua."; input.focus(); return; }
|
| 165 |
|
| 166 |
out.textContent = "Menerjemahkan…";
|
| 167 |
btn.disabled = true; btnText.style.display='none'; btnSpin.style.display='inline';
|
|
|
|
| 170 |
const r = await fetch('/translate', {
|
| 171 |
method: 'POST',
|
| 172 |
headers: {'Content-Type':'application/json'},
|
| 173 |
+
credentials: 'same-origin',
|
| 174 |
body: JSON.stringify({ text, max_new_tokens: 24 })
|
| 175 |
});
|
| 176 |
const data = await r.json();
|
| 177 |
if (r.ok && data && (data.mt || data.result)) {
|
| 178 |
out.textContent = data.mt || data.result;
|
| 179 |
loadHistory();
|
| 180 |
+
// scroll ke hasil di layar kecil
|
| 181 |
+
if (window.innerWidth < 700) document.getElementById('indonesia-output-wrap').scrollIntoView({behavior:'smooth', block:'center'});
|
| 182 |
} else {
|
| 183 |
out.textContent = 'Error: ' + ((data && (data.error || data.detail)) || 'Terjadi kesalahan.');
|
| 184 |
}
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
// Ctrl/Cmd + Enter shortcut
|
| 212 |
+
ta.addEventListener('keydown', (e)=>{
|
| 213 |
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) translateText();
|
| 214 |
});
|
| 215 |
</script>
|
papua-lora-ckpt-168
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
Subproject commit 17f6bcc097a64e04f3ce0538e821ce8a7b3cb474
|
|
|
|
|
|