Update index.html
Browse files- index.html +57 -19
index.html
CHANGED
|
@@ -1,19 +1,57 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>News Portal - Article</title>
|
| 7 |
+
<style>
|
| 8 |
+
body { font-family: 'Segoe UI', sans-serif; line-height: 1.6; margin: 0; background: #f4f4f4; color: #333; }
|
| 9 |
+
.container { max-width: 800px; margin: 40px auto; background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
|
| 10 |
+
header { border-bottom: 2px solid #eee; margin-bottom: 20px; padding-bottom: 10px; }
|
| 11 |
+
h1 { margin: 0; color: #222; }
|
| 12 |
+
|
| 13 |
+
/* Navigation Styles */
|
| 14 |
+
.nav-buttons { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 2px solid #eee; }
|
| 15 |
+
.btn { padding: 12px 24px; background: #007bff; color: white; text-decoration: none; border-radius: 5px; font-weight: bold; transition: 0.3s; border: none; cursor: pointer; }
|
| 16 |
+
.btn:hover { background: #0056b3; }
|
| 17 |
+
.btn:disabled { background: #ccc; cursor: not-allowed; }
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body>
|
| 21 |
+
|
| 22 |
+
<div class="container">
|
| 23 |
+
<header>
|
| 24 |
+
<small>News Article</small>
|
| 25 |
+
<h1>Article Title Here</h1>
|
| 26 |
+
</header>
|
| 27 |
+
|
| 28 |
+
<div class="nav-buttons">
|
| 29 |
+
<button id="prevBtn" class="btn" onclick="navigate(-1)">← Previous</button>
|
| 30 |
+
<button id="nextBtn" class="btn" onclick="navigate(1)">Next →</button>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<script>
|
| 35 |
+
// Configuration
|
| 36 |
+
const totalArticles = 20;
|
| 37 |
+
|
| 38 |
+
// Get current article number from filename (e.g., "1.html" -> 1)
|
| 39 |
+
const currentPath = window.location.pathname;
|
| 40 |
+
const filename = currentPath.substring(currentPath.lastIndexOf('/') + 1);
|
| 41 |
+
const currentNum = parseInt(filename.split('.')[0]) || 1;
|
| 42 |
+
|
| 43 |
+
// Handle button visibility
|
| 44 |
+
if (currentNum <= 1) document.getElementById('prevBtn').disabled = true;
|
| 45 |
+
if (currentNum >= totalArticles) document.getElementById('nextBtn').disabled = true;
|
| 46 |
+
|
| 47 |
+
function navigate(direction) {
|
| 48 |
+
const targetNum = currentNum + direction;
|
| 49 |
+
if (targetNum >= 1 && targetNum <= totalArticles) {
|
| 50 |
+
// Adjust the path below if your files are in a different folder
|
| 51 |
+
window.location.href = targetNum + ".html";
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
</script>
|
| 55 |
+
|
| 56 |
+
</body>
|
| 57 |
+
</html>
|