Skip to content

Commit

Permalink
🚀 | v5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xbubbo committed Oct 19, 2023
1 parent c39c293 commit c7bc15b
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 36 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

32 changes: 22 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ import express from 'express';
import http from 'node:http';
import createBareServer from "@tomphttp/bare-server-node";
import path from 'node:path';
import * as dotenv from 'dotenv';
dotenv.config();
import cors from 'cors';

const __dirname = process.cwd();
const server = http.createServer();
const app = express(server);
const bareServer = createBareServer('/outerspace/');
const PORT = process.env.PORT;
const PORT = 8080;

app.use(express.json());
app.use(
express.urlencoded({
extended: true,
})
);

app.use(express.urlencoded({ extended: true }));
app.use(cors());
app.use(express.static(path.join(__dirname, 'static')));

const routes = [
Expand All @@ -31,6 +26,23 @@ const routes = [
{ path: '/loading', file: 'loading.html' },
];

app.get('/edu/*', cors({ origin: false }), async (req, res, next) => {
try {
const reqTarget = `https://raw.githubusercontent.com/InterstellarNetwork/Interstellar-Assets/main/${req.params[0]}`;
const asset = await fetch(reqTarget);

if (asset.ok) {
const data = await asset.arrayBuffer();
res.end(Buffer.from(data));
} else {
next();
}
} catch (error) {
console.error('Error fetching:', error);
next(error);
}
});

routes.forEach((route) => {
app.get(route.path, (req, res) => {
res.sendFile(path.join(__dirname, 'static', route.file));
Expand All @@ -54,7 +66,7 @@ server.on('upgrade', (req, socket, head) => {
});

server.on('listening', () => {
console.log(`Running at http://localhost:${process.env.PORT}`);
console.log(`Running at http://localhost:${PORT}`);
});

server.listen({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"@titaniumnetwork-dev/ultraviolet": "^1.0.10",
"@tomphttp/bare-server-node": "^1.2.6",
"cors": "^2.8.5",
"express": "^4.18.2"
},
"devDependencies": {
Expand Down
87 changes: 87 additions & 0 deletions static/edu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<html lang="en">
<head>
<link rel="shortcut icon" id="dynamic-favicon" href="favicon.png">
<title id="dynamic-title">Classes</title>
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
<!--- Style --->
<style>
body {
margin: 0;
}

iframe {
display: block;
background: #000;
border: none;
height: 100vh;
width: 100vw;
}
.navbtn {
float:right;
border-radius: 100%;
width:50px;
height:50px;
background-color: rgba(255,255,255, 0.2);
border:none;
position: fixed;
top:10px;
right: 10px;
}
.navbtn1 {
float:right;
border-radius: 100%;
width:50px;
height:50px;
background-color: rgba(255,255,255, 0.2);
border:none;
position: fixed;
top:70px;
right: 10px;
}
.navbtn2 {
float:right;
border-radius: 100%;
width:50px;
height:50px;
background-color: rgba(255,255,255, 0.2);
border:none;
position: fixed;
top:130px;
right: 10px;
}
</style>
</head>
<body>
<iframe src="" id="iframeId" style="bottom: 0" style="border: 0px #ffffff none" name="Iframe" scrolling="yes" frameborder="0" marginheight="0px" marginwidth="0px" height="100%" width="100%" allowfullscreen></iframe>

<button onclick="reload()" class="navbtn"> <i class="fa-solid fa-rotate-right"></i> </button>
<button id="home-page" class="navbtn1" onclick="reload()"> <i class="fa-solid fa-house"></i> </button>
<button id="fullscreen-button" class="navbtn2"><i class="fa-solid fa-expand"></i></button>

<script>
window.onload = function() {
let savedPaths = localStorage.getItem("savedPaths");
if (savedPaths) {
savedPaths = decodeURIComponent(savedPaths);
document.querySelector("#iframeId").src = savedPaths;
}};
function reload() {
document.getElementById("iframeId").src=document.getElementById("iframeId").src;
}
const fullscreenButton = document.getElementById("fullscreen-button");
fullscreenButton.addEventListener("click", function () {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
} else {
document.exitFullscreen();
}
});
const homeButton = document.getElementById("home-page");
homeButton.addEventListener("click", function () {
window.location.href = "./";
});
</script>
<script src="/scripts/main.js"></script>
<script src="/scripts/customIcon.js"></script>
</body>

11 changes: 6 additions & 5 deletions static/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
<div class="input-container">
<input type="text" id="searchbarbottom" onkeyup="search_game()" placeholder="Search">
<select id="category" name="category" onchange="showImages()">
<option value="all">All Games</option>
<option value="2P">Multiplayer Games</option>
<option value="sports">Sports Games</option>
<option value="flash">Flash Games</option>
<option value="emu">Emulator Games</option>
<option value="all">All</option>
<option value="2P">Multiplayer</option>
<option value="sports">Sports</option>
<option value="flash">Flash</option>
<option value="emu">Emulator</option>
<option value="local">Local</option>
</select>
</div>
<div class="pinned-apps">
Expand Down
44 changes: 24 additions & 20 deletions static/scripts/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ document.addEventListener('DOMContentLoaded', () => {
link: "https://territorial.io",
image: "/images/icons/territorialio.ico",
categories: ['all', '2P'],
error: false
},
{
name: "Stickman Hook",
link: "https://interstellarnetwork.github.io/Interstellar-Assets/stickman-hook/index.html",
link: "/edu/stickman-hook/index.html",
image: "/images/icons/stickmanhook.jpg",
categories: ['all'],
error: false
categories: ['all', 'local'],
local: "true"
},
{
name: "Tunnel Rush",
Expand Down Expand Up @@ -163,11 +162,11 @@ document.addEventListener('DOMContentLoaded', () => {
error: false
},
{
name: "Jetpack Joyride (3kh0)",
link: "https://interstellarnetwork.github.io/Interstellar-Assets/jetpack-joyride/index.html",
name: "Jetpack Joyride",
link: "/edu/jetpack-joyride/index.html",
image: "/images/icons/jetpackjoyride.png",
categories: ['all'],
error: false
categories: ['all', 'local'],
local: "true"
},
{
name: "FeedVid",
Expand Down Expand Up @@ -674,18 +673,18 @@ document.addEventListener('DOMContentLoaded', () => {
error: false
},
{
name: "Chess.com (Fixed)",
name: "Chess.com",
link: "https://chess.com",
image: "/images/icons/chess.webp",
categories: ["all"],
error: false
},
{
name: "Cluster Rush",
link: "https://interstellarnetwork.github.io/Interstellar-Assets/Cluster-Rush/",
link: "/edu/Cluster-Rush/index.html",
image: "/images/icons/cluster-rush.webp",
categories: ["all"],
error: false
categories: ["all", 'local'],
local: "true"
},
{
name: "Cookie Clicker",
Expand Down Expand Up @@ -968,11 +967,11 @@ document.addEventListener('DOMContentLoaded', () => {
error: false
},
{
name: "Monkey Mart [Fixed]",
link: "https://interstellarnetwork.github.io/Interstellar-Assets/monkey-mart/",
name: "Monkey Mart",
link: "/edu/monkey-mart/index.html",
image: "/images/icons/mm.webp",
categories: ['all'],
error: false
categories: ['all', 'local'],
local: "true"
},
{
name: "MooMoo.io",
Expand Down Expand Up @@ -1220,7 +1219,7 @@ document.addEventListener('DOMContentLoaded', () => {
error: false
},
{
name: "Riddle School 2 [FIXED]",
name: "Riddle School 2",
link: "https://f.silvergames.com/ruffle/player.php?id=8564",
image: "/images/icons/rs1.webp",
categories: ['all'],
Expand Down Expand Up @@ -1431,13 +1430,17 @@ document.addEventListener('DOMContentLoaded', () => {
},
{
name: "Retro Bowl",
link: "/calendar/retro-bowl/index.html",
link: "/edu/retro/index.html",
image: "/images/icons/retro.webp",
categories: ["all,", 'sports'],
categories: ["all,", 'sports', 'local'],
local: "true",
},
];

function saveToLocal(path) {
localStorage.setItem("savedPaths", path);
}

appsList.sort((a, b) => a.name.localeCompare(b.name));

const nonPinnedApps = document.querySelector('.container-apps');
Expand Down Expand Up @@ -1479,7 +1482,8 @@ document.addEventListener('DOMContentLoaded', () => {
if (typeof app.say !== 'undefined') {
alert(app.say);
}
window.location.href = app.link;
saveToLocal(app.link);
window.location.href = '/edu.html';
return false;
};
} else if (app.blank) {
Expand Down

11 comments on commit c7bc15b

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
we-love-art ❌ Failed View Logs 2023-10-19T23:43:35.519Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3llar ❌ Failed View Logs 2023-10-19T23:43:45.777Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3lla ❌ Failed View Logs 2023-10-19T23:43:49.649Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-19T23:43:51.459Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-19T23:43:52.766Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
your-mom ✅ Deployed View Logs 2023-10-19T23:43:56.590Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-19T23:44:02.880Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
instell ✅ Deployed View Logs 2023-10-19T23:44:31.398Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar-v5 ✅ Deployed View Logs 2023-10-19T23:44:34.151Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-19T23:44:42.515Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on c7bc15b Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-19T23:44:45.971Z

Please sign in to comment.