nanka iroiro
This commit is contained in:
parent
6927ffa979
commit
5ad77e8a3a
10 changed files with 155 additions and 93 deletions
|
|
@ -1,18 +1,29 @@
|
|||
/**
|
||||
* MISSKEY ENTRY POINT
|
||||
*/
|
||||
(() => {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
|
||||
// Detect user agent
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const isMobile = /mobile|iphone|ipad|android/.test(ua);
|
||||
|
||||
isMobile ? mountMobile() : mountDesktop();
|
||||
|
||||
/**
|
||||
* Mount the desktop app
|
||||
*/
|
||||
function mountDesktop() {
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', '/resources/desktop/script.js');
|
||||
script.setAttribute('src', `/resources/desktop/script.${VERSION}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mount the mobile app
|
||||
*/
|
||||
function mountMobile() {
|
||||
const meta = document.createElement('meta');
|
||||
meta.setAttribute('name', 'viewport');
|
||||
|
|
@ -20,7 +31,7 @@
|
|||
head.appendChild(meta);
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', '/resources/mobile/script.js');
|
||||
script.setAttribute('src', `/resources/mobile/script.${VERSION}.js`);
|
||||
script.setAttribute('async', 'true');
|
||||
script.setAttribute('defer', 'true');
|
||||
head.appendChild(script);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue