Skip to content

Commit 4ae1ac3

Browse files
committed
V5.2.1 - Fixed Tabs Bugs + Reduced Size + Merged Apps & Games Scripts + Formatted
1 parent a8e5fc5 commit 4ae1ac3

File tree

14 files changed

+334
-686
lines changed

14 files changed

+334
-686
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"semi": false,
55
"singleQuote": false,
66
"bracketSameLine": true,
7-
"printWidth": 120
7+
"printWidth": 140
88
}

static/apps.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1313
<link rel="stylesheet" href="/assets/styles/main.css?v=8" />
1414
<link rel="stylesheet" href="/assets/styles/global.css?v=8" />
15-
<script src="/assets/scripts/m.js?v=52"></script>
16-
<script src="/assets/scripts/i.js?v=38"></script>
15+
<script src="/assets/scripts/m.js?v=54"></script>
16+
<script src="/assets/scripts/i.js?V=42"></script>
1717
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
18-
<script src="assets/scripts/ap.js?v=60"></script>
18+
<script src="assets/scripts/ap.js?v=90"></script>
1919
</head>
2020
<body>
2121
<div class="fixed-nav-bar"></div>
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="pinned-apps"></div>
4040
<div class="container-apps"></div>
41-
<script src="/assets/scripts/m.js?v=52"></script>
41+
<script src="/assets/scripts/m.js?v=54"></script>
4242
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
4343
<!-- DO NOT REMOVE-->
4444
<script>

static/assets/scripts/ap.js

Lines changed: 153 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let appInd
2-
2+
let g = window.location.pathname === "/gm"
3+
let t = window.location.pathname === "/ta"
34
function saveToLocal(path) {
45
sessionStorage.setItem("GoUrl", path)
56
}
@@ -12,9 +13,15 @@ function handleClick(app) {
1213
if (app.local) {
1314
saveToLocal(app.link)
1415
window.location.href = "ta"
16+
if (t) {
17+
window.location.href = app.link
18+
}
1519
} else if (app.local2) {
1620
saveToLocal(app.link)
1721
window.location.href = app.link
22+
if (t) {
23+
window.location.href = app.link
24+
}
1825
} else if (app.blank) {
1926
blank(app.link)
2027
} else if (app.now) {
@@ -25,13 +32,20 @@ function handleClick(app) {
2532
dy(app.link)
2633
} else {
2734
go(app.link)
35+
if (t) {
36+
blank(app.link)
37+
}
2838
}
29-
3039
return false
3140
}
3241

3342
function CustomApp(customApp) {
34-
let apps = localStorage.getItem("Acustom")
43+
let apps
44+
if (g) {
45+
apps = localStorage.getItem("Gcustom")
46+
} else {
47+
apps = localStorage.getItem("Acustom")
48+
}
3549

3650
if (apps === null) {
3751
apps = {}
@@ -43,15 +57,22 @@ function CustomApp(customApp) {
4357

4458
apps[key] = customApp
4559

46-
localStorage.setItem("Acustom", JSON.stringify(apps))
60+
if (g) {
61+
localStorage.setItem("Gcustom", JSON.stringify(apps))
62+
} else {
63+
localStorage.setItem("Acustom", JSON.stringify(apps))
64+
}
4765
}
4866

4967
function setPin(index) {
50-
let pins = localStorage.getItem("Apinned")
51-
if (pins == null) {
52-
pins = []
68+
let pins
69+
if (g) {
70+
pins = localStorage.getItem("Gpinned")
71+
} else {
72+
pins = localStorage.getItem("Apinned")
5373
}
54-
if (pins == "") {
74+
75+
if (pins === null || pins === "") {
5576
pins = []
5677
} else {
5778
pins = pins.split(",").map(Number)
@@ -62,7 +83,11 @@ function setPin(index) {
6283
} else {
6384
pins.push(index)
6485
}
65-
localStorage.setItem("Apinned", pins)
86+
if (g) {
87+
localStorage.setItem("Gpinned", pins)
88+
} else {
89+
localStorage.setItem("Apinned", pins)
90+
}
6691
location.reload()
6792
}
6893

@@ -141,134 +166,146 @@ function initializeCustomApp(customApp) {
141166
}
142167

143168
document.addEventListener("DOMContentLoaded", () => {
144-
const storedApps = JSON.parse(localStorage.getItem("Acustom"))
169+
let storedApps
170+
if (g) {
171+
storedApps = JSON.parse(localStorage.getItem("Gcustom"))
172+
} else {
173+
storedApps = JSON.parse(localStorage.getItem("Acustom"))
174+
}
145175
if (storedApps) {
146176
Object.values(storedApps).forEach((app) => {
147177
initializeCustomApp(app)
148178
})
149179
}
180+
})
150181

151-
fetch("/assets/json/a.min.json")
152-
.then((response) => {
153-
return response.json()
182+
let path = "/assets/json/a.min.json"
183+
if (g) {
184+
path = "/assets/json/g.min.json"
185+
} else {
186+
path = "/assets/json/a.min.json"
187+
}
188+
fetch(path)
189+
.then((response) => {
190+
return response.json()
191+
})
192+
.then((appsList) => {
193+
appsList.sort((a, b) => {
194+
if (a.name.startsWith("[Custom]")) return -1
195+
if (b.name.startsWith("[Custom]")) return 1
196+
return a.name.localeCompare(b.name)
154197
})
155-
.then((appsList) => {
156-
appsList.sort((a, b) => {
157-
if (a.name.startsWith("[Custom]")) return -1
158-
if (b.name.startsWith("[Custom]")) return 1
159-
return a.name.localeCompare(b.name)
160-
})
161-
const nonPinnedApps = document.querySelector(".container-apps")
162-
const pinnedApps = document.querySelector(".pinned-apps")
198+
const nonPinnedApps = document.querySelector(".container-apps")
199+
const pinnedApps = document.querySelector(".pinned-apps")
200+
if (g) {
201+
var pinList = localStorage.getItem("Gpinned") || ""
202+
} else {
163203
var pinList = localStorage.getItem("Apinned") || ""
164-
pinList = pinList ? pinList.split(",").map(Number) : []
165-
appInd = 0
166-
167-
appsList.forEach((app) => {
168-
if (app.categories && app.categories.includes("local")) {
169-
app.local = true
170-
} else if (app.link && (app.link.includes("now.gg") || app.link.includes("nowgg.me"))) {
171-
if (app.partial === null || app.partial === undefined) {
172-
app.partial = true
173-
app.say = "Now.gg is currently not working for some users."
174-
}
175-
} else if (app.link && app.link.includes("nowgg.nl")) {
176-
if (app.error === null || app.error === undefined) {
177-
app.error = true
178-
app.say = "NowGG.nl is currently down."
179-
}
204+
}
205+
pinList = pinList ? pinList.split(",").map(Number) : []
206+
appInd = 0
207+
208+
appsList.forEach((app) => {
209+
if (app.categories && app.categories.includes("local")) {
210+
app.local = true
211+
} else if (app.link && (app.link.includes("now.gg") || app.link.includes("nowgg.me"))) {
212+
if (app.partial === null || app.partial === undefined) {
213+
app.partial = true
214+
app.say = "Now.gg is currently not working for some users."
180215
}
181-
182-
let pinNum = appInd
183-
184-
const columnDiv = document.createElement("div")
185-
columnDiv.classList.add("column")
186-
columnDiv.setAttribute("data-category", app.categories.join(" "))
187-
188-
const pinIcon = document.createElement("i")
189-
pinIcon.classList.add("fa", "fa-map-pin")
190-
pinIcon.ariaHidden = true
191-
192-
const btn = document.createElement("button")
193-
btn.appendChild(pinIcon)
194-
btn.style.float = "right"
195-
btn.style.backgroundColor = "rgb(45,45,45)"
196-
btn.style.borderRadius = "50%"
197-
btn.style.borderColor = "transparent"
198-
btn.style.color = "white"
199-
btn.style.top = "-200px"
200-
btn.style.position = "relative"
201-
btn.onclick = function () {
202-
setPin(pinNum)
216+
} else if (app.link && app.link.includes("nowgg.nl")) {
217+
if (app.error === null || app.error === undefined) {
218+
app.error = true
219+
app.say = "NowGG.nl is currently down."
203220
}
204-
btn.title = "Pin"
205-
206-
const link = document.createElement("a")
207-
208-
link.onclick = function () {
209-
handleClick(app)
221+
}
222+
223+
let pinNum = appInd
224+
225+
const columnDiv = document.createElement("div")
226+
columnDiv.classList.add("column")
227+
columnDiv.setAttribute("data-category", app.categories.join(" "))
228+
229+
const pinIcon = document.createElement("i")
230+
pinIcon.classList.add("fa", "fa-map-pin")
231+
pinIcon.ariaHidden = true
232+
233+
const btn = document.createElement("button")
234+
btn.appendChild(pinIcon)
235+
btn.style.float = "right"
236+
btn.style.backgroundColor = "rgb(45,45,45)"
237+
btn.style.borderRadius = "50%"
238+
btn.style.borderColor = "transparent"
239+
btn.style.color = "white"
240+
btn.style.top = "-200px"
241+
btn.style.position = "relative"
242+
btn.onclick = function () {
243+
setPin(pinNum)
244+
}
245+
btn.title = "Pin"
246+
247+
const link = document.createElement("a")
248+
249+
link.onclick = function () {
250+
handleClick(app)
251+
}
252+
253+
const image = document.createElement("img")
254+
image.width = 145
255+
image.height = 145
256+
image.src = app.image
257+
image.loading = "lazy"
258+
259+
const paragraph = document.createElement("p")
260+
paragraph.textContent = app.name
261+
262+
if (app.error) {
263+
paragraph.style.color = "red"
264+
if (!app.say) {
265+
app.say = "This app is currently not working."
210266
}
211-
212-
const image = document.createElement("img")
213-
image.width = 145
214-
image.height = 145
215-
image.src = app.image
216-
image.loading = "lazy"
217-
218-
const paragraph = document.createElement("p")
219-
paragraph.textContent = app.name
220-
221-
if (app.error) {
222-
paragraph.style.color = "red"
223-
if (!app.say) {
224-
app.say = "This app is currently not working."
225-
}
226-
} else if (app.load) {
227-
paragraph.style.color = "yellow"
228-
if (!app.say) {
229-
app.say = "This app may experience excessive loading times."
230-
}
231-
} else if (app.partial) {
232-
paragraph.style.color = "yellow"
233-
if (!app.say) {
234-
app.say =
235-
"This app is currently experiencing some issues, it may not work for you. (Dynamic doesn't work in about:blank)"
236-
}
267+
} else if (app.load) {
268+
paragraph.style.color = "yellow"
269+
if (!app.say) {
270+
app.say = "This app may experience excessive loading times."
271+
}
272+
} else if (app.partial) {
273+
paragraph.style.color = "yellow"
274+
if (!app.say) {
275+
app.say = "This app is currently experiencing some issues, it may not work for you. (Dynamic doesn't work in about:blank)"
237276
}
277+
}
238278

239-
link.appendChild(image)
240-
link.appendChild(paragraph)
241-
columnDiv.appendChild(link)
279+
link.appendChild(image)
280+
link.appendChild(paragraph)
281+
columnDiv.appendChild(link)
242282

243-
if (appInd != 0) {
244-
columnDiv.appendChild(btn)
245-
}
283+
if (appInd != 0) {
284+
columnDiv.appendChild(btn)
285+
}
246286

247-
if (pinList != null && appInd != 0) {
248-
if (pinContains(appInd, pinList)) {
249-
pinnedApps.appendChild(columnDiv)
250-
} else {
251-
nonPinnedApps.appendChild(columnDiv)
252-
}
287+
if (pinList != null && appInd != 0) {
288+
if (pinContains(appInd, pinList)) {
289+
pinnedApps.appendChild(columnDiv)
253290
} else {
254291
nonPinnedApps.appendChild(columnDiv)
255292
}
256-
appInd++
257-
})
258-
259-
const appsContainer = document.getElementById("apps-container")
260-
appsContainer.appendChild(pinnedApps)
261-
appsContainer.appendChild(nonPinnedApps)
293+
} else {
294+
nonPinnedApps.appendChild(columnDiv)
295+
}
296+
appInd++
262297
})
263-
.catch((error) => {
264-
console.error("Error fetching JSON data:", error)
265-
})
266-
})
298+
299+
const appsContainer = document.getElementById("apps-container")
300+
appsContainer.appendChild(pinnedApps)
301+
appsContainer.appendChild(nonPinnedApps)
302+
})
303+
.catch((error) => {
304+
console.error("Error fetching JSON data:", error)
305+
})
267306

268307
function show_category() {
269-
var selectedCategories = Array.from(document.querySelectorAll("#category option:checked")).map(
270-
(option) => option.value
271-
)
308+
var selectedCategories = Array.from(document.querySelectorAll("#category option:checked")).map((option) => option.value)
272309
var games = document.getElementsByClassName("column")
273310

274311
for (var i = 0; i < games.length; i++) {

0 commit comments

Comments
 (0)