shapez/src/js/states/mobile_warning.js

54 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-05-23 09:13:42 +02:00
import { GameState } from "../core/game_state";
import { cachebust } from "../core/cachebust";
import { THIRDPARTY_URLS } from "../core/config";
import { getLogoSprite } from "../core/background_resources_loader";
2020-05-23 09:13:42 +02:00
export class MobileWarningState extends GameState {
constructor() {
super("MobileWarningState");
}
getInnerHTML() {
return `
<img class="logo" src="${cachebust("res/" + getLogoSprite())}" alt="shapez.io Logo">
2020-05-23 09:13:42 +02:00
2020-05-23 09:19:56 +02:00
<p>
2020-06-07 12:56:02 +02:00
I'm sorry, but shapez.io is not available on mobile devices yet!
There is also no estimate when this will change, but feel to make a contribution! It's
&nbsp;<a href="https://github.com/tobspr/shapez.io" target="_blank">open source</a>!</p>
2022-06-02 14:06:33 +02:00
<p>If you want to play on your computer, you can also get the game on Steam:</p>
2020-05-23 09:13:42 +02:00
2020-05-23 09:19:56 +02:00
<a href="${
2021-06-25 19:29:23 +02:00
THIRDPARTY_URLS.stanaloneCampaignLink + "/shapez_mobile"
2022-06-02 14:06:33 +02:00
}" class="standaloneLink" target="_blank">Get on Steam!</a>
2020-05-23 09:13:42 +02:00
`;
}
getThemeMusic() {
return null;
}
getHasFadeIn() {
return false;
}
onEnter() {
try {
if (window.gtag) {
window.gtag("event", "click", {
event_category: "ui",
event_label: "mobile_warning",
});
}
} catch (ex) {
console.warn("Failed to track mobile click:", ex);
}
}
onLeave() {
// this.dialogs.cleanup();
}
}