Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIcy authored Apr 28, 2022
0 parents commit 6fe8ef4
Show file tree
Hide file tree
Showing 35 changed files with 44,110 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node .
55 changes: 55 additions & 0 deletions Site/games.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0 shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="./images/logo.png">
<link rel="stylesheet" href="index.css">
<title>Zaluea | Games</title>
</head>
<body>
<div class="bar">
<div class="main_title"><a href="/">Zaluea</a></div>
<div class="button games" id="button"><a href="games.html">Games</a></div>
<div class="button ytlink" id="button1" onclick="quickLink('hvtrs8%2F-wuw%2Cymuvu%60e%2Ccmm-')">YouTube</div>
<div class="button tabconfig" id="button2" onclick="settings()">Tab Config</div>
<div class="button updates_btn" id="button3" onclick="updates()">Updates</div>
<div class="settings" id="settings">
<div class="settingsstuff title_main">Settings</div>
<center>
<input class="setTitle" placeholder="Title" onkeyup="titleSet(this.value)">
<input class="setIco" placeholder="Icon" onkeyup="iconSet(this.value)">
<div class="resetButton" onclick="reset()">Reset</div>
</center>
</div>
<div class="updates" id="updates">
<div class="updatetitle title_updates">Updates</div>
<center>
<div class="updatespage" id="updatespage"></div>
</center>
</div>
<div class="button closegame" id="button_closegame" onclick="closeGame()">Close Game</div>
<div class="button fullscreengame" id="button_fullscreengame" onclick="fullscreenGame()">Fullscreen Game</div>
</div>
<div class="games_title">Games</div>
<center>
<div class="page">
<div id="gameslist"></div>
</div>
<div class="text">More games will be added in the future!</div>
</center>
<iframe src="" class="gamewindow" id="gamewindow"></iframe>
<div class="bottom">
<div class="textbottom title_bottom">Zaluea Network 2022</div>
<i class="linkbottom other"><a href="https://github.com/TheIcy/Zaluea">GitHub</a></i>
<i class="linkbottom discord"><a href="https://discord.gg/dE7puEgwap">Discord</a></i>
</div>
<script src="uv/uv.bundle.js"></script>
<script src="uv/uv.config.js"></script>
<script src="index.js"></script>
<script src="site.js"></script>
<script src="games.js"></script>
<script src="updates.js"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions Site/games.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
var games = [
{name: "Flappy Bird", path: "games/flappybird/index.html"}
];

var glist = document.getElementById("gameslist");

for (let item of games) {
let a = document.createElement("a");
a.className = "gamebutton";
var title = document.createElement("gamebutton");
title.className = "gamebutton";
title.textContent = item.name;
a.appendChild(title);
a.href = "#";
a.onclick = function(e) {
if (e.target == a || e.target.tagName != "A") {
e.preventDefault();
loadGame(item.path)
}
}

glist.appendChild(a);
}

function loadGame(path) {
var button = document.getElementById('button');
var button1 = document.getElementById('button1');
var button2 = document.getElementById('button2');
var button3 = document.getElementById('button3');
var button_closegame = document.getElementById('button_closegame');
var button_fullscreengame = document.getElementById('button_fullscreengame');
var gameWindow = document.getElementById('gamewindow');
button.style.display = 'none';
button1.style.display = 'none';
button2.style.display = 'none';
button3.style.display = 'none';
button_closegame.style.display = 'initial';
button_fullscreengame.style.display = 'initial';
gameWindow.setAttribute('src', path);
gameWindow.style.display = 'initial';
}

function closeGame() {
var button_closegame = document.getElementById('button_closegame');
var button_fullscreengame = document.getElementById('button_fullscreengame');
var button = document.getElementById('button');
var button1 = document.getElementById('button1');
var button2 = document.getElementById('button2');
var button3 = document.getElementById('button3');
var gameWindow = document.getElementById('gamewindow');
button_closegame.style.display = 'none';
button_fullscreengame.style.display = 'none';
button.style.display = 'initial';
button1.style.display = 'initial';
button2.style.display = 'initial';
button3.style.display = 'initial';
gameWindow.style.display = 'none';
gameWindow.removeAttribute('src');
}

function fullscreenGame() {
var gameWindow = document.getElementById('gamewindow');
gameWindow.requestFullscreen();
}
1 change: 1 addition & 0 deletions Site/games/flappybird/404993.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Site/games/flappybird/__game-scripts.js

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions Site/games/flappybird/__loading__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
pc.script.createLoadingScreen(function (app) {
var showSplash = function () {
// splash wrapper
var wrapper = document.createElement('div');
wrapper.id = 'application-splash-wrapper';
document.body.appendChild(wrapper);

// splash
var splash = document.createElement('div');
splash.id = 'application-splash';
wrapper.appendChild(splash);
splash.style.display = 'none';

var logo = document.createElement('img');
logo.src = ASSET_PREFIX + 'logo.png';
splash.appendChild(logo);
logo.onload = function () {
splash.style.display = 'block';
};

var container = document.createElement('div');
container.id = 'progress-bar-container';
splash.appendChild(container);

var bar = document.createElement('div');
bar.id = 'progress-bar';
container.appendChild(bar);

};

var hideSplash = function () {
var splash = document.getElementById('application-splash-wrapper');
splash.parentElement.removeChild(splash);
};

var setProgress = function (value) {
var bar = document.getElementById('progress-bar');
if (bar) {
value = Math.min(1, Math.max(0, value));
bar.style.width = value * 100 + '%';
}
};

var createCss = function () {
var css = [
'body {',
' background-color: #283538;',
'}',

'#application-splash-wrapper {',
' position: absolute;',
' top: 0;',
' left: 0;',
' height: 100%;',
' width: 100%;',
' background-color: #283538;',
'}',

'#application-splash {',
' position: absolute;',
' top: calc(50% - 28px);',
' width: 264px;',
' left: calc(50% - 132px);',
'}',

'#application-splash img {',
' width: 100%;',
'}',

'#progress-bar-container {',
' margin: 20px auto 0 auto;',
' height: 2px;',
' width: 100%;',
' background-color: #1d292c;',
'}',

'#progress-bar {',
' width: 0%;',
' height: 100%;',
' background-color: #f60;',
'}',
'@media (max-width: 480px) {',
' #application-splash {',
' width: 170px;',
' left: calc(50% - 85px);',
' }',
'}'

].join('\n');

var style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}

document.head.appendChild(style);
};


createCss();

showSplash();

app.on('preload:end', function () {
app.off('preload:progress');
});
app.on('preload:progress', setProgress);
app.on('start', hideSplash);
});
144 changes: 144 additions & 0 deletions Site/games/flappybird/__start__.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
(function () {
var CANVAS_ID = 'application-canvas';

var canvas, devices, app;

var createCanvas = function () {
canvas = document.createElement('canvas');
canvas.setAttribute('id', CANVAS_ID);
canvas.setAttribute('tabindex', 0);
// canvas.style.visibility = 'hidden';

// Disable I-bar cursor on click+drag
canvas.onselectstart = function () { return false; };

document.body.appendChild(canvas);

return canvas;
};

var createInputDevices = function (canvas) {
var devices = {
elementInput: new pc.ElementInput(canvas, {
useMouse: INPUT_SETTINGS.useMouse,
useTouch: INPUT_SETTINGS.useTouch
}),
keyboard: INPUT_SETTINGS.useKeyboard ? new pc.Keyboard(window) : null,
mouse: INPUT_SETTINGS.useMouse ? new pc.Mouse(canvas) : null,
gamepads: INPUT_SETTINGS.useGamepads ? new pc.GamePads() : null,
touch: INPUT_SETTINGS.useTouch && pc.platform.touch ? new pc.TouchDevice(canvas) : null
};

return devices;
};

var configureCss = function (fillMode, width, height) {
// Configure resolution and resize event
if (canvas.classList) {
canvas.classList.add('fill-mode-' + fillMode);
}

// css media query for aspect ratio changes
var css = "@media screen and (min-aspect-ratio: " + width + "/" + height + ") {";
css += " #application-canvas.fill-mode-KEEP_ASPECT {";
css += " width: auto;";
css += " height: 100%;";
css += " margin: 0 auto;";
css += " }";
css += "}";

// append css to style
if (document.head.querySelector) {
document.head.querySelector('style').innerHTML += css;
}
};

var reflow = function () {
app.resizeCanvas(canvas.width, canvas.height);
canvas.style.width = '';
canvas.style.height = '';

var fillMode = app._fillMode;

if (fillMode == pc.FILLMODE_NONE || fillMode == pc.FILLMODE_KEEP_ASPECT) {
if ((fillMode == pc.FILLMODE_NONE && canvas.clientHeight < window.innerHeight) || (canvas.clientWidth / canvas.clientHeight >= window.innerWidth / window.innerHeight)) {
canvas.style.marginTop = Math.floor((window.innerHeight - canvas.clientHeight) / 2) + 'px';
} else {
canvas.style.marginTop = '';
}
}
};

var displayError = function (html) {
var div = document.createElement('div');

div.innerHTML = [
'<table style="background-color: #8CE; width: 100%; height: 100%;">',
' <tr>',
' <td align="center">',
' <div style="display: table-cell; vertical-align: middle;">',
' <div style="">' + html + '</div>',
' </div>',
' </td>',
' </tr>',
'</table>'
].join('\n');

document.body.appendChild(div);
};

canvas = createCanvas();
devices = createInputDevices(canvas);

try {
app = new pc.Application(canvas, {
elementInput: devices.elementInput,
keyboard: devices.keyboard,
mouse: devices.mouse,
gamepads: devices.gamepads,
touch: devices.touch,
graphicsDeviceOptions: window.CONTEXT_OPTIONS,
assetPrefix: window.ASSET_PREFIX || "",
scriptPrefix: window.SCRIPT_PREFIX || "",
scriptsOrder: window.SCRIPTS || []
});
} catch (e) {
if (e instanceof pc.UnsupportedBrowserError) {
displayError('This page requires a browser that supports WebGL.<br/>' +
'<a href="http://get.webgl.org">Click here to find out more.</a>');
} else if (e instanceof pc.ContextCreationError) {
displayError("It doesn't appear your computer can support WebGL.<br/>" +
'<a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>');
} else {
displayError('Could not initialize application. Error: ' + e);
}

return;
}

app.configure(CONFIG_FILENAME, function (err) {
if (err) {
console.error(err);
}

configureCss(app._fillMode, app._width, app._height);
reflow();

window.addEventListener('resize', reflow, false);
window.addEventListener('orientationchange', reflow, false);

app.preload(function (err) {
if (err) {
console.error(err);
}

app.loadScene(SCENE_PATH, function (err, scene) {
if (err) {
console.error(err);
}

app.start();
});
});
});
}());
1 change: 1 addition & 0 deletions Site/games/flappybird/config.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 6fe8ef4

Please sign in to comment.