XGravity/Public/ecma/Views/CreditsView.ecma.js

80 lines
3.3 KiB
JavaScript

"use strict";
const CreditsView = (function(){
const CreditsView = function(xgravity){
const self = this;
let view_element = null;
this.close = () => {
if(view_element && view_element.parentNode){
view_element.parentNode.removeChild(view_element);
view_element = null;
}
};
this.go = () => {
self.close();
const repo_url = "https://git.k3y.pw/KyMAN/XGravity";
const web_url = "https://xgravity.k3y.pw/";
const photographer_url = "https://unsplash.com/@vincentiu";
const opengameart_url = "https://opengameart.org/content/space-game-art-pack-extended";
const nodes = xgravity.html(xgravity.item_self, [
"div", { class : "xg-view xg-credits" }, [
["h2", { class : "xg-subtitle", "data-i18n" : "cred_title" }],
["div", { class : "xg-panel xg-credits-text" }, [
["p", {}, [
["strong", { "data-i18n" : "cred_original_concept" }],
["br"],
["span", { "data-i18n" : "cred_author" }]
]],
["p", { "data-i18n" : "cred_original_tech" }],
["p", { "data-i18n" : "cred_old_urls" }],
["p", {}, [
["strong", { "data-i18n" : "cred_remake" }],
["br"],
["span", { "data-i18n" : "cred_remake_authors" }]
]],
["p", {}, [
["strong", { "data-i18n" : "cred_assets" }],
["br"],
["span", { "data-i18n" : "cred_bg_photo" }],
["br"],
["a", { class : "xg-link", href : photographer_url, target : "_blank" }, photographer_url],
["br"],
["br"],
["span", { "data-i18n" : "cred_tatermand_art" }],
["br"],
["a", { class : "xg-link", href : opengameart_url, target : "_blank" }, opengameart_url]
]],
["p", {}, [
["strong", { "data-i18n" : "cred_links" }],
["br"],
["a", { class : "xg-link", href : web_url, target : "_blank" }, web_url],
["br"],
["a", { class : "xg-link", href : repo_url, target : "_blank" }, repo_url]
]],
["button", {
class : "xg-btn",
"data-i18n" : "btn_back",
onclick : () => {
self.close();
if(xgravity.views.main_menu)
xgravity.views.main_menu.go();
}
}]
]]
]
]);
view_element = nodes[0];
xgravity.i18n.update();
};
};
return CreditsView;
})();