mirror of
https://github.com/mileswolfallen2/miles-web.git
synced 2026-12-06 08:33:55 +00:00
Add new game files and create moon vault HTML page
- Added WebAssembly file for Stacktris game. - Included minified JavaScript source for Stacktris game. - Created moon vault HTML page with game links and a locking mechanism.
This commit is contained in:
1 parent
52b37c24e1
commit
9ab87d0fea
177 files changed
+99649
-2
No files matched your search
@@ -0,0 +1,48 @@
|
||||
function inFrame () {
|
||||
try {
|
||||
return window.self !== window.top;
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function botBrowser() {
|
||||
try {
|
||||
return navigator.webdriver
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function loadGoogleAnalytics(id) {
|
||||
// Google tag (gtag.js)
|
||||
var firstScript= document.getElementsByTagName("script")[0];
|
||||
newScript= document.createElement("script");
|
||||
newScript.async= "";
|
||||
newScript.src= "https://www.googletagmanager.com/gtag/js?id="+ id;
|
||||
firstScript.parentNode.insertBefore(newScript, firstScript);
|
||||
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', id);
|
||||
}
|
||||
|
||||
window.addEventListener("load", (event) => {
|
||||
if (botBrowser()) {
|
||||
loadGoogleAnalytics("G-M9CQ16MX4G");
|
||||
console.log('Bot Browser', event);
|
||||
} else {
|
||||
console.log('Human Browser', event);
|
||||
if (window.location.href.indexOf(".github.io")> -1) {
|
||||
if (inFrame()) {
|
||||
loadGoogleAnalytics("G-T445XL67R6");
|
||||
} else {
|
||||
loadGoogleAnalytics("G-T445XL67R6");
|
||||
}
|
||||
} else {
|
||||
loadGoogleAnalytics("G-T445XL67R6");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user