ta-azis-pendeteksi-nominal-.../project/templates/monitoring.html

235 lines
6.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>MIRA - Monitoring</title>
<link href="https://fonts.googleapis.com/css2?family=Dangrek&family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Poppins', sans-serif;
background: #6D60B4;
min-height: 100vh;
display: flex;
align-items: center;
padding: 20px;
}
.wrapper {
display: flex;
width: 100%;
min-height: calc(100vh - 40px);
}
.sidebar {
width: 170px;
display: flex;
flex-direction: column;
align-items: center;
padding: 32px 14px 24px;
gap: 40px;
flex-shrink: 0;
}
.brand {
text-align: center;
color: white;
}
.brand h2 {
font-family: 'Poppins', sans-serif;
font-size: 26px;
font-weight: 700;
line-height: 1;
letter-spacing: 2px;
}
.brand p {
font-family: 'Poppins', sans-serif;
font-size: 10px;
line-height: 1.5;
margin-top: 7px;
opacity: 0.9;
font-weight: 400;
}
.nav {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 10px 10px 16px;
color: rgba(255,255,255,0.6);
cursor: pointer;
font-family: 'Poppins', sans-serif;
font-size: 14px;
font-weight: 600;
text-decoration: none;
position: relative;
}
.nav-item.active { color: white; }
.nav-item.active::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 28px;
background: white;
border-radius: 0 3px 3px 0;
}
.icon-grid {
width: 22px; height: 22px;
display: inline-block;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='3' y='3' width='8' height='8' rx='1'/%3E%3Crect x='13' y='3' width='8' height='8' rx='1'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1'/%3E%3Crect x='13' y='13' width='8' height='8' rx='1'/%3E%3C/svg%3E");
background-size: contain;
background-repeat: no-repeat;
flex-shrink: 0;
}
.icon-money {
width: 22px; height: 22px;
display: inline-block;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
background-size: contain;
background-repeat: no-repeat;
flex-shrink: 0;
}
.icon-train {
width: 22px; height: 22px;
display: inline-block; flex-shrink: 0;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14l4-4h12c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 9l-3-2.25V12H7V6h4v2.25L14 6l5 3-5 3z'/%3E%3C/svg%3E");
background-size: contain;
background-repeat: no-repeat;
}
.main-wrap {
flex: 1;
display: flex;
}
.content-area {
flex: 1;
background: #FFFFFF;
border-radius: 24px;
padding: 32px 36px 36px;
display: flex;
flex-direction: column;
align-items: center;
}
.page-title {
font-family: 'Poppins', sans-serif;
font-size: 24px;
font-weight: 700;
color: #6D60B4;
margin-bottom: 24px;
width: 100%;
text-align: left;
}
.camera-box {
background: #C4BFDF;
border-radius: 20px;
overflow: hidden;
width: 520px;
max-width: 100%;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
}
.camera-box img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.nominal-label {
font-family: 'Poppins', sans-serif;
font-size: 20px;
font-weight: 700;
color: #6D60B4;
margin: 24px 0 12px;
text-align: center;
}
.nominal-display {
background: #ECEAF6;
border: 2px solid #C4BFDF;
border-radius: 40px;
padding: 12px 24px;
font-family: 'Poppins', sans-serif;
font-size: 16px;
font-weight: 500;
color: #6D60B4;
width: 520px;
max-width: 100%;
min-height: 48px;
display: flex;
align-items: center;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="sidebar">
<div class="brand">
<h2>MIRA</h2>
<p>Money Identification and<br>Recognition Assistant</p>
</div>
<nav class="nav">
<a href="/monitoring" class="nav-item active">
<span class="icon-grid"></span> Monitoring
</a>
<a href="/testing" class="nav-item">
<span class="icon-money"></span> Testing
</a>
<a href="/training" class="nav-item">
<span class="icon-train"></span> Training
</a>
</nav>
</div>
<div class="main-wrap">
<div class="content-area">
<div class="page-title">Monitoring</div>
<div class="camera-box">
<img id="image" src="" alt="camera feed" />
</div>
<div class="nominal-label">Nominal</div>
<div class="nominal-display" id="nominal"></div>
</div>
</div>
</div>
<script>
async function loadData() {
try {
const res = await fetch("/latest");
const data = await res.json();
document.getElementById("image").src = data.image + "?t=" + new Date().getTime();
document.getElementById("nominal").innerText = data.nominal;
} catch (err) {
console.log("Error:", err);
}
}
setInterval(loadData, 1000);
</script>
</body>
</html>