639 lines
19 KiB
HTML
639 lines
19 KiB
HTML
<!-- web/user.html -->
|
|
<!DOCTYPE html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Dashboard User - Lost & Found</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--primary: #2563eb;
|
|
--primary-dark: #1e40af;
|
|
--danger: #ef4444;
|
|
--success: #10b981;
|
|
--warning: #f59e0b;
|
|
--light: #f8fafc;
|
|
--dark: #1e293b;
|
|
--secondary: #64748b;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: #f1f5f9;
|
|
}
|
|
|
|
.navbar {
|
|
background: white;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
padding: 15px 30px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.navbar-brand {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: var(--primary);
|
|
}
|
|
|
|
.navbar-menu {
|
|
display: flex;
|
|
gap: 20px;
|
|
align-items: center;
|
|
}
|
|
|
|
.nav-link {
|
|
text-decoration: none;
|
|
color: var(--dark);
|
|
font-weight: 500;
|
|
padding: 8px 15px;
|
|
border-radius: 8px;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
background: var(--light);
|
|
color: var(--primary);
|
|
}
|
|
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.user-avatar {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
background: var(--primary);
|
|
color: white;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn-logout {
|
|
background: var(--danger);
|
|
color: white;
|
|
border: none;
|
|
padding: 8px 20px;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.btn-logout:hover {
|
|
background: #dc2626;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 30px auto;
|
|
padding: 0 20px;
|
|
}
|
|
|
|
.page-header {
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.page-header h1 {
|
|
color: var(--dark);
|
|
font-size: 2rem;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.tabs {
|
|
display: flex;
|
|
gap: 10px;
|
|
margin-bottom: 30px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.tab-btn {
|
|
padding: 12px 25px;
|
|
background: white;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 10px;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
color: var(--secondary);
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.tab-btn.active {
|
|
background: var(--primary);
|
|
color: white;
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
|
|
.stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
gap: 20px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.stat-card {
|
|
background: white;
|
|
padding: 25px;
|
|
border-radius: 15px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
}
|
|
|
|
.stat-card h3 {
|
|
color: var(--secondary);
|
|
font-size: 0.9rem;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 2.5rem;
|
|
font-weight: 700;
|
|
color: var(--primary);
|
|
}
|
|
|
|
.card {
|
|
background: white;
|
|
border-radius: 15px;
|
|
padding: 25px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.card-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.card-title {
|
|
font-size: 1.3rem;
|
|
color: var(--dark);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn {
|
|
padding: 10px 20px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--primary);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--primary-dark);
|
|
}
|
|
|
|
.search-box {
|
|
display: flex;
|
|
gap: 10px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.search-input {
|
|
flex: 1;
|
|
padding: 12px 15px;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 10px;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.search-input:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
.filter-select {
|
|
padding: 12px 15px;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 10px;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.items-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
|
|
.item-card {
|
|
background: white;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 15px;
|
|
overflow: hidden;
|
|
transition: all 0.3s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.item-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.item-image {
|
|
width: 100%;
|
|
height: 200px;
|
|
object-fit: cover;
|
|
background: var(--light);
|
|
}
|
|
|
|
.item-body {
|
|
padding: 15px;
|
|
}
|
|
|
|
.item-title {
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
color: var(--dark);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.item-meta {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 5px;
|
|
color: var(--secondary);
|
|
font-size: 0.9rem;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.badge {
|
|
display: inline-block;
|
|
padding: 5px 12px;
|
|
border-radius: 20px;
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.badge-success {
|
|
background: #d1fae5;
|
|
color: var(--success);
|
|
}
|
|
|
|
.badge-warning {
|
|
background: #fef3c7;
|
|
color: var(--warning);
|
|
}
|
|
|
|
.badge-danger {
|
|
background: #fee2e2;
|
|
color: var(--danger);
|
|
}
|
|
|
|
.badge-primary {
|
|
background: #dbeafe;
|
|
color: var(--primary);
|
|
}
|
|
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
z-index: 1000;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0,0,0,0.5);
|
|
animation: fadeIn 0.3s;
|
|
}
|
|
|
|
.modal.active {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.modal-content {
|
|
background: white;
|
|
border-radius: 20px;
|
|
max-width: 600px;
|
|
width: 90%;
|
|
max-height: 90vh;
|
|
overflow-y: auto;
|
|
animation: slideUp 0.3s;
|
|
}
|
|
|
|
.modal-header {
|
|
padding: 25px;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.modal-title {
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.close-btn {
|
|
background: none;
|
|
border: none;
|
|
font-size: 1.5rem;
|
|
cursor: pointer;
|
|
color: var(--secondary);
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 25px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 600;
|
|
color: var(--dark);
|
|
}
|
|
|
|
.form-group input,
|
|
.form-group textarea,
|
|
.form-group select {
|
|
width: 100%;
|
|
padding: 12px 15px;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 10px;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.form-group textarea {
|
|
resize: vertical;
|
|
min-height: 100px;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 60px 20px;
|
|
color: var(--secondary);
|
|
}
|
|
|
|
.empty-state-icon {
|
|
font-size: 4rem;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
}
|
|
|
|
@keyframes slideUp {
|
|
from {
|
|
transform: translateY(50px);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateY(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.navbar {
|
|
flex-direction: column;
|
|
gap: 15px;
|
|
}
|
|
|
|
.navbar-menu {
|
|
flex-direction: column;
|
|
width: 100%;
|
|
}
|
|
|
|
.items-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav class="navbar">
|
|
<div class="navbar-brand">🔍 Lost & Found</div>
|
|
<div class="navbar-menu">
|
|
<div class="user-info">
|
|
<div class="user-avatar" id="userAvatar">U</div>
|
|
<span id="userName">User</span>
|
|
</div>
|
|
<button class="btn-logout" onclick="logout()">Logout</button>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container">
|
|
<div class="page-header">
|
|
<h1>Dashboard User</h1>
|
|
<p>Selamat datang di Lost & Found System</p>
|
|
</div>
|
|
|
|
<div class="stats-grid">
|
|
<div class="stat-card">
|
|
<h3>Barang Hilang Saya</h3>
|
|
<div class="stat-number" id="statLost">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h3>Barang yang Saya Temukan</h3>
|
|
<div class="stat-number" id="statFound">0</div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<h3>Klaim Saya</h3>
|
|
<div class="stat-number" id="statClaims">0</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tabs">
|
|
<button class="tab-btn active" onclick="switchTab('browse')">📦 Cari Barang</button>
|
|
<button class="tab-btn" onclick="switchTab('lost')">😢 Barang Hilang Saya</button>
|
|
<button class="tab-btn" onclick="switchTab('found')">🎉 Barang yang Saya Temukan</button>
|
|
<button class="tab-btn" onclick="switchTab('claims')">🤝 Riwayat Klaim</button>
|
|
</div>
|
|
|
|
<!-- Tab: Browse Items -->
|
|
<div id="browseTab" class="tab-content active">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Barang Ditemukan</h2>
|
|
</div>
|
|
|
|
<div class="search-box">
|
|
<input type="text" class="search-input" placeholder="Cari barang..." id="searchInput">
|
|
<select class="filter-select" id="categoryFilter">
|
|
<option value="">Semua Kategori</option>
|
|
<option value="pakaian">Pakaian</option>
|
|
<option value="alat_makan">Alat Makan</option>
|
|
<option value="aksesoris">Aksesoris</option>
|
|
<option value="elektronik">Elektronik</option>
|
|
<option value="alat_tulis">Alat Tulis</option>
|
|
<option value="lainnya">Lainnya</option>
|
|
</select>
|
|
<select class="filter-select" id="sortBy">
|
|
<option value="date_desc">Terbaru</option>
|
|
<option value="date_asc">Terlama</option>
|
|
<option value="name_asc">Nama A-Z</option>
|
|
<option value="name_desc">Nama Z-A</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="items-grid" id="itemsGrid"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab: My Lost Items -->
|
|
<div id="lostTab" class="tab-content">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Barang Hilang Saya</h2>
|
|
<button class="btn btn-primary" onclick="openReportLostModal()">+ Lapor Kehilangan</button>
|
|
</div>
|
|
<div class="items-grid" id="lostItemsGrid"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab: My Found Items -->
|
|
<div id="foundTab" class="tab-content">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Barang yang Saya Temukan</h2>
|
|
<button class="btn btn-primary" onclick="openReportFoundModal()">+ Lapor Penemuan</button>
|
|
</div>
|
|
<div class="items-grid" id="foundItemsGrid"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab: My Claims -->
|
|
<div id="claimsTab" class="tab-content">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="card-title">Riwayat Klaim</h2>
|
|
</div>
|
|
<div class="items-grid" id="claimsGrid"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Report Lost -->
|
|
<div id="reportLostModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title">Lapor Barang Hilang</h3>
|
|
<button class="close-btn" onclick="closeModal('reportLostModal')">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="reportLostForm">
|
|
<div class="form-group">
|
|
<label>Nama Barang</label>
|
|
<input type="text" name="name" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Kategori</label>
|
|
<select name="category" required>
|
|
<option value="">Pilih Kategori</option>
|
|
<option value="pakaian">Pakaian</option>
|
|
<option value="alat_makan">Alat Makan</option>
|
|
<option value="aksesoris">Aksesoris</option>
|
|
<option value="elektronik">Elektronik</option>
|
|
<option value="alat_tulis">Alat Tulis</option>
|
|
<option value="lainnya">Lainnya</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Warna</label>
|
|
<input type="text" name="color" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Lokasi Hilang (Opsional)</label>
|
|
<input type="text" name="location">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Deskripsi</label>
|
|
<textarea name="description" required></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Tanggal Hilang</label>
|
|
<input type="date" name="date_lost" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary" style="width: 100%;">Submit Laporan</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Report Found -->
|
|
<div id="reportFoundModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title">Lapor Penemuan Barang</h3>
|
|
<button class="close-btn" onclick="closeModal('reportFoundModal')">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="reportFoundForm">
|
|
<div class="form-group">
|
|
<label>Foto Barang</label>
|
|
<input type="file" name="photo" accept="image/*" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Nama Barang</label>
|
|
<input type="text" name="name" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Kategori</label>
|
|
<select name="category" required>
|
|
<option value="">Pilih Kategori</option>
|
|
<option value="pakaian">Pakaian</option>
|
|
<option value="alat_makan">Alat Makan</option>
|
|
<option value="aksesoris">Aksesoris</option>
|
|
<option value="elektronik">Elektronik</option>
|
|
<option value="alat_tulis">Alat Tulis</option>
|
|
<option value="lainnya">Lainnya</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Lokasi Ditemukan</label>
|
|
<input type="text" name="location" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Deskripsi Keunikan (Rahasia untuk Verifikasi)</label>
|
|
<textarea name="description" required placeholder="Ciri khusus yang hanya pemilik tahu..."></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Tanggal Ditemukan</label>
|
|
<input type="date" name="date_found" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary" style="width: 100%;">Submit Penemuan</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="js/main.js"></script>
|
|
<script src="js/user.js"></script>
|
|
</body>
|
|
</html> |