Repository navigation
Expand file tree
/
Copy pathFajarProjeck.html
More file actions
97 lines (93 loc) · 2.81 KB
/
Copy pathFajarProjeck.html
File metadata and controls
97 lines (93 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Website Sederhana</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
nav {
background-color: #007bff;
padding: 10px 0;
text-align: center;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
}
nav ul li {
display: inline;
margin-right: 10px;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.footer {
text-align: center;
padding: 10px 0;
background-color: #333;
color: #fff;
position: fixed;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<header>
<h1>Website Saya</h1>
</header>
<nav>
<ul>
<li><a href="#">Beranda</a></li>
<li><a href="#">Tentang Kami</a></li>
<li><a href="#">Layanan</a></li>
<li><a href="#">Kontak</a></li>
<li><a href="#">Statistik Pengunjung</a></li>
</ul>
</nav>
<div class="container">
<h2>Selamat datang di website sederhana ini!</h2>
<p>Ini adalah contoh website sederhana dengan beberapa halaman dan menu navigasi.</p>
</div>
<div class="footer">
Jumlah Pengunjung: <span id="visitorCount">0</span>
</div>
<script>
// Mengambil jumlah pengunjung dari localStorage
let visitorCount = localStorage.getItem('visitorCount');
if (visitorCount === null) {
visitorCount = 0;
} else {
visitorCount = parseInt(visitorCount);
}
// Fungsi untuk memperbarui jumlah pengunjung
function updateVisitorCount() {
visitorCount++;
document.getElementById('visitorCount').textContent = visitorCount;
localStorage.setItem('visitorCount', visitorCount);
}
// Memperbarui jumlah pengunjung setiap 5 detik
setInterval(updateVisitorCount, 5000);
// Menampilkan jumlah pengunjung saat halaman dimuat
document.getElementById('visitorCount').textContent = visitorCount;
</script>
</body>
</html>