-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (72 loc) · 2.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mastodon Instances</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #333;
color: #fff;
padding: 1rem;
text-align: center;
}
main {
padding: 1rem;
}
#instances-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.instance {
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
padding: 1rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<header>
<h1>Mastodon Instances</h1>
</header>
<main>
<div id="instances-list">
<p>Loading instances...</p>
</div>
</main>
<script>
document.addEventListener('DOMContentLoaded', () => {
const instancesList = document.getElementById('instances-list');
// Mock API data
const mockData = [
{ title: 'Instance A', description: 'A great instance for general discussion.', url: 'https://instance-a.example.com' },
{ title: 'Instance B', description: 'Focuses on technology and development.', url: 'https://instance-b.example.com' },
{ title: 'Instance C', description: 'Community for creative minds and art.', url: 'https://instance-c.example.com' }
];
// Simulate network delay
setTimeout(() => {
instancesList.innerHTML = ''; // Clear the loading text
mockData.forEach(instance => {
const instanceDiv = document.createElement('div');
instanceDiv.className = 'instance';
instanceDiv.innerHTML = `
<h2>${instance.title}</h2>
<p>${instance.description}</p>
<a href="${instance.url}" target="_blank">${instance.url}</a>
`;
instancesList.appendChild(instanceDiv);
});
}, 1000); // 1 second delay for demo purposes
});
</script>
</body>
</html>