-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
liked.html
138 lines (138 loc) · 5.94 KB
/
liked.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
<!doctype html>
<html lang="en">
<head>
<title>Favorites</title>
<link rel=”canonical” href=”https://webosu.online/”/>
<meta name="description" content="Take a look at all your favorite beatmaps on webosu!">
<link rel="icon" href="img/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/picnic.min.css">
<link rel="stylesheet"href="css/main.css">
<link rel="stylesheet"href="css/font.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&display=swap" rel="stylesheet">
<script src="js/launchgame.js"></script>
<script src="js/downloader.js"></script>
<script src="js/addbeatmaplist.js"></script>
<script src="js/settings.js"></script>
<script src="js/jsloader.js"></script>
<script src="js\lib\localforage.min.js"></script>
<script>console.log('localforage is: ', localforage);</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 Bar-->
<nav id="main-nav">
<div class="nav-link">
<a href="index.html" class="brand">webosu!</a>
<a href="new.html" class="pseudo button">New</a>
<a href="hot.html" class="pseudo button">Popular</a>
<a href="browse.html" class="pseudo button">Browse</a>
</div>
<div class="nav-search">
<form action="search.html">
<container id="searchbar" class="searchbar">
<input type="text" name="q" placeholder="Seach for beatmap or enter a Set ID" />
</container>
</form>
</div>
<div class="nav-tool">
<a href="liked.html" class="pseudo button">Favorites</a>
<a href="settings.html" class="pseudo button">Settings</a>
<input type="username" id="userreg" placeholder="Type your name" />
</div>
</nav>
<div class="main-page" id="main-page">
<div class="main-content">
<div class="announcement">
To save the username just type it in the top right & press enter! Join the <a href="https://discord.gg/v7wBtSdYzx">Discord</a> and share your scores!
</div>
<div class="announcement">
Thank you so much to everyone who has been involved with webosu!, especially Lemres who has kept this ship afloat for like 2 years while I did nothing lol
</div>
<br>
<div class="beatmap-list" id="beatmap-list">
<!-- to be filled in script -->
</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>
<!--Footer-->
<footer>
<div class="footer">
<div class="footer-infos">
<span class="footer-info">Join the <a href="https://discord.gg/v7wBtSdYzx">Discord server</a>!</span>
<span class="footer-info">Beatmap Mirror <a href="https://catboy.best/">Mino</a></span>
<span class="footer-info">Source code: <a href="https://github.com/BlaNKtext/webosu">Github></a></span>
</div>
</div>
</footer>
<script>
//Make enter work
var input = document.getElementById("userreg");
input.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
saveUser();
}
});
//Store username in localstorage
function saveUser( name ) {
var player = document.getElementById('userreg').value;
document.cookie = 'username=' + player;
console.log('Username saved!');
}
if (window.localforage) {
window.localforage.getItem("likedsidset", function (err, val) {
if (err) {
alert("Error loading liked beatmap list");
return;
}
if (val && val.size) {
function addlist(startOffset, maxLength) {
list = Array.from(val);
list.length = Math.min(list.length, startOffset + maxLength)
addBeatmapSids(list);
}
addlist(0, 1000);
let cur = 1000;
} else {
document.getElementById("beatmap-list").innerText =
"You haven't favorited any Beatmaps yet! Click on the heart in the lower right corner of the Beatmap to favorite it!";
}
});
} else {
alert("Oh no, localforage isn't supported on this browser")
}
</script>
</body>
</html>