240 lines
5.5 KiB
HTML
240 lines
5.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Pindai</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
background-color: #A1C398;
|
|
}
|
|
|
|
.canvas {
|
|
position: relative; /* Konteks posisi relatif */
|
|
width: 90%; /* Lebar konten utama */
|
|
max-width: 1200px; /* Lebar maksimum */
|
|
height: 80vh; /* Tinggi konten utama, gunakan vh untuk tinggi responsif */
|
|
background-color: #BFD8AF;
|
|
border-radius: 20px;
|
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: space-around;
|
|
padding: 20px;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.menu-text {
|
|
font-size: 30px;
|
|
color: black;
|
|
margin-bottom: 20px;
|
|
margin-top: 50px;
|
|
text-align: center;
|
|
}
|
|
|
|
.card-body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
width: 100%;
|
|
}
|
|
|
|
.mb-4 {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.col-md-12 {
|
|
width: 100%;
|
|
}
|
|
|
|
.btn-container {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
max-width: 350px;
|
|
}
|
|
|
|
.btn {
|
|
flex: 1;
|
|
padding: 10px 15px;
|
|
font-size: 20px;
|
|
border: none;
|
|
border-radius: 10px;
|
|
cursor: pointer;
|
|
margin-top: 10px;
|
|
margin-bottom: 10px;
|
|
text-align: center;
|
|
margin: 10px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: #7F9F80;
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background-color: #878C8C;
|
|
color: white;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.mt-4 {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.scanResult {
|
|
width: 100%;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.row {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
}
|
|
|
|
.col-lg-6 {
|
|
flex: 0 0 50%;
|
|
max-width: 50%;
|
|
margin-bottom: 100px;
|
|
}
|
|
|
|
.img-fluid {
|
|
max-width: 100%;
|
|
max-height: 300px;
|
|
height: auto;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.result-table {
|
|
width: 100%;
|
|
margin-top: 20px;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.result-table th,
|
|
.result-table td {
|
|
padding: 8px;
|
|
border-bottom: 1px solid #ddd;
|
|
text-align: left;
|
|
font-size: 35px; /* Menyesuaikan ukuran teks */
|
|
}
|
|
|
|
.previous-button {
|
|
position: absolute;
|
|
top: 2vh; /* Sesuaikan jarak atas */
|
|
left: 2vw; /* Sesuaikan jarak kiri */
|
|
background-color: transparent;
|
|
border: none;
|
|
cursor: pointer;
|
|
z-index: 1;
|
|
padding: 10px; /* Tambahkan padding */
|
|
}
|
|
|
|
.previous-button img {
|
|
width: 5%; /* Sesuaikan ukuran gambar dengan persentase */
|
|
height: auto;
|
|
margin-top: 40px; /* Sesuaikan margin atas */
|
|
}
|
|
.result-heading {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
margin-bottom: 10px;
|
|
font-size: 20px;
|
|
}
|
|
|
|
.table-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="canvas">
|
|
<a href="{{ url_for('menupindai') }}" class="previous-button">
|
|
<img src="{{ url_for('static', filename='assets/previous.png') }}" alt="Previous Icon">
|
|
</a>
|
|
<h1 class="menu-text">CARI TAHU BAHASA ARABNYA DIBAWAH SINI</h1>
|
|
<div class="card-body">
|
|
<h5 class="mb-4" style="font-size: 20px;">Unggah Gambar</h5>
|
|
<form class="row g-3" action="/submit" method="POST" enctype="multipart/form-data">
|
|
<div class="col-md-12 mb-3">
|
|
<input type="file" id="inputImage" name="file" accept="image/*" style="background-color: #9CAFAA; color: white; border-radius: 5px; width: 100%; padding: 10px;" onchange="previewImage(event)">
|
|
</div>
|
|
<div class="btn-container">
|
|
<button type="submit" class="btn btn-primary">Klasifikasi</button>
|
|
<a href="/refresh" class="btn btn-secondary">Refresh</a>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- Preview Image -->
|
|
<div id="imagePreview" class="mt-4 text-center" style="display: none;">
|
|
<img id="selectedImage" src="#" alt="Preview" class="img-fluid">
|
|
</div>
|
|
|
|
<!-- Scan Result -->
|
|
<div id="scanResult" class="mt-4">
|
|
<div class="result-heading">
|
|
<div>Hasil Upload</div>
|
|
<div>Kelas Prediksi</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<img src="{{ img_path }}" class="img-fluid" alt="Processed Image">
|
|
</div>
|
|
<div class="col-lg-6">
|
|
<div class="table-content">
|
|
<table class="result-table">
|
|
<tr>
|
|
<th>Bahasa Arab: </th>
|
|
<td>{{ predictionarab }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Custom script for handling image upload -->
|
|
<script>
|
|
// Fungsi untuk menampilkan gambar yang dipilih saat input file berubah
|
|
function previewImage(event) {
|
|
console.log('Input file changed');
|
|
var input = event.target;
|
|
var reader = new FileReader();
|
|
reader.onload = function () {
|
|
var img = document.getElementById('inputImagePreview');
|
|
img.src = reader.result;
|
|
img.style.display = 'block';
|
|
};
|
|
reader.readAsDataURL(input.files[0]);
|
|
}
|
|
// Fungsi untuk menampilkan gambar yang diproses setelah mengirim formulir
|
|
function showProcessedImage() {
|
|
var inputImg = document.getElementById('inputImagePreview');
|
|
inputImg.style.display = 'none';
|
|
var processedImg = document.getElementById('processedImage');
|
|
processedImg.src = inputImg.src;
|
|
processedImg.style.display = 'block';
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|