-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
165 lines (139 loc) · 6.95 KB
/
index.html
File metadata and controls
165 lines (139 loc) · 6.95 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
<html>
<head>
<link rel='shortcut icon' type='image/x-icon' href='./beepboxModding.png' />
<!-- CDN for jQuery and select2 -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/imperative-html@0.1/dist/global/elements.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/alwan/dist/js/alwan.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alwan/dist/css/alwan.min.css" />
<script src="https://cdn.jsdelivr.net/gh/mmig/opus-encdec@e33ca40/dist/libopus-encoder.js"></script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BeepBox Launchpad</title>
<meta name="application-name" property="BeepBox Launchpad" />
<meta name="apple-mobile-web-app-title" content="BeepBox Launchpad">
<meta name="description" content="BeepBox Launchpad is a launcher that will send you to BeepBox Mods without hassle." />
<meta name="keywords" content="chiptune, instrumental, music, song, melody, composition, tool, free, online, square wave, NES, NSF, abyssbox, ultrabox, beepbox, jummbox, pandorasbox, modbox, sandbox, goldbox, wackybox, todbox" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="theme-color" content="#9a6bff" />
<meta name="msapplication-TileColor" content="#9a6bff" />
<meta name="msapplication-config" content="/browserconfig.xml" />
<meta name="format-detection" content="telephone=no" />
<link rel="apple-touch-icon" sizes="180x180" href="./beepboxModding.png" />
<link rel="icon" type="image/png" sizes="32x32" href="./beepboxModding.png" />
<link href="https://fonts.googleapis.com/css?family=B612" rel="stylesheet" media="none" onload="if (this.media != 'all') this.media='all';" /> <!-- this is a trick to load CSS asynchronously. -->
<!-- <link rel="stylesheet" href="./themes.css" id="stylesheet" /> -->
<link rel="stylesheet" href="./main.css" />
</head>
<body>
<div class="headerBorder">
<div id="header">
<div id="searchbarContainer">
<input list="tags" class="searchbar" id="searchbar" placeholder="Search For Mods" oninput="searchForMod(document.getElementById('searchbar').value)"/>
<div class="shareButton" onclick="shareURL(document.getElementById('searchbar').value)">
<div class="copyText" id="copyText"></div>
</div>
</div>
<div id="sortContainer">
</div>
</div>
<datalist id="tags">
</datalist>
<div class="websiteTitle" onclick="window.open(`https://github.com/beepbox-launchpad/beepbox-launchpad.github.io`, `_blank`)">BeepBox Launchpad</div>
</div>
<div class="mainContent">
<div class="contentBorder">
<div class="buttonContainer">
<button id="modsListButton" class="logoButton" onclick="switchView(1)" >
<button id="favoritesListButton" class="logoButton" onclick="switchView(2)">
</div>
<button id="preferenceButton" class="prefButton" onclick="displayPrompt('preferencesPrompt')">
</div>
<div id="modContainer">
<!-- Append Mods here -->
</div>
</div>
<div class="promptContainerBG" id="promptContainerBG">
<div class="prompt" id="prompt">
<!-- Append Prompts here -->
</div>
</div>
<script type="module" src="./main.js"></script>
<script>
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|android|ipad|playbook|silk/i.test(navigator.userAgent)) {
// https://stackoverflow.com/questions/11833759/add-stylesheet-to-head-using-javascript-in-body
var head = document.head;
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = "./mobile.css";
head.appendChild(link);
}
var favoritesList = new Array();
var storedfavoritesList = localStorage.getItem("favoritesList");
if (storedfavoritesList != null) {
favoritesList = JSON.parse(storedfavoritesList);
}
function goToWebsite(websiteLink, hasUniqueVers = false) {
if (hasUniqueVers == false) {
window.open(websiteLink, '_blank');
} else {
displayPrompt(websiteLink)
}
}
document.getElementById("modsListButton").style.filter = "brightness(150%)";
function favoriteBeepmod(modName) {
const index = favoritesList.indexOf(modName);
if (index > -1) {
favoritesList.splice(index, 1);
} else {
favoritesList.push(modName);
}
window.localStorage.setItem("favoritesList", JSON.stringify(favoritesList));
}
function displayPrompt(promptName) {
const promptBg = document.getElementById("promptContainerBG");
promptBg.style.display = "flex";
document.getElementById(promptName).style.display = "flex";
}
function closePrompt(promptName) {
const promptBg = document.getElementById("promptContainerBG");
promptBg.style.display = "none";
document.getElementById(promptName).style.display = "none";
}
function closePromptOnEscape (promptName) {
const promptBg = document.getElementById("promptContainerBG");
const prompt = document.getElementById("prompt");
let children = prompt.children;
if(promptName.key === "Escape") {
promptBg.style.display = "none";
for (var i = 0; i < children.length; i++) {
children[i].style.display = "none";
}
}
}
document.addEventListener("keydown", closePromptOnEscape)
const copyText = document.getElementById("copyText");
const fade = [
{ top: "36px", opacity: "100%" },
{ top: "40px", opacity: "0%" }
];
const fadeTiming = {
duration: 3000,
iterations: 1,
};
function shareURL(result) {
result = result.replace(" ", "%20");
window.history.replaceState(null, "", location.pathname + "#s=" + result);
navigator.clipboard.writeText(window.location);
copyText.animate(fade, fadeTiming);
}
</script>
</body>
</html>