Skip to content

Commit

Permalink
Formatted with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
xbubbo committed Mar 28, 2024
1 parent a937960 commit 8521caf
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ package-lock.json
package.json
/static/m/
/static/dy/
**/*.min.*
**/*.min.*
prettierrc
eslintrc.cjs
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ As of January 1st, 2024, Replit is [no longer free](https://blog.replit.com/host
2. Click "Code" (green button) and then "Create Codespace on main."
3. In the terminal at the bottom, paste `pnpm i && pnpm start`.
4. Respond to the application popup by clicking "Make public."
> [!IMPORTANT]
> Make sure you actually click the "Make public." button, or the proxy won't function properly.
> [!IMPORTANT]
> Make sure you actually click the "Make public." button, or the proxy won't function properly.
5. Access the deployed website from the ports tab.
6. For subsequent uses in the same codespace, just run `pnpm start`

Expand Down
30 changes: 15 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,41 @@ if (config.routes !== false) {
})
}

if (config.local !== false) {
if (config.local !== false) {
app.get('/e/*', (req, res, next) => {
const baseUrls = [
'https://raw.githubusercontent.com/v-5x/x/fixy',
'https://raw.githubusercontent.com/ypxa/y/main',
'https://raw.githubusercontent.com/ypxa/w/master',
];
fetchData(req, res, next, baseUrls);
});
]
fetchData(req, res, next, baseUrls)
})
}

const fetchData = async (req, res, next, baseUrls) => {
try {
const reqTarget = baseUrls.map(baseUrl => `${baseUrl}/${req.params[0]}`);
let data;
let asset;
const reqTarget = baseUrls.map((baseUrl) => `${baseUrl}/${req.params[0]}`)
let data
let asset

for (const target of reqTarget) {
asset = await fetch(target);
asset = await fetch(target)
if (asset.ok) {
data = await asset.arrayBuffer();
break;
data = await asset.arrayBuffer()
break
}
}

if (data) {
res.end(Buffer.from(data));
res.end(Buffer.from(data))
} else {
next();
next()
}
} catch (error) {
console.error('Error fetching:', error);
next(error);
console.error('Error fetching:', error)
next(error)
}
};
}

server.on('request', (req, res) => {
if (bareServer.shouldRoute(req)) {
Expand Down
71 changes: 35 additions & 36 deletions static/assets/scripts/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ function iframeLoad() {
if (website.includes('/a/')) {
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/', '')
document.getElementById('is').value = decodeXor(website)
localStorage.setItem('decoded', decodeXor(website));
localStorage.setItem('decoded', decodeXor(website))
} else if (website.includes('/a/q/')) {
const website = iframe.contentWindow?.location.href.replace(window.location.origin, '').replace('/a/q/', '')
document.getElementById('is').value = decodeXor(website)
localStorage.setItem('decoded', decodeXor(website));
localStorage.setItem('decoded', decodeXor(website))
}
}
}


// Reload
function reload() {
if (iframe) {
Expand Down Expand Up @@ -139,61 +138,61 @@ document.addEventListener('fullscreenchange', function () {
document.body.classList.toggle('fullscreen', isFullscreen)
})
// Now
let decodedSet = false;
const decoded = localStorage.getItem('decoded');
const key = ['nowgg', 'now.gg'];
let decodedSet = false
const decoded = localStorage.getItem('decoded')
const key = ['nowgg', 'now.gg']

if (localStorage.getItem('decoded') !== null) {
decodedSet = true;
console.log('Starting process.');
now();
decodedSet = true
console.log('Starting process.')
now()
} else {
decodedSet = false;
console.log('Decoded not found.');
decodedSet = false
console.log('Decoded not found.')
}

function now() {
console.log('Executing now() function.');
console.log('Executing now() function.')
if (decoded) {
let found = false;
let found = false
for (const keyword of key) {
if (decoded.includes(keyword)) {
console.log(`${keyword} found`);
found = true;
break;
console.log(`${keyword} found`)
found = true
break
}
}
if (found) {
let count = 0;
let notfound = 0;
const limit = 10;
const max = 45;
let count = 0
let notfound = 0
const limit = 10
const max = 45
const reloadInterval = setInterval(() => {
if (count < limit && iframe) {
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt');
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document
const element = iframeDocument.querySelector('.sc-hGPBjI.gGkQpt')
if (element) {
console.log("Class found inside the iframe.");
document.querySelector('.overlay').style.display = 'block';
document.getElementById('ifra').style.display = 'none';
iframeDocument.location.reload();
count += 1;
notfound = 0;
console.log('Class found inside the iframe.')
document.querySelector('.overlay').style.display = 'block'
document.getElementById('ifra').style.display = 'none'
iframeDocument.location.reload()
count += 1
notfound = 0
} else {
console.log("Class not found inside the iframe.");
notfound += 1;
console.log('Class not found inside the iframe.')
notfound += 1
if (notfound >= max) {
clearInterval(reloadInterval);
document.getElementById('ifra').style.display = 'block';
document.querySelector('.overlay').style.display = 'none';
clearInterval(reloadInterval)
document.getElementById('ifra').style.display = 'block'
document.querySelector('.overlay').style.display = 'none'
}
}
} else {
clearInterval(reloadInterval);
clearInterval(reloadInterval)
}
}, 500);
}, 500)
}
} else {
console.log('Decoded not found in localStorage.');
console.log('Decoded not found in localStorage.')
}
}
10 changes: 5 additions & 5 deletions static/assets/scripts/g.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ document.addEventListener('DOMContentLoaded', () => {

var appInd = 0
appsList.forEach((app) => {
const isLocal = app.categories.includes("local");
const isLocal = app.categories.includes('local')

if (isLocal) {
app.local = true;
app.local = true
}

let pinNum = appInd

const columnDiv = document.createElement('div')
Expand All @@ -45,7 +45,7 @@ document.addEventListener('DOMContentLoaded', () => {
btn.title = 'Pin'

const link = document.createElement('a')

function saveToLocal(path) {
sessionStorage.setItem('GoUrl', path)
}
Expand Down
20 changes: 10 additions & 10 deletions static/assets/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@ function saveEventKey() {
localStorage.setItem('pLink', pLink)
}
// Tab Cloaker
var dropdown = document.getElementById('dropdown');
var options = dropdown.getElementsByTagName('option');
var sortedOptions = Array.from(options).sort(function(a, b) {
return a.textContent.localeCompare(b.textContent);
});
var dropdown = document.getElementById('dropdown')
var options = dropdown.getElementsByTagName('option')

var sortedOptions = Array.from(options).sort(function (a, b) {
return a.textContent.localeCompare(b.textContent)
})

while (dropdown.firstChild) {
dropdown.removeChild(dropdown.firstChild);
dropdown.removeChild(dropdown.firstChild)
}

sortedOptions.forEach(function(option) {
dropdown.appendChild(option);
});
sortedOptions.forEach(function (option) {
dropdown.appendChild(option)
})

function saveIcon() {
const iconElement = document.getElementById('icon')
Expand Down
19 changes: 9 additions & 10 deletions static/assets/styles/frame.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body {
margin: 0;
overflow-x: hidden;
overflow-y: hidden;
background: var(--main)
background: var(--main);
}

iframe {
Expand Down Expand Up @@ -158,19 +158,18 @@ iframe {
}

h1 {
text-align: center;
color: white;
font-size: 50px;
white-space: nowrap;
text-align: center;
color: white;
font-size: 50px;
white-space: nowrap;
}

p {
text-align: center;
color: white;
font-size: 25px;
text-align: center;
color: white;
font-size: 25px;
}

a {
color: #6495ED
color: #6495ed;
}

17 changes: 7 additions & 10 deletions static/assets/styles/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,12 @@ select {
outline: none;
}



@media screen and (max-width: 768px) {
.settings-container {
padding: 25% 20px 20px 20px;
padding: 25% 20px 20px 20px;
}
.settings-card {
width: 100%;
width: 100%;
max-width: 400px;
}

Expand All @@ -174,29 +172,28 @@ select {

input,
.key-form {
width: 90%;
width: 90%;
}

button,
.key-button {
width: 100%;
width: 100%;
max-width: 200px;
}
}

@media screen and (max-width: 500px) {
.settings-container {
padding-top: 35%;
padding-top: 35%;
}
}


@media screen and (min-width: 1000px) {
.settings-container {
padding-top: 10%;
padding-top: 10%;
}
}

#last-updated {
margin-top: -3%;
}
}
2 changes: 1 addition & 1 deletion static/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="/assets/styles/main.css?v=5" />
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=5" />
<script src="/assets/scripts/index.js?v=9"></script>
<script src="/assets/scripts/g.js?v=36"></script>
<script src="/assets/scripts/g.js?v=38"></script>
</head>
<body>
<div class="fixed-nav-bar">
Expand Down
16 changes: 10 additions & 6 deletions static/go.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
<link rel="shortcut icon" id="tab-favicon" href="favicon.png" />
<title id="tab-title">Home</title>
<link rel="stylesheet" href="assets/styles/frame.css?v=5" />
<link rel="stylesheet" href="assets/styles/frame.css?v=8" />
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=5" />
</head>
<body>
Expand Down Expand Up @@ -43,10 +43,14 @@
</div>
</div>
<div class="overlay">
<h1>Now.gg fix is being applied, please wait.</h1>
<p>It should only take 1-2 minutes, if it takes longer <a href="https://support.google.com/accounts/answer/32050">clear your cache</a> or join our <a href="https://discord.gg/interstellar">discord!</a></p>
</div>
<iframe
<h1>Now.gg fix is being applied, please wait.</h1>
<p>
It should only take 1-2 minutes, if it takes longer
<a href="https://support.google.com/accounts/answer/32050">clear your cache</a> or join our
<a href="https://discord.gg/interstellar">discord!</a>
</p>
</div>
<iframe
src=""
id="ifra"
onload="iframeLoad()"
Expand All @@ -61,7 +65,7 @@ <h1>Now.gg fix is being applied, please wait.</h1>
width="100%"
allowfullscreen></iframe>
<script src="assets/scripts/index.js?v=9"></script>
<script src="assets/scripts/frame.js?v=28"></script>
<script src="assets/scripts/frame.js?v=30"></script>
<script src="/assets/scripts/main.js?v=18"></script>
<script src="./m/bundle.js?v=5"></script>
<script src="./m/config.js?v=5"></script>
Expand Down
Loading

0 comments on commit 8521caf

Please sign in to comment.