Spaces:
Running
Running
Upload history.html
Browse files- history.html +28 -0
history.html
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>History</title>
|
| 7 |
+
<script>
|
| 8 |
+
window.onload = function () {
|
| 9 |
+
const visitHistory = JSON.parse(localStorage.getItem('visitHistory')) || [];
|
| 10 |
+
const historyContainer = document.getElementById('historyContainer');
|
| 11 |
+
|
| 12 |
+
if (visitHistory.length === 0) {
|
| 13 |
+
historyContainer.innerHTML = "No history found.";
|
| 14 |
+
} else {
|
| 15 |
+
visitHistory.forEach(entry => {
|
| 16 |
+
const historyItem = document.createElement('div');
|
| 17 |
+
historyItem.innerHTML = `<strong>${entry.name}</strong> visited on ${entry.time} from ${entry.device}`;
|
| 18 |
+
historyContainer.appendChild(historyItem);
|
| 19 |
+
});
|
| 20 |
+
}
|
| 21 |
+
};
|
| 22 |
+
</script>
|
| 23 |
+
</head>
|
| 24 |
+
<body>
|
| 25 |
+
<h1>Visit History</h1>
|
| 26 |
+
<div id="historyContainer"></div>
|
| 27 |
+
</body>
|
| 28 |
+
</html>
|