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).
1 lines • 3 kB
JavaScript
;const smallView={default:{},resetDefault:function(){smallView.default.width="container-width",smallView.default.height=500,smallView.default.backgroundColor="white",smallView.default.coverColor="rgba(0, 0, 0, 0.4)",smallView.default.topRound=13,smallView.default.scrollY=0,smallView.default.showWithMotion=1}};smallView.resetDefault(),smallView.onCloseFunc=function(){},smallView.create=function(l={}){for(let e in smallView.default)smallView.default[e]=null!=l[e]?l[e]:smallView.default[e];"container-width"==smallView.default.width&&(smallView.default.width=getDefaultContainerBox().width),smallView.box=createBox(),that.width=smallView.default.width,that.height=that.containerBox.height,that.color="transparent",that.visible=0,that.top=0,that.left=0,smallView.box.boxCover=createBox(),smallView.box.add(that),that.width=smallView.default.width,that.height=smallView.box.height,that.setMotion("opacity 0.2s"),that.top=0,that.left=0,that.onClick((function(){smallView.close()})),smallView.box.boxContent=createBox(),smallView.box.add(that),that.width=smallView.default.width,that.height=smallView.default.height,that.setMotion("bottom 0.2s"),that.left=0,that.bottom=0,that.clickable=1,smallView.clear()},smallView.getContainerBox=function(){return smallView.box.boxContent},smallView.close=function(){smallView.setVisible(0,(function(){smallView.clear(),smallView.onCloseFunc(),smallView.onCloseFunc=function(){}}))},smallView.clear=function(){smallView.box.boxContent.html="",smallView.box.boxContent.color=smallView.default.backgroundColor,smallView.box.boxContent.border=0,smallView.box.boxContent.scrollY=smallView.default.scrollY,smallView.box.boxContent.height=smallView.default.height,smallView.box.boxContent.element.style.borderTopLeftRadius=smallView.default.topRound+"px",smallView.box.boxContent.element.style.borderTopRightRadius=smallView.default.topRound+"px",smallView.box.boxCover.color=smallView.default.coverColor},smallView.setVisible=function(l,e=function(){}){l!=smallView.box.visible&&(smallView.default.showWithMotion?l?(smallView.box.boxCover.clickable=0,smallView.box.clickable=1,smallView.box.boxCover.opacity=0,smallView.box.boxContent.bottom=-1*smallView.box.boxContent.height,smallView.box.visible=1,smallView.box.withMotion((function(l){smallView.box.boxCover.opacity=1,smallView.box.boxContent.bottom=0,smallView.box.boxCover.clickable=1})),setTimeout((function(){e()}),250)):(smallView.box.boxCover.clickable=0,smallView.box.clickable=1,smallView.box.boxCover.opacity=1,smallView.box.boxContent.bottom=0,smallView.box.withMotion((function(l){smallView.box.boxCover.opacity=0,smallView.box.boxContent.bottom=-1*smallView.box.boxContent.height})),setTimeout((function(){smallView.box.visible=0,smallView.box.clickable=0,e()}),250)):(l&&(smallView.box.dontMotion(),smallView.box.boxCover.opacity=1,smallView.box.boxContent.bottom=0,smallView.box.boxCover.clickable=1),smallView.box.visible=l,e()))},smallView.onClose=function(l){smallView.onCloseFunc=l};