92 lines
1.9 KiB
HTML
92 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Tentang Aplikasi</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 0;
|
|
padding: 20px;
|
|
background-color: #f9f9f9;
|
|
color: #333;
|
|
}
|
|
|
|
h1 {
|
|
color: #2c3e50;
|
|
text-align: center;
|
|
}
|
|
|
|
p {
|
|
text-align: center;
|
|
font-size: 18px;
|
|
}
|
|
|
|
nav {
|
|
text-align: center;
|
|
margin-top: 30px;
|
|
}
|
|
|
|
nav a {
|
|
text-decoration: none;
|
|
color: #3498db;
|
|
margin: 0 10px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
nav a:hover {
|
|
color: #1abc9c;
|
|
}
|
|
|
|
.info-box {
|
|
margin-top: 40px;
|
|
max-width: 600px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
background-color: white;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
|
text-align: center;
|
|
}
|
|
|
|
.loading {
|
|
color: #888;
|
|
}
|
|
|
|
.error {
|
|
color: red;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Tentang Aplikasi</h1>
|
|
<p>Halaman ini menjelaskan informasi singkat tentang aplikasi dan jumlah pengguna yang terdaftar.</p>
|
|
|
|
<nav>
|
|
<a href="/">Beranda</a> |
|
|
<a href="/about.html">Tentang</a>
|
|
</nav>
|
|
|
|
<div class="info-box" id="user-info">
|
|
<p class="loading">Mengambil data pengguna...</p>
|
|
</div>
|
|
|
|
<script>
|
|
fetch('http://localhost:3000/users')
|
|
.then(response => {
|
|
if (!response.ok) throw new Error("Gagal mengambil data");
|
|
return response.json();
|
|
})
|
|
.then(data => {
|
|
const box = document.getElementById('user-info');
|
|
const count = data.length;
|
|
box.innerHTML = `<p>Aplikasi ini saat ini memiliki <strong>${count}</strong> pengguna terdaftar.</p>`;
|
|
})
|
|
.catch(error => {
|
|
const box = document.getElementById('user-info');
|
|
box.innerHTML = `<p class="error">Gagal memuat data pengguna: ${error.message}</p>`;
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|