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

Commit b313017

Browse files
Add some proxied games (1v1.lol, shellshockers)
1 parent 7b2a2bd commit b313017

File tree

10 files changed

+59
-39
lines changed

10 files changed

+59
-39
lines changed
15.5 KB
Loading
12 KB
Loading

public/assets/games.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,5 +414,21 @@
414414
"cdn": "false",
415415
"proxy": "false",
416416
"url": ""
417+
},
418+
{
419+
"img": "/assets/games-thumb/1v1-lol.png",
420+
"baseFile": "none",
421+
"name": "1v1.lol",
422+
"cdn": "false",
423+
"proxy": "true",
424+
"url": "https://1v1.lol"
425+
},
426+
{
427+
"img": "/assets/games-thumb/shellshock.png",
428+
"baseFile": "none",
429+
"name": "Shell Shockers",
430+
"cdn": "false",
431+
"proxy": "true",
432+
"url": "https://shellshock.io"
417433
}
418434
]

public/js/appSuggestions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ window.onload = function () {
7070
if (window.location.hash.includes('#custom')) {
7171
// Get the custom URL after the = sign
7272
let customURL = window.location.hash.split('=')[1];
73-
if (localStorage.getItem('reloaded') !== 'true' && localStorage.getItem('customApps')) {
73+
if (localStorage.getItem('reloaded') !== 'true') {
7474
adress.value = customURL;
7575
form.dispatchEvent(new Event('submit'));
7676
}

public/js/gameload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ await fetch('/assets/games.json')
1111
if (gameData.cdn === 'true') {
1212
//not needed as of now but added for future use
1313
} else if (gameData.proxy === 'true') {
14-
window.location.replace('/search/#custom=' + gameData.url);
14+
localStorage.setItem('reloaded', 'false');
15+
window.location.replace('/search#custom=' + gameData.url);
1516
} else {
1617
iframe.src = `/ruby-assets/${gameName}/${gameData.baseFile}`;
1718
}

public/js/index.js

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,22 @@ if (proxytype === 'DIP') {
5959
.querySelector('.dipform')
6060
.addEventListener('submit', async (event) => {
6161
event.preventDefault();
62-
62+
let url;
63+
function searchURI(value) {
64+
url = search(value, searchEngine.value);
65+
}
6366
worker().then((event) => {
6467
let search = document.querySelector('.dipinput');
65-
let searchURL =
66-
document.getElementById('uv-search-engine').value;
67-
searchURL = searchURL.replace('%s', '');
68-
let location;
69-
//if search.value is a url then set location to that url without using .includes
70-
if (
71-
search.value.includes('https://') ||
72-
search.value.includes('http://')
73-
) {
74-
location = search.value;
75-
} else {
76-
location = searchURL + encodeURIComponent(search.value);
77-
}
68+
let address = document.getElementById('uv-address');
69+
searchURI(address.value)
7870
//loadingIframe.classList.remove('dnone');
7971
let textcolor = getComputedStyle(
8072
document.body
8173
).getPropertyValue('--text-color');
8274
//loadingIframe.src = `/loading#${textcolor}`;
8375
iframe.src =
8476
window.__DIP.config.prefix +
85-
window.__DIP.encodeURL(location);
77+
window.__DIP.encodeURL(url);
8678
//iframe.addEventListener('load', function () {
8779
//loadingIframe.classList.add('dnone');
8880
document.getElementById('control').classList.remove('dnone');
@@ -102,30 +94,19 @@ if (proxytype === 'Osana') {
10294
.getElementById('uv-form')
10395
.addEventListener('submit', async (event) => {
10496
event.preventDefault();
97+
let url;
98+
function searchURI(value){
99+
url = search(value, searchEngine.value);
100+
}
105101
worker().then((event) => {
106102
let search = document.querySelector('.dipinput');
107-
let searchURL =
108-
document.getElementById('uv-search-engine').value;
109-
searchURL = searchURL.replace('%s', '');
110-
let location;
111-
//if search.value is a url then set location to that url without using .includes
112-
if (
113-
search.value.includes('https://') ||
114-
search.value.includes('http://')
115-
) {
116-
location = search.value;
117-
} else {
118-
console.log(search.value);
119-
location = searchURL + encodeURIComponent(search.value);
120-
}
121-
//loadingIframe.classList.remove('dnone');
103+
let address = document.getElementById('uv-address');
104+
searchURI(address.value);
122105
let textcolor = getComputedStyle(
123106
document.body
124107
).getPropertyValue('--text-color');
125108
//loadingIframe.src = `/loading#${textcolor}`;
126-
iframe.src = `${
127-
__osana$config.prefix
128-
}${__osana$config.codec.encode(location)}`;
109+
iframe.src = __osana$config.prefix + __osana$config.codec.encode(url);
129110
//iframe.addEventListener('load', function () {
130111
//loadingIframe.classList.add('dnone');
131112
document.getElementById('control').classList.remove('dnone');
@@ -149,3 +130,15 @@ function decoded(str) {
149130
)
150131
.join('');
151132
}
133+
function search(input, template) {
134+
try {
135+
return new URL(input).toString();
136+
} catch (err) {
137+
}
138+
try {
139+
const url = new URL(`http://${input}`);
140+
if (url.hostname.includes('.')) return url.toString();
141+
} catch (err) {
142+
}
143+
return template.replace('%s', encodeURIComponent(input));
144+
}

public/osana/osana.config.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/search.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ import Search from '../components/search';
1010
<head>
1111
<script src="/uv/uv.bundle.js" defer></script>
1212
<script src="/uv/uv.config.js" defer></script>
13+
<script src="/uv/uv-sw.js" defer></script>
1314
<script src="/dip/dip.config.js" defer></script>
1415
<script src="/dip/dip.page.js" defer></script>
15-
<script src="/js/index.js" defer></script>
16-
<script src="/uv/uv-sw.js" defer></script>
17-
<script src="/uv/search.js" defer></script>
1816
<script src="/osana/osana.bundle.js" defer></script>
1917
<script src="/osana/osana.config.js" defer></script>
2018
<script src="/js/settings.js" defer></script>
19+
<script src="/js/index.js" defer></script>
2120
<link id="favicon" rel="icon" href="/favicon.ico" />
2221
<link rel="stylesheet" href="/assets/fontawesome/css/all.min.css" />
2322
<script src="/js/control.js" defer></script>

src/pages/settings.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ import Password from '../components/password';
108108
<option value="space">Space</option>
109109
<option value="marsh">Marsh</option>
110110
<option value="basic">Basic</option>
111+
<option value="pastel">Pastel</option>
111112
<option value="pinkish-purple">Pinkish Purple</option>
112113
<option value="pink-and-gray">Pink And Gray</option>
113114
<option value="nord">Nord</option>

src/styles/globals.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@
133133
--scroll-bar-thumb-hover-color: #fff3bc;
134134
--input-bg-color: #000000;
135135
}
136+
.pastel {
137+
--bg-color: #2a2d34;
138+
--text-color: #f5e5fC;
139+
--border-color: #99d5c9;
140+
--text-bg-color: #2a2d28;
141+
--scroll-bar-track-color: #2a2d34;
142+
--scroll-bar-thumb-color: #ac3931;
143+
--scroll-bar-thumb-hover-color: #99d5c9;
144+
--input-bg-color: #2a2d34;
145+
}
136146
.pinkish-purple {
137147
--bg-color: linear-gradient(90deg, #665fd2, #9824d3) no-repeat center center
138148
fixed;

0 commit comments

Comments
 (0)