-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
98 lines (91 loc) · 2.63 KB
/
index.html
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
98
<!DOCTYPE html>
<html
lang="en"
data-bs-theme="auto">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1" />
<meta
name="description"
content="" />
<title>Word Guessing Game</title>
<link
href="css/bootstrap.min.css"
rel="stylesheet" />
<meta
name="theme-color"
content="#712cf9" />
<!-- Custom styles for this template -->
<link
href="css/dropdowns.css"
rel="stylesheet" />
</head>
<body>
<div class="py-0 mb-0">
<header
class="bd-header bg-dark py-1 d-flex align-items-stretch border-bottom border-dark">
<div class="container-fluid d-flex align-items-center">
<h4 class="d-flex align-items-center fs-6 text-white mb-0">
Englist Helper
</h4>
</div>
</header>
</div>
<div class="row">
<div
class="d-flex p-4 gap-4 py-md-4 align-items-center justify-content-center"
id="content">
<ul
class="w-280px list-group"
id="lesson-list">
<li
class="list-group-item active"
aria-current="true">
Lessons
</li>
</ul>
</div>
</div>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/jquery-3.7.0.min.js"></script>
<script>
$(document).ready(function () {
$.ajax({
url: "lesson_list.txt?v=" + Math.random(), // Replace with the actual path to your text file
dataType: "text",
success: function (data) {
var temp_lessons = data.split("\n");
temp_lessons = temp_lessons.map(function (line) {
return line.trim();
});
const lessonElements = $("#lesson-list");
$.each(temp_lessons, function (key, value) {
var newLiElement = $("<li>", {
class: "list-group-item",
html:
'<a class="page-link" href="lesson.html?lesson_id=' +
value +
"&v=" +
Math.random() +
'">' +
(key + 1) +
". " +
value +
(value == "2A-168a"
? '<img src="new.gif" />'
: "") +
"</a>",
});
lessonElements.append(newLiElement);
});
},
error: function (jqXHR, textStatus, errorThrown) {
console.log("Error:", textStatus, errorThrown);
},
});
});
</script>
</body>
</html>