-
Notifications
You must be signed in to change notification settings - Fork 1
/
genre.html
156 lines (150 loc) · 6.93 KB
/
genre.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
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Genre - ElectrOsu!web</title>
<link rel="stylesheet" href="style/picnic.min.css">
<link rel="stylesheet" type="text/css" href="style/main.css">
<link rel="stylesheet" type="text/css" href="style/font.css">
<link rel="icon" href="favicon.png">
<script src="scripts/launchgame.js"></script>
<script src="scripts/downloader.js"></script>
<script src="scripts/addbeatmaplist.js"></script>
<script src="scripts/settings.js"></script>
<script src="scripts/jsloader.js"></script>
</head>
<body>
<div class="game-area" id="game-area" hidden>
</div>
<div class="pause-menu" id="pause-menu" hidden>
<div class="paused-title">paused</div>
<div class="button-list">
<div class="pausebutton continue" id="pausebtn-continue">
<div class="inner">Continue</div>
</div>
<div class="pausebutton retry" id="pausebtn-retry">
<div class="inner">Retry</div>
</div>
<div class="pausebutton quit" id="pausebtn-quit">
<div class="inner">Quit</div>
</div>
</div>
</div>
<nav id="main-nav">
<div class="nav-link">
<a href="index.html" class="brand">ElectrOsu!web</a>
<a href="new.html" class="pseudo button">New</a>
<a href="hot.html" class="pseudo button">Hot</a>
<a href="genre.html" class="pseudo button active">Genre</a>
</div>
<div class="nav-search">
<form action="search.html">
<input type="text" name="q" placeholder="Beatmap id (bancho)"/>
<input type="image" class="search-button" src="research.svg">
</form>
</div>
<div class="nav-tool">
<a href="local.html" class="pseudo button">Saved</a>
<a href="faq.html" class="pseudo button">FAQ</a>
<a href="settings.html" class="pseudo button">Settings</a>
<a onclick="document.documentElement.requestFullscreen();" class="pseudo button">进入全屏</a>
</div>
</nav>
<div class="main-page" id="main-page">
<div class="main-content">
<div class="sort-nav">
<div class="title">Genre</div>
<div class="selitem" genre="1">All</div>
<div class="selitem" genre="4">Game</div>
<div class="selitem" genre="8">Anime</div>
<div class="selitem" genre="16">Rock and roll</div>
<div class="selitem" genre="32">popular</div>
<div class="selitem" genre="128">New</div>
<div class="selitem" genre="1024">Electronic</div>
<div class="selitem" genre="2+64+256">Other</div>
</div>
<div class="sort-nav">
<div class="title">Language</div>
<div class="selitem" lang="1">All</div>
<div class="selitem" lang="16">Chinese</div>
<div class="selitem" lang="4">English</div>
<div class="selitem" lang="8">Japanese</div>
<div class="selitem" lang="32">Instrumental</div>
<div class="selitem" lang="64">Korean</div>
<div class="selitem" lang="128">French</div>
<div class="selitem" lang="256">German</div>
<div class="selitem" lang="2048">Italian</div>
<div class="selitem" lang="512">Swedish</div>
<div class="selitem" lang="2+1024">Other</div>
</div>
<hr>
<div class="beatmap-list" id="beatmap-list">
<!-- to be filled in script -->
</div>
<div class="button" style="width:100%; margin-bottom: 10px;" id="btnmore">More Beatmap</div>
<div class="text">Using firefox and chrome is recommended. -Electro</div>
<div class="text">Alpha v1.0.0 <a href="">On Github (private repo)</a></div>
<div class="text">Beatmaps are provided by <a href="https://osu.sayobot.cn/">Sayobot.</a></div>
</div>
<!-- <div class="side-panel">
to be activated in script
</div> -->
<div class="statuslines" id="statuslines">
<div class="progress" id="script-progress">
Scripts
<div class="lds-dual-ring"></div>
</div>
<div class="progress" id="skin-progress">
Skin
<div class="lds-dual-ring"></div>
</div>
<div class="progress" id="sound-progress">
Hitsounds
<div class="lds-dual-ring"></div>
</div>
</div>
</div>
<script>
let btns = document.getElementsByClassName("selitem");
function search(genre, lang) {
// clear list
list = document.getElementById("beatmap-list");
while (list.firstChild) {
list.removeChild(list.firstChild);
}
addBeatmapList("https://api.sayobot.cn/beatmaplist?0=20&1=0&2=4&5=1&7=" + genre + "&8=" + lang);
var cur = 20;
document.getElementById("btnmore").onclick = function() {
addBeatmapList("https://api.sayobot.cn/beatmaplist?0=20&1="+cur+"&2=4&5=1&7=" + genre + "&8=" + lang);
cur += 20;
}
// update buttons state
for (let i=0; i<btns.length; ++i) {
let g = eval(btns[i].getAttribute("genre"));
let l = eval(btns[i].getAttribute("lang"));
if (g==genre || l==lang) {
btns[i].classList.add("active");
}
else {
btns[i].classList.remove("active");
}
}
}
let curgenre = 1;
let curlang = 1;
search(curgenre, curlang);
for (let i=0; i<btns.length; ++i) {
btns[i].onclick = function() {
let g = eval(btns[i].getAttribute("genre"));
let l = eval(btns[i].getAttribute("lang"));
if (g) curgenre = g;
if (l) curlang = l;
search(curgenre, curlang);
}
}
</script>
</body>
</html>
<!-- attribution -->
<!-- play icon made by https://www.flaticon.com/authors/those-icons -->
<!-- search icon made by https://www.flaticon.com/authors/good-ware -->