-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
108 lines (100 loc) · 3.43 KB
/
script.js
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
document.addEventListener('DOMContentLoaded', function () {
const themeData = [
{
name: "Windows XP",
author: "gaypotatoemma",
image: "themes/Windows XP/windowsxp.png",
htmlFile: "themes/Windows XP/windowsxp.html"
},
{
name: "Windows 98",
author: "gaypotatoemma",
image: "themes/Windows 98/windows98.png",
htmlFile: "themes/Windows 98/windows98.html"
},
{
name: "Ubuntu",
author: "gaypotatoemma",
image: "themes/Ubuntu/ubuntu.png",
htmlFile: "themes/Ubuntu/ubuntu.html"
},
{
name: "Aetheris UI",
author: "bonsaibnuuy",
image: "themes/Aetheris UI/aetherisui.png",
htmlFile: "themes/Aetheris UI/aetherisui.html"
},
{
name: "FrostUI Purple",
author: "zanthana",
image: "themes/FrostUI Purple/frostui.png",
htmlFile: "themes/FrostUI Purple/frostui.html"
},
{
name: "Catppuccin Mocha",
author: "fmauneko",
image: "themes/Catppuccin Mocha/catppuccinmocha.png",
htmlFile: "themes/Catppuccin Mocha/catppuccinmocha.html"
},
{
name: "Vanilla UI - Dark",
author: "legiana",
image: "themes/Vanilla UI - Dark/vanillauidark.png",
htmlFile: "themes/Vanilla UI - Dark/vanillauidark.html"
},
{
name: "Anna Theme (Kirin Edit)",
author: "serenkumara",
image: "themes/Anna Theme (Kirin Edit)/annathemekirinedit.png",
htmlFile: "themes/Anna Theme (Kirin Edit)/annathemekirinedit.html"
},
{
name: "Transparent Toolbar and Black Settings",
author: "realraiden",
image: "themes/Transparent Toolbar and Black Settings/transparentandblack.png",
htmlFile: "themes/Transparent Toolbar and Black Settings/transparentandblack.html"
},
{
name: "Material UI",
author: "cptn_cosmo",
image: "themes/Material UI/materialui.png",
htmlFile: "themes/Material UI/materialui.html"
},
{
name: "Material UI - Dark Red",
author: "fabunova",
image: "themes/Material UI - Dark Red/materialuidarkred.png",
htmlFile: "themes/Material UI - Dark Red/materialuidarkred.html"
},
{
name: "Discord",
author: "gaypotatoemma",
image: "themes/Discord/discord.png",
htmlFile: "themes/Discord/discord.html"
}
];
const themeGrid = document.getElementById('theme-grid');
function displayThemes(themes) {
themeGrid.innerHTML = '';
themes.forEach(theme => {
const themeElement = document.createElement('a');
themeElement.href = theme.htmlFile; themeElement.classList.add('theme-card');
const imageElement = document.createElement('img');
imageElement.src = theme.image;
imageElement.alt = theme.name;
themeElement.appendChild(imageElement);
const titleElement = document.createElement('h2');
titleElement.textContent = theme.name;
themeElement.appendChild(titleElement);
themeGrid.appendChild(themeElement);
});
}
themeData.sort((a, b) => {
const nameA = a.name.toLowerCase();
const nameB = b.name.toLowerCase();
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
return 0;
});
displayThemes(themeData);
});