flash.moe/assets/makai.js/main.js

24 lines
650 B
JavaScript

#include elem.js
#include elems/head.js
#include np/init.js
#include tools/ascii.js
#include tools/whois.js
const makai = (() => {
const header = new MakaiSiteHeader($q('.js-header'));
const runIfPathStartsWith = (prefix, func, ...args) => {
if(location.pathname === prefix || location.pathname.startsWith(`${prefix}/`))
func(...args);
};
runIfPathStartsWith('/tools/ascii', MakaiASCII);
runIfPathStartsWith('/tools/whois', MakaiWHOIS);
const nowPlaying = MakaiNowPlayingInit(header);
return {
get header() { return header; },
get nowPlaying() { return nowPlaying; },
};
})();