Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 6e7767c

Browse files
Formatting for tabs
1 parent 2eef91c commit 6e7767c

File tree

16 files changed

+429
-411
lines changed

16 files changed

+429
-411
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ docker-compose.yml
3131
*.htpasswd
3232

3333
/public/ruby-assets/
34+
/public/chrome-tabs/
35+
/src/pages/tabs.astro

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ This is our second edition of [Ruby](https://github.com/ruby-network/ruby-v1). T
7070
- [Dynamic Interception Proxy (DIP)](https://github.com/Dynamic-Interception-Proxy/DIP)
7171
- [Osana](https://github.com/nebulaservices/osana)
7272
- [aero](https://github.com/nebulaservices/aero) **NOTE: aero is unstable and may cause issues** (We currently use our own [fork](https://github.com/ruby-network/aero))
73+
7374
---
7475

7576
- Basic Password protection for the website (you can set a password in the settings page)

public/aero-sw.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import handle from "./aero/handle.js";
2-
import "./aero/init.js";
1+
import handle from './aero/handle.js';
2+
import './aero/init.js';
33

4-
self.addEventListener("fetch", (event) => {
4+
self.addEventListener('fetch', (event) => {
55
if (event.request.url.startsWith(location.origin + '/go/'))
6-
event.respondWith(handle(event).catch(err => new Response(err.stack, { status: 500 })))
6+
event.respondWith(
7+
handle(event).catch(
8+
(err) => new Response(err.stack, { status: 500 })
9+
)
10+
);
711
});

public/assets/games.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"img": "/assets/games-thumb/tanktrouble.webp",
211211
"baseFile": "index.html",
212212
"name": "Tank Trouble 2",
213-
"tags": ["arcade", "shooter", "strategy", "static"],
213+
"tags": ["arcade", "shooter", "strategy", "static"],
214214
"cdn": "false",
215215
"proxy": "false",
216216
"url": ""

public/js/appSuggestions.js

Lines changed: 117 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -3,158 +3,149 @@ const adress = document.getElementById('uv-address');
33
window.onload = function () {
44
if (window.location.hash === '#discord') {
55
if (localStorage.getItem('reloaded') !== 'true')
6-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
7-
window.location.replace('/tabs#discord')
8-
}
9-
else {
6+
if (
7+
localStorage.getItem('tabs') === 'true' &&
8+
window === window.top
9+
) {
10+
window.location.replace('/tabs#discord');
11+
} else {
1012
adress.value = 'https://discord.com/login';
1113
form.dispatchEvent(new Event('submit'));
1214
}
13-
}
14-
}
15-
if (window.location.hash === '#youtube') {
16-
if (localStorage.getItem('reloaded') !== 'true') {
17-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
18-
window.location.replace('/tabs#youtube')
19-
}
20-
else {
21-
adress.value = 'https://youtube.com';
22-
form.dispatchEvent(new Event('submit'));
23-
}
24-
}
2515
}
26-
if (window.location.hash === '#twitter') {
27-
if (localStorage.getItem('reloaded') !== 'true') {
28-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
29-
window.location.replace('/tabs#twitter')
30-
}
31-
else {
32-
adress.value = 'https://twitter.com/';
33-
form.dispatchEvent(new Event('submit'));
34-
}
16+
};
17+
if (window.location.hash === '#youtube') {
18+
if (localStorage.getItem('reloaded') !== 'true') {
19+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
20+
window.location.replace('/tabs#youtube');
21+
} else {
22+
adress.value = 'https://youtube.com';
23+
form.dispatchEvent(new Event('submit'));
3524
}
3625
}
37-
if (window.location.hash === '#google') {
38-
if (localStorage.getItem('reloaded') !== 'true') {
39-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
40-
window.location.replace('/tabs#google')
41-
}
42-
else {
43-
adress.value = 'https://google.com/';
44-
form.dispatchEvent(new Event('submit'));
45-
}
26+
}
27+
if (window.location.hash === '#twitter') {
28+
if (localStorage.getItem('reloaded') !== 'true') {
29+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
30+
window.location.replace('/tabs#twitter');
31+
} else {
32+
adress.value = 'https://twitter.com/';
33+
form.dispatchEvent(new Event('submit'));
4634
}
4735
}
48-
if (window.location.hash === '#twitch') {
49-
if (localStorage.getItem('reloaded') !== 'true') {
50-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
51-
window.location.replace('/tabs#twitch')
52-
}
53-
else {
54-
adress.value = 'https://twitch.tv/';
55-
form.dispatchEvent(new Event('submit'));
56-
}
36+
}
37+
if (window.location.hash === '#google') {
38+
if (localStorage.getItem('reloaded') !== 'true') {
39+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
40+
window.location.replace('/tabs#google');
41+
} else {
42+
adress.value = 'https://google.com/';
43+
form.dispatchEvent(new Event('submit'));
5744
}
5845
}
59-
if (window.location.hash === '#reddit') {
60-
if (localStorage.getItem('reloaded') !== 'true') {
61-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
62-
window.location.replace('/tabs#reddit')
63-
}
64-
else {
65-
adress.value = 'https://reddit.com/';
66-
form.dispatchEvent(new Event('submit'));
67-
}
46+
}
47+
if (window.location.hash === '#twitch') {
48+
if (localStorage.getItem('reloaded') !== 'true') {
49+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
50+
window.location.replace('/tabs#twitch');
51+
} else {
52+
adress.value = 'https://twitch.tv/';
53+
form.dispatchEvent(new Event('submit'));
6854
}
6955
}
70-
if (window.location.hash === '#spotify') {
71-
if (localStorage.getItem('reloaded') !== 'true') {
72-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
73-
window.location.replace('/tabs#spotify')
74-
}
75-
else {
76-
adress.value = 'https://open.spotify.com/';
77-
form.dispatchEvent(new Event('submit'));
78-
}
56+
}
57+
if (window.location.hash === '#reddit') {
58+
if (localStorage.getItem('reloaded') !== 'true') {
59+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
60+
window.location.replace('/tabs#reddit');
61+
} else {
62+
adress.value = 'https://reddit.com/';
63+
form.dispatchEvent(new Event('submit'));
7964
}
8065
}
81-
if (window.location.hash === '#geforce') {
82-
if (localStorage.getItem('reloaded') !== 'true') {
83-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
84-
window.location.replace('/tabs#geforce')
85-
}
86-
else {
87-
adress.value = 'https://www.nvidia.com/en-us/geforce-now/';
88-
form.dispatchEvent(new Event('submit'));
89-
}
66+
}
67+
if (window.location.hash === '#spotify') {
68+
if (localStorage.getItem('reloaded') !== 'true') {
69+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
70+
window.location.replace('/tabs#spotify');
71+
} else {
72+
adress.value = 'https://open.spotify.com/';
73+
form.dispatchEvent(new Event('submit'));
9074
}
9175
}
92-
if (window.location.hash === '#haikei') {
93-
if (localStorage.getItem('reloaded') !== 'true') {
94-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
95-
window.location.replace('/tabs#haikei')
96-
}
97-
else {
98-
adress.value = 'https://haikei.xyz';
99-
form.dispatchEvent(new Event('submit'));
100-
}
76+
}
77+
if (window.location.hash === '#geforce') {
78+
if (localStorage.getItem('reloaded') !== 'true') {
79+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
80+
window.location.replace('/tabs#geforce');
81+
} else {
82+
adress.value = 'https://www.nvidia.com/en-us/geforce-now/';
83+
form.dispatchEvent(new Event('submit'));
10184
}
10285
}
103-
if (window.location.hash === '#pinterest') {
104-
if (localStorage.getItem('reloaded') !== 'true') {
105-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
106-
window.location.replace('/tabs#pinterest')
107-
}
108-
else {
109-
adress.value = 'https://pinterest.com/';
110-
form.dispatchEvent(new Event('submit'));
111-
}
86+
}
87+
if (window.location.hash === '#haikei') {
88+
if (localStorage.getItem('reloaded') !== 'true') {
89+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
90+
window.location.replace('/tabs#haikei');
91+
} else {
92+
adress.value = 'https://haikei.xyz';
93+
form.dispatchEvent(new Event('submit'));
11294
}
11395
}
114-
if (window.location.hash === '#github') {
115-
if (localStorage.getItem('reloaded') !== 'true') {
116-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
117-
window.location.replace('/tabs#github')
118-
}
119-
else {
120-
adress.value = 'https://github.com/';
121-
form.dispatchEvent(new Event('submit'));
122-
}
96+
}
97+
if (window.location.hash === '#pinterest') {
98+
if (localStorage.getItem('reloaded') !== 'true') {
99+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
100+
window.location.replace('/tabs#pinterest');
101+
} else {
102+
adress.value = 'https://pinterest.com/';
103+
form.dispatchEvent(new Event('submit'));
123104
}
124105
}
125-
if (window.location.hash.includes('#custom')) {
126-
// Get the custom URL after the = sign
127-
let customURL = window.location.hash.split('=')[1];
128-
if (localStorage.getItem('reloaded') !== 'true') {
129-
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
130-
window.location.replace('/tabs#custom=' + customURL)
131-
}
132-
else {
133-
adress.value = customURL;
134-
form.dispatchEvent(new Event('submit'));
135-
}
106+
}
107+
if (window.location.hash === '#github') {
108+
if (localStorage.getItem('reloaded') !== 'true') {
109+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
110+
window.location.replace('/tabs#github');
111+
} else {
112+
adress.value = 'https://github.com/';
113+
form.dispatchEvent(new Event('submit'));
136114
}
137115
}
138-
if (window.location.hash.includes('#g')) {
139-
// Get the custom URL after the = sign
140-
let customURL = window.location.hash.split('=')[1];
141-
if (localStorage.getItem('reloaded') !== 'true') {
116+
}
117+
if (window.location.hash.includes('#custom')) {
118+
// Get the custom URL after the = sign
119+
let customURL = window.location.hash.split('=')[1];
120+
if (localStorage.getItem('reloaded') !== 'true') {
121+
if (localStorage.getItem('tabs') === 'true' && window === window.top) {
122+
window.location.replace('/tabs#custom=' + customURL);
123+
} else {
142124
adress.value = customURL;
143125
form.dispatchEvent(new Event('submit'));
144126
}
145127
}
146-
if (window.location.hash.includes('#link')) {
147-
let link = window.location.hash.split('=')[1];
148-
let iframe = document.getElementById('uv-iframe');
149-
iframe.classList.remove('dnone');
150-
iframe.style.display = 'absolute';
151-
iframe.style.width = '100%';
152-
iframe.style.height = '100%';
153-
iframe.style.border = 'none';
154-
iframe.style.left = '0';
155-
iframe.style.top = '0';
156-
iframe.style.right = '0';
157-
iframe.style.zIndex = '9999';
158-
adress.value = link;
128+
}
129+
if (window.location.hash.includes('#g')) {
130+
// Get the custom URL after the = sign
131+
let customURL = window.location.hash.split('=')[1];
132+
if (localStorage.getItem('reloaded') !== 'true') {
133+
adress.value = customURL;
159134
form.dispatchEvent(new Event('submit'));
160-
};
135+
}
136+
}
137+
if (window.location.hash.includes('#link')) {
138+
let link = window.location.hash.split('=')[1];
139+
let iframe = document.getElementById('uv-iframe');
140+
iframe.classList.remove('dnone');
141+
iframe.style.display = 'absolute';
142+
iframe.style.width = '100%';
143+
iframe.style.height = '100%';
144+
iframe.style.border = 'none';
145+
iframe.style.left = '0';
146+
iframe.style.top = '0';
147+
iframe.style.right = '0';
148+
iframe.style.zIndex = '9999';
149+
adress.value = link;
150+
form.dispatchEvent(new Event('submit'));
151+
}

public/js/control.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ function exitIframe() {
8989
}
9090
if (localStorage.getItem('tabs') === 'true') {
9191
if (window.location.hash.includes('#g')) {
92-
window.location.replace('/tabs')
92+
window.location.replace('/tabs');
9393
}
94-
}
95-
else {
94+
} else {
9695
window.location.reload();
9796
localStorage.setItem('reloaded', 'true');
9897
}
@@ -102,4 +101,3 @@ if (localStorage.getItem('tabs') === 'true') {
102101
document.getElementById('search-button').setAttribute('class', 'dnone');
103102
}
104103
}
105-

public/js/customApps.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ if (customApps) {
1010
appElement.innerHTML = `<ol><i class="fa-solid fa-user-plus"></i></ol> <p>${app.name}</p>`;
1111
appElement.onclick = () => {
1212
localStorage.setItem('reloaded', 'false');
13-
localStorage.setItem('customAppsUsedInTabs', 'false')
13+
localStorage.setItem('customAppsUsedInTabs', 'false');
1414
if (localStorage.getItem('tabs') === 'true') {
15-
window.location.replace('/tabs' + '#custom=' + app.url)
16-
}
17-
else {
15+
window.location.replace('/tabs' + '#custom=' + app.url);
16+
} else {
1817
window.location.replace('/search' + '#custom=' + app.url);
1918
}
2019
};

public/js/searchGames.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
function search_games(input) {
2-
let x = document.getElementsByClassName('game-tile');
3-
for (i = 0; i < x.length; i++) {
4-
let y = document.getElementsByClassName("game-tile");
5-
switch(x[i].innerHTML.toLowerCase().includes(input.toLowerCase())) {
6-
case false:
7-
x[i].style.display = "none";
8-
break;
9-
case true:
10-
x[i].style.display = '';
11-
break;
2+
let x = document.getElementsByClassName('game-tile');
3+
for (i = 0; i < x.length; i++) {
4+
let y = document.getElementsByClassName('game-tile');
5+
switch (x[i].innerHTML.toLowerCase().includes(input.toLowerCase())) {
6+
case false:
7+
x[i].style.display = 'none';
8+
break;
9+
case true:
10+
x[i].style.display = '';
11+
break;
12+
}
1213
}
13-
}
1414
}
1515
function category_games(category) {
1616
let x = document.getElementsByClassName('game-tile');
1717
for (i = 0; i < x.length; i++) {
18-
switch(x[i].dataset.tag.includes(category)) {
18+
switch (x[i].dataset.tag.includes(category)) {
1919
case false:
20-
x[i].style.display = "none";
20+
x[i].style.display = 'none';
2121
break;
2222
case true:
2323
x[i].style.display = '';

0 commit comments

Comments
 (0)