Skip to content

Commit

Permalink
off brand fortnite and racing limits
Browse files Browse the repository at this point in the history
  • Loading branch information
hypackel committed Nov 12, 2024
1 parent de25d89 commit a804252
Show file tree
Hide file tree
Showing 33 changed files with 16,616 additions and 321 deletions.
19 changes: 19 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,22 @@ function updateFaviconAndTitle(selectedOption) {

// Run the function to create the dropdown
createDropdown();



document.addEventListener("DOMContentLoaded", () => {
// Check if the URL is not localhost or 127.0.0.1
const isLocalhost = ["localhost", "127.0.0.1"].includes(window.location.hostname);

if (!isLocalhost) {
// Create the script element
const adsScript = document.createElement("script");
adsScript.async = true;
adsScript.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7128870281959256";
adsScript.crossOrigin = "anonymous";

// Insert the script at the beginning of the head
document.head.prepend(adsScript);
}
});

Binary file not shown.
10 changes: 10 additions & 0 deletions files/offBrandFortnite/Build/cj3.asm.framework.unityweb

Large diffs are not rendered by default.

Binary file not shown.
Binary file added files/offBrandFortnite/Build/cj3.data.unityweb
Binary file not shown.
9 changes: 9 additions & 0 deletions files/offBrandFortnite/Build/cj3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"TOTAL_MEMORY": 268435456,
"dataUrl": "cj3.data.unityweb",
"asmCodeUrl": "cj3.asm.code.unityweb",
"asmMemoryUrl": "cj3.asm.memory.unityweb",
"asmFrameworkUrl": "cj3.asm.framework.unityweb",
"splashScreenStyle": "Dark",
"backgroundColor": "#000"
}
4 changes: 4 additions & 0 deletions files/offBrandFortnite/Build/fotniteUnityLoader.js

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions files/offBrandFortnite/Loader/UnityProgress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
const rootPath = 'Loader';

function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module) {
return;
}

if (!gameInstance.logo) {
gameInstance.logo = document.createElement("div");
gameInstance.logo.className = "logo " + gameInstance.Module.splashScreenStyle;
gameInstance.container.appendChild(gameInstance.logo);
}

if (!gameInstance.progress) {
gameInstance.progress = document.createElement("div");
gameInstance.progress.className = "progress " + gameInstance.Module.splashScreenStyle;
gameInstance.progress.empty = document.createElement("div");
gameInstance.progress.empty.className = "empty";
gameInstance.progress.appendChild(gameInstance.progress.empty);
gameInstance.progress.full = document.createElement("div");
gameInstance.progress.full.className = "full";
gameInstance.progress.appendChild(gameInstance.progress.full);
gameInstance.container.appendChild(gameInstance.progress);
gameInstance.textProgress = document.createElement("div");
gameInstance.textProgress.className = "text";
gameInstance.container.appendChild(gameInstance.textProgress);
}

gameInstance.progress.full.style.width = (100 * progress) + "%";
gameInstance.progress.empty.style.width = (100 * (1 - progress)) + "%";
gameInstance.textProgress.innerHTML = '' + Math.floor(progress * 100) + '%';

if (progress == 1) {
gameInstance.textProgress.innerHTML = 'Waiting...';
// gameInstance.textProgress.innerHTML= "";
}

if (progress == 'complete') {
gameInstance.logo.style.display = 'none';
gameInstance.progress.style.display = 'none';
gameInstance.textProgress.style.display = 'none';

// see shared/EnableSound.js
const event = new Event('removeSoundOverlay');
document.dispatchEvent(event);
}
}

window.Game = (function() {
var Game = function() {
this.registerEvents();
};

Game.prototype.registerEvents = function() {
var _this = this;

window.addEventListener("keydown", function(e) {
// space and arrow keys
if([8, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);

document.onmousedown = function() {
window.focus();
};

document.addEventListener('DOMContentLoaded', function() {
_this.resize();
}, false);

window.addEventListener('resize', function() {
setTimeout(function() {
_this.resize();
}, 1000);
}, false);
};

Game.prototype.getQueryVariable = function(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){
return pair[1];
}
}
return(false);
}

Game.prototype.resize = function() {
var ratioTolerant = this.getQueryVariable('ratio_tolerant');
if (ratioTolerant == false || this.fullscreen()) {
return;
}

document.getElementsByTagName('body')[0].style.overflow = 'hidden';
var gameContainer = document.getElementById('gameContainer') || document.getElementById('unityContainer');
var canvas = document.getElementById('#canvas');

var gameSizeRatio = gameContainer.offsetWidth / gameContainer.offsetHeight;
var maxHeight = this.maxHeight();
var maxWidth = window.innerWidth;
var windowSizeRatio = maxWidth / maxHeight;
var newStyle = {
width: gameContainer.offsetWidth,
height: gameContainer.offsetHeight
};

if (ratioTolerant == 'true') {
newStyle = { width: maxWidth, height: maxHeight };
} else if (ratioTolerant == 'false') {
if (gameSizeRatio > windowSizeRatio) {
newStyle = { width: maxWidth, height: maxWidth / gameSizeRatio };
} else {
newStyle = { width: maxHeight * gameSizeRatio, height: maxHeight };
}
}

this.updateStyle(gameContainer, newStyle);

// canvas does not exists on page load
if (canvas) {
this.updateStyle(canvas, newStyle);
}
};

Game.prototype.maxHeight = function() {
return window.innerHeight - 43;
};

Game.prototype.updateStyle = function(element, size) {
element.setAttribute('width', size.width);
element.setAttribute('height', size.height);
element.style.width = size.width + 'px';
element.style.height = size.height + 'px';
};

Game.prototype.fullscreen = function() {
return document.fullscreenElement ||
document.webkitFullscreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement;
};

return Game;
})();

new Game();
107 changes: 107 additions & 0 deletions files/offBrandFortnite/Loader/style.css

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions files/offBrandFortnite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Fotnite</title>
<meta name="robots" content="noindex,nofollow" />
<meta name="description" content="Fotnite, Fotnite Unblocked">
<meta property="og:image" content="fotnite.png" />
<link rel="shortcut icon" href="Loader/favicon.ico">
<link rel="stylesheet" href="Loader/style.css">
<script src="unity/unity-mod.js"></script>
<script src="Loader/UnityProgress.js"></script>
<!-- <script src="Build/UnityLoader.js"></script> -->
<script src="Build/fotniteUnityLoader.js"></script>
<script>
var gameInstance = UnityLoader.instantiate(
"gameContainer",
"Build/cj3.json",
{
onProgress: UnityProgress,Module:{
onRuntimeInitialized: function() {
UnityProgress(gameInstance, "complete")
}
}
});

function fixGameView() {
const gameView= document.getElementById("gameView");
if (gameView.clientHeight> gameView.clientWidth) {
gameView.style.height= Math.floor(gameView.clientWidth)+ "px";
}
}
</script>
<style>
body {
margin: 0px;
padding:0px;
}
</style>
</head>
<body style="overflow:hidden; margin:0; padding:0;" onload="fixGameView()">
<div id="gameView" class="webgl-content" style="position: absolute; width: 100%; height: 100%; margin: 0px; padding:0px;">
<div id="gameContainer" style="width: 100%; height: 100%; margin: 0px; padding:0px;"></div>
</div>
</body>
</html>
Binary file added files/offBrandFortnite/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions files/offBrandFortnite/unity/unity-mod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function UnityOpen(url) {
url= "#"+ url;
console.log("--fx--UnityOpen--", url);
return url;
}

function UnityUrlFix(url) {
// FIND: http.open(_method,_url,true);
// REPL: http.open(_method,UnityUrlFix(_url),true);
console.log("--fx--UnityUrlFix--", url);
if(url.indexOf("unity3d.com")>0 || url.indexOf("appspot.com")>0 || url.indexOf("herocraft.com")>0){
url= "json/null.json?"+ url;
}

return url;
}
Binary file added files/racing-limits/Build/Racing Limits.data.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions files/racing-limits/Build/Racing Limits.framework.js.gz

Large diffs are not rendered by default.

Loading

0 comments on commit a804252

Please sign in to comment.