-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathindex.html
More file actions
207 lines (190 loc) · 6.79 KB
/
index.html
File metadata and controls
207 lines (190 loc) · 6.79 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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GZ2M72GJ5S"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-GZ2M72GJ5S');
</script>
<meta charset="utf-8" />
<title>WebOsu 2.0!</title>
<meta name="description"
content="Play WebOsu – A browser-based rhythm game inspired by osu!std. Experience fast-paced gameplay with an extensive beatmap library. No downloads, play free online now!">
<link rel="canonical" href="http://webosu-2.github.io/" />
<link rel="stylesheet" href="style/picnic.min.css" />
<link rel="stylesheet" type="text/css" href="style/main.css" />
<!-- <link href="//fonts.googleapis.com/css?family=Exo+2:400,600italic" rel="stylesheet" type="text/css"> -->
<link rel="stylesheet" type="text/css" href="style/font.css" />
<link rel="icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<script src="scripts/config.js"></script>
<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>
<script src="scripts/lib/localforage.min.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">
</nav>
<script>
fetch("navbar.html")
.then(response => response.text())
.then(content => {
document.getElementById("main-nav").innerHTML = content;
});
</script>
<div class="main-page" id="main-page">
<div class="column left">
</div>
<div class="main-content column">
<div class="announcement">
Announcement: This site is still under development. If you encounter
any issues, read <a href="faq.html">the FAQ</a>. Now ad-free again!
</div>
<br />
<div class="index-area">
<a onclick="genRandomList()" class="more" style="cursor:pointer;">Get new random Beatmaps</a>
<h2>Random Beatmaps<h2>
<hr />
<div class="beatmap-list" id="beatmap-list-random">
<!-- to be filled in script -->
</div>
</div>
<div class="index-area">
<h2>Latest Beatmaps</h2>
<a href="latest.html" class="more">View more latest beatmaps</a>
<hr />
<div class="beatmap-list" id="beatmap-list-new">
<!-- to be filled in script -->
</div>
</div>
<div class="index-area">
<h2>Favourited Beatmaps</h2>
<a href="favourites.html" class="more">View more favourited beatmaps</a>
<hr />
<div class="beatmap-list" id="beatmap-list-liked">
<!-- to be filled in script -->
</div>
</div>
<div class="index-area">
<h2>Popular Beatmaps</h2>
<a href="popular.html" class="more">View more popular beatmaps</a>
<hr />
<div class="beatmap-list" id="beatmap-list-hot">
<!-- to be filled in script -->
</div>
</div>
<footer id="footer"></footer>
<script>
fetch("footer.html")
.then(response => response.text())
.then(content => {
document.getElementById("footer").innerHTML = content;
});
</script>
</div>
<div class="column right">
</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>
// recently played
if (window.localforage) {
let listhistory = document.getElementById("beatmap-list-history");
localforage.getItem("playhistory1000", function (err, item) {
if (err) {
listhistory.innerText = "Could not fetch play history.";
return;
}
if (item && item.length) {
item = item.reverse();
sid = [];
for (let i = 0; i < item.length; ++i) {
if (item[i].sid)
sid.push(item[i].sid);
}
sid = [...new Set(sid)]; // uniq
for (let i = 0; i < 4 && i < sid.length; ++i)
addBeatmapSid(sid[i], listhistory)
}
else {
listhistory.innerText = "Play any beatmap to add them here.";
}
})
}
// new
addBeatmapList("https://api.sayobot.cn/beatmaplist?0=20&1=0&2=2&5=1",
document.getElementById("beatmap-list-new"),
function (t) { return (t.modes & 1) != 0; }, 4);
// random
function genRandomList() {
// clear list
let list = document.getElementById("beatmap-list-random");
// fill list
let randstart = Math.floor(Math.random() * 20000);
addBeatmapList("https://api.sayobot.cn/beatmaplist?0=10&1=" + randstart + "&2=1&5=1", list,
function (t) { while (list.firstChild) list.removeChild(list.firstChild); return (t.modes & 1) != 0; }, 4);
}
genRandomList();
// hot
addBeatmapList("https://api.sayobot.cn/beatmaplist?0=4&1=0&2=1&5=1", document.getElementById("beatmap-list-hot"));
// liked
if (window.localforage) {
window.localforage.getItem("likedsidset", function (err, val) {
if (err) {
document.getElementById("beatmap-list-liked").innerText = "Could not get liked beatmaps.";
return;
}
if (val && val.size) {
let listlike = document.getElementById("beatmap-list-liked");
list = Array.from(val);
for (let i = 0; i < list.length && i < 4; ++i)
addBeatmapSid(list[i], listlike);
}
else {
document.getElementById("beatmap-list-liked").innerText = "Heart any beatmap to add them here.";
}
});
}
else {
alert("localforage not supported")
}
</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 -->