-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobile.html
More file actions
338 lines (308 loc) · 8.21 KB
/
Copy pathmobile.html
File metadata and controls
338 lines (308 loc) · 8.21 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="canonical" href="https://learn.edodnan.com.au" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search from Edodnan</title>
<style>
p, h1 {
color:white;
}
/* General text styles */
body {
font-family: Arial, sans-serif;
margin: 0;
background-color: #f8f0ff;
color: black;
}
h3 {
color: black;
}
/* Header */
header {
background-color: #7400B5;
padding: 10px;
}
header h1 {
color: white;
font-size: 20px;
margin-bottom: 10px;
}
.links-container {
display: flex;
flex-direction: row; /* side by side */
gap: 10px; /* space between links */
align-items: center; /* vertical alignment inside header */
}
.under-search-links {
display: flex;
border-radius: 10px;
height: 36px;
background-color: forestgreen;
align-items: center;
justify-content: center;
padding: 0 10px; /* optional: makes links look nicer */
}
.under-search-links a {
color: black;
font-size: 16px;
text-decoration: none;
text-align: center;
}
/* Black square section */
.blacksquare {
display: flex;
flex-direction: column;
background-color: black;
width: 100%;
padding: 10px;
box-sizing: border-box;
gap: 10px;
}
.blacksquare img {
width: 100%;
max-width: 400px;
height: auto;
align-self: center;
border-radius: 8px;
}
.up {
display: flex;
flex-direction: column;
gap: 10px;
}
/* Search */
.search-container {
padding: 8px;
background: #f2f2f2;
border-radius: 8px;
width: 100%;
box-sizing: border-box;
}
.search-row {
display: flex;
flex-direction: column;
gap: 8px;
}
.search-box {
width: 100%;
padding: 8px;
font-size: 16px;
border-radius: 8px;
border: 1px solid #ccc;
box-sizing: border-box;
}
.search-button {
width: 100%;
padding: 8px;
font-size: 16px;
cursor: pointer;
border-radius: 8px;
border: 1px solid #ccc;
background-color: white;
transition: background 0.2s;
}
.search-button:hover {
background-color: #e0e0e0;
}
/* Suggestions */
.suggestion {
background-color: #f2f2f2;
border-radius: 8px;
padding: 8px;
margin-top: 5px;
cursor: pointer;
color: black;
border: 1px solid #ccc;
font-size: 16px;
width: 100%;
box-sizing: border-box;
transition: background 0.2s;
}
.suggestion:hover {
background-color: #e0e0e0;
}
/* Horizontal scroll cards */
.horizontal-scroll {
display: flex;
gap: 12px;
overflow-x: auto;
overflow-y: hidden;
padding: 8px 0;
scroll-behavior: smooth;
}
.card {
width: 180px;
flex-shrink: 0;
background: #f2f2f2;
border-radius: 8px;
text-decoration: none;
color: black;
display: flex;
flex-direction: column;
}
.card img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 0 0 8px 8px;
}
.card h3 {
padding: 8px;
font-size: 14px;
}
.card:hover {
background: #e0e0e0;
}
/* Footer */
footer {
background: #222;
color: white;
text-align: center;
padding: 15px;
font-size: 14px;
}
footer img {
width: 40px;
margin: 0 4px;
}
/* Responsive adjustments */
@media (max-width: 480px) {
header h1 {
font-size: 18px;
}
.under-search-links a {
font-size: 14px;
}
.search-box, .search-button {
font-size: 14px;
padding: 6px;
}
.card {
width: 140px;
}
.card img {
height: 120px;
}
.card h3 {
font-size: 12px;
padding: 6px;
}
}
</style>
</head>
<body>
<header>
<h1>Search for your article</h1>
<div class="links-container">
<div class="under-search-links">
<a target="_blank" rel="noopener noreferrer" href="https://edodnan.com.au/help.html">Add your own article</a>
</div>
<div class="under-search-links">
<a target="_blank" rel="noopener noreferrer" href="https://github.com/theone7736-rgb/Learn">GitHub repository</a>
</div>
</div>
</header>
<main>
<!-- Black square section -->
<div class="blacksquare">
<div class="up">
<div class="search-container">
<label>Search the site:</label>
<div class="search-row">
<input id="site-search" class="search-box" placeholder="Enter query...">
<button class="search-button" onclick="handleSearch()">Search</button>
</div>
<div id="result" style="display:flex; flex-direction:column;"></div>
</div>
<a href="search/plazma:-the-fourth-state-of-matter.html">
<img src="https://learn.edodnan.com.au/IMG/Plasma.png" alt="Plasma">
</a>
<h1>Plazma: the fourth state of matter</h1>
<p>Explore the fourth and unknown state of matter, see its capabilities and find out how and why it's so powerful.</p>
<p>Plazma is undoubtedly an interesting state of matter, because it's the fourth one. We all learned about the three states of matter: solid, liquid and gas, but plazma enters the arena as the fourth state of matter. It undoubtedly wins in terms of power, but also curiosity and fascination.</p>
</div>
</div>
<h2 style="padding:10px;">See our newest reads</h2>
<div class="horizontal-scroll">
<a class="card" href="https://learn.edodnan.com.au/search/TON-618:-The-biggest-black-hole.html">
<h3>TON: The biggest black hole</h3>
<img src="IMG/Black-hole.png" alt="Black Hole">
</a>
<a class="card" href="https://learn.edodnan.com.au/search/AI:-everything-you-need-to-know.html">
<h3>AI: What is it, and what will it do</h3>
<img src="IMG/AI.png" alt="AI">
</a>
<a class="card" href="search/plazma:-the-fourth-state-of-matter.html">
<h3>Plazma: the fourth state of matter</h3>
<img src="IMG/Plasma.png" alt="Plasma">
</a>
<a class="card" href="#">Article 4</a>
<a class="card" href="#">Article 5</a>
</div>
<button style="margin:10px; padding:10px; border-radius:8px; width: calc(100% - 20px);">
<a href="https://learn.edodnan.com.au/us.html" style="text-decoration:none;">Learn about us here</a>
</button>
</main>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
import { getFirestore, collection, getDocs } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js";
const firebaseConfig = {
apiKey: "AIzaSyDsBh4fUaeuEFZrp24c7yLYopZrQ4iFcV0",
authDomain: "search-bb49c.firebaseapp.com",
projectId: "search-bb49c"
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
let pages = [];
// Load articles
async function loadArticles() {
const snap = await getDocs(collection(db, "articles"));
pages = snap.docs.map(doc => doc.data());
}
loadArticles();
// Simple similarity
function similarity(a, b) {
let score = 0;
for (const char of a) if (b.includes(char)) score++;
return score;
}
// Handle search
window.handleSearch = function () {
const input = document.getElementById("site-search").value.toLowerCase().trim();
const result = document.getElementById("result");
result.innerHTML = "";
if (!input) return;
const matches = pages
.map(p => ({ ...p, score: similarity(input, p.title.toLowerCase()) }))
.filter(p => p.score > 0)
.sort((a, b) => b.score - a.score)
.slice(0, 4);
if (!matches.length) {
result.textContent = "No results found.";
return;
}
matches.forEach(p => {
const div = document.createElement("div");
div.className = "suggestion";
div.textContent = p.title;
div.onclick = () => {
window.location.href = "https://learn.edodnan.com.au/search/" + p.slug + ".html";
};
result.appendChild(div);
});
};
</script>
<footer>
<p><u>Want to see more?</u></p>
<div class="links-container" style="flex-direction: row; flex-wrap: wrap; gap: 5px; justify-content: center;">
<p>Contact: theone7736@gmail.com</p>
<img src="https://edodnan.com.au/images/Scratch.png" alt="Scratch">
<img src="https://edodnan.com.au/images/YouTube.png" alt="YouTube">
<img src="https://edodnan.com.au/images/Canva.png" alt="Canva">
<p>© 2025 Edodnan All rights reserved</p>
</div>
</footer>
</body>
</html>