Files
monkeygg2.github.io/games/x-trench-run/index.html
T

244 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7L02W3ZMS5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-7L02W3ZMS5');
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5648726754785335"
crossorigin="anonymous"></script>
<title>X-Trench Run</title>
<link rel="icon" type="image/x-icon" href="/media/graphics/misc/favicon.ico" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<!-- Use this metatag when Apple fixes their IOS 9
<meta name="viewport" content="width=device-width,height=device-height, initial-scale=1, maximum-scale=1, user-scalable=0, minimal-ui"/>
-->
<!--Temporary fix for IOS 9-->
<meta name="viewport"
content="initial-scale=1.0001, minimum-scale=1.0001, maximum-scale=1.0001, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" href="game.css">
<script type="text/javascript" src="game.js"></script>
<!-- AnalyticsCode -->
<!-- APICode -->
<script src="/global.js"> </script>
</head>
<body onload="setTimeout(function(){window.scrollTo(0,1)},1);">
<!--body-->
<div id="ajaxbar">
<div id="game"><canvas id="canvas"></canvas></div>
<div id="webgl"><canvas id="webglcanvas"></canvas></div>
<div id="orientate"><img src="media/graphics/orientate/portrait.jpg" /></div>
<div id="play" class="play" onclick=""><img src="media/graphics/splash/mobile/cover-start.jpg" /></div>
<!--<img id="scrollDown" width="220" height="277"></img>-->
<!-- SECTION GENERATED BY CODE -->
<div id="MobileAdInGamePreroll">
<div id="MobileAdInGamePreroll-Box">
<div id="MobileAdInGamePreroll-Box-Header"></div>
<a id="MobileAdInGamePreroll-Box-Close" onclick="MobileAdInGamePreroll.Close();"></a>
<div id="MobileAdInGamePreroll-Box-Body">
<center>
<!-- MobileAdInGamePreroll -->
<!-- AdTest-MobileAdInGamePreroll -->
<img src="https://cdn-factory.marketjs.com/generic.png">
<!-- EndOfAdTest-MobileAdInGamePreroll -->
</center>
</div>
<div id='MobileAdInGamePreroll-Box-Footer'></div>
</div>
</div>
<!-- SECOND AD (ROTATION) -->
<div id="MobileAdInGamePreroll2">
<div id="MobileAdInGamePreroll2-Box">
<div id="MobileAdInGamePreroll2-Box-Header"></div>
<a id="MobileAdInGamePreroll2-Box-Close" onclick="MobileAdInGamePreroll.Close();"></a>
<div id="MobileAdInGamePreroll2-Box-Body">
<center>
<!-- MobileAdInGamePreroll2 -->
</center>
</div>
<div id='MobileAdInGamePreroll2-Box-Footer'></div>
</div>
</div>
<!-- THIRD AD (ROTATION) -->
<div id="MobileAdInGamePreroll3">
<div id="MobileAdInGamePreroll3-Box">
<div id="MobileAdInGamePreroll3-Box-Header"></div>
<a id="MobileAdInGamePreroll3-Box-Close" onclick="MobileAdInGamePreroll.Close();"></a>
<div id="MobileAdInGamePreroll3-Box-Body">
<center>
<!-- MobileAdInGamePreroll3 -->
</center>
</div>
<div id='MobileAdInGamePreroll3-Box-Footer'></div>
</div>
</div>
<div id="MobileAdInGameHeader">
<!-- MobileAdInGameHeader -->
</div>
<div id="MobileAdInGameHeader2">
<!-- MobileAdInGameHeader2 -->
</div>
<div id="MobileAdInGameHeader3">
<!-- MobileAdInGameHeader3 -->
</div>
<div id="MobileAdInGameFooter">
<!-- MobileAdInGameFooter -->
</div>
<div id="MobileAdInGameFooter2">
<!-- MobileAdInGameFooter2 -->
</div>
<div id="MobileAdInGameFooter3">
<!-- MobileAdInGameFooter3 -->
</div>
<div id="MobileAdInGameEnd">
<div id="MobileAdInGameEnd-Box">
<div id="MobileAdInGameEnd-Box-Header"></div>
<a id="MobileAdInGameEnd-Box-Close" onclick="MobileAdInGameEnd.Close();"></a>
<div id="MobileAdInGameEnd-Box-Body">
<center>
<!-- MobileAdInGameEnd -->
</center>
</div>
<div id='MobileAdInGameEnd-Box-Footer'></div>
</div>
</div>
<!-- SECOND AD (ROTATION) -->
<div id="MobileAdInGameEnd2">
<div id="MobileAdInGameEnd2-Box">
<div id="MobileAdInGameEnd2-Box-Header"></div>
<a id="MobileAdInGameEnd2-Box-Close" onclick="MobileAdInGameEnd.Close();"></a>
<div id="MobileAdInGameEnd2-Box-Body">
<center>
<!-- MobileAdInGameEnd2 -->
</center>
</div>
<div id='MobileAdInGameEnd2-Box-Footer'></div>
</div>
</div>
<!-- THIRD AD (ROTATION) -->
<div id="MobileAdInGameEnd3">
<div id="MobileAdInGameEnd3-Box">
<div id="MobileAdInGameEnd3-Box-Header"></div>
<a id="MobileAdInGameEnd3-Box-Close" onclick="MobileAdInGameEnd.Close();"></a>
<div id="MobileAdInGameEnd3-Box-Body">
<center>
<!-- MobileAdInGameEnd3 -->
</center>
</div>
<div id='MobileAdInGameEnd3-Box-Footer'></div>
</div>
</div>
<!-- END OF SECTION GENERATED BY CODE -->
</div>
<!-- <div id="tempdiv"><br><br><br></div> -->
<!-- APICode2 -->
<!-- END OF TEST -->
<script>
// Setup
function getQueryVariable(variable) {
var query = window.location.search.substring(1); // search in parent
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
}
// WORK IN PROGRESS - PLEASE DO NOT EDIT
var _CLIENT_INCOMING_ID;
var _INTERNAL_TEST;
var _CLIENT_API = {
checkUser:function(id){
$.ajax({
type: 'GET',
dataType: 'json',
url: 'https://gamelotte.com:6060/user-auth-token?token=' + id,
beforeSend:function (){
console.log('beforeSend')
},
}).done(function(response){
console.log(response)
switch(response.status){
// EDIT THE CASES APPROPRIATELY
case 200: // EXISTING USER and logged in. Do nothing
console.log('existing user, allow access');
break;
case 404: // INVALID USER
_CLIENT_API.redirectUser();
break;
default:
_CLIENT_API.redirectUser();
}
});
},
redirectUser:function(){
console.log('invalid user...')
// TEMP
// window.location.href = 'https://www.gamelotte.com/';
},
}
$(document).ready(function(){
// Assign
_TOKEN_NAME = 'token';
_CLIENT_INCOMING_ID = getQueryVariable(_TOKEN_NAME);
_INTERNAL_TEST = getQueryVariable("internal_test");
if(_INTERNAL_TEST){
console.log('Internal Test Mode, Do nothing');
}else{
console.log('Normal mode');
if(_CLIENT_INCOMING_ID){
console.log('_CLIENT_INCOMING_ID found in url param:',_CLIENT_INCOMING_ID)
_CLIENT_API.checkUser(_CLIENT_INCOMING_ID);
}else{
console.log('_CLIENT_INCOMING_ID not found')
_CLIENT_API.redirectUser();
}
}
});
</script>
</body>
</html>