-
Notifications
You must be signed in to change notification settings - Fork 0
/
mods.html
131 lines (113 loc) · 3.58 KB
/
mods.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mods</title>
<link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/RL2-API/RL2.ModLoader/main/Assets/ModLoaderIcon-NoText-700x700.png">
<link rel="stylesheet" href="styles/mods.css">
<link rel="stylesheet" href="styles/common.css">
<link rel="stylesheet" href="styles/links.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=JetBrains Mono'>
</head>
<body class="background base-layout">
<nav class="navbar margin-bottom-20-scalable">
|
<div class="navbar-element">
<a href="https://github.com/RL2-API/RL2.ModLoader/releases/latest" class="link">
<h2>Download</h2>
</a>
</div>
|
<div class="navbar-element">
<img src="https://raw.githubusercontent.com/RL2-API/RL2.ModLoader/main/Assets/ModLoaderIcon-NoText-700x700.png" class="icon-small"/>
  
<a href="/" class="link">
<h2>RL2.ModLoader</h2>
</a>
</div>
|
<div class="navbar-element">
<a href="/mods/" class="link">
<h2>Mods</h2>
</a>
</div>
|
</nav>
<!-- Main content -->
<main class="width-full">
<div class="width-full base-layout" id="mod-list"></div>
</main>
<!-- Footer -->
<footer>
<!-- Socials and shit -->
<hr class="width-250"/>
How to find us: <br>
<!-- YouTube channel -->
<a href="https://www.youtube.com/channel/UChKqsjhVlw6D7Wn03FCcmHg" class="accented youtube-link link">
Taco
</a>
 | 
<!-- GitHub account -->
<a href="https://www.github.com/RL2-API" class="accented github-link link">
RL2.API
</a>
 | 
<a href="/" class="accented website-link link">
Website
</a>
 | 
<a href="https://discord.com/invite/cellardoorgames" class="accented discord-link link">
CDG Discord server
</a>
</footer>
</body>
</html>
<!-- Delete later -->
<script type="module">
// SolidJS
import { createSignal, createEffect, createResource, For } from "https://esm.sh/solid-js@1.8.1";
import { render } from "https://esm.sh/solid-js@1.8.1/web";
import html from "https://esm.sh/solid-js@1.8.1/html";
const ModList = () => {
const [data] = createResource(
async () => {
const result = await fetch('https://rl2-modloader-db.onrender.com/mod-list');
return result.json();
}
);
const [filtered, filter] = createSignal([]);
const [search, setSearch] = createSignal('');
return () => html`
<div class='search'>
<img src='https://www.svgrepo.com/show/74695/magnifying-glass.svg' class='search'>
<input type='search' placeholder='Search...' onInput=${(e) => { setSearch(e.target.value);
filter(
search().length == 0 ? data() :
data().filter(item => item.name.toLowerCase().includes(search().toLowerCase()))
)
}} class='search'/>
</div>
<${For} each=${() => search().length == 0 ? data() : filtered()} fallback=${html`<h2 class='loading'>Loading...</h2>`}>
${(item) => html`
<article class="mod margin-5-scalable" onClick=${(e) => window.location = '/mod?name=' + item.name }>
<div class="icon paddingless margin-10-scalable">
<img src="${item.icon_src}" class="icon"/>
</div>
<div class="details width-full margin-10">
<div class="title">
<p class="size-big-scalable marginless">${item.name}</p>
<p class="width-full left-aligned margin-10"> by ${item.author}</p>
</div>
<div class="description left-aligned">
${item.description}
</div>
</div>
</article>
`
}
`;
};
render(ModList, document.getElementById("mod-list"));
</script>