UNPKG

web2app-spa

Version:

This template is primarily designed to easily convert HTML pages and URLs into a Capacitor/Cordova based iOS/Android app that can be used as Single-page application (SPA).

68 lines (49 loc) 1.42 kB
const launchView = {}; launchView.create = function(parameters = {}) { //if (!parameters.delayTime) parameters.delayTime = 1300; setDefaultContainerBox(page); // BOX: Content container box. const box = createBox(); launchView.box = box; box.width = page.width; box.height = page.height; box.border = 0; box.color = parameters.backgroundColor; // "whitesmoke"; box.setMotion("opacity 0.2s"); box.left = 0; box.top = 0; // IMAGE: clock icon or your app logo. box.imgLogo = createImage(); box.add(that); that.width = 50; that.height = 50; //that.autoSize = 2; that.load("assets/launch-view/logo.png"); that.opacity = 1; that.onLoad(function(self) { self.center(); }); restoreDefaultContainerBox(); /* setTimeout(function() { box.opacity = 0; setTimeout(function() { box.remove(); }, 250); }, parameters.delayTime); */ } launchView.showOnSafeArea = function() { page.element.appendChild(launchView.box.element); // page.add(launchView.getContainerBox()); } launchView.remove = function(delayTime = 0) { setTimeout(function() { launchView.box.withMotion(function() { launchView.box.opacity = 0; }); setTimeout(function() { launchView.box.remove(); }, 250); }, delayTime); }