import { ThroughSubmitData } from "../../libs/tw/data/custom/throughSubmit/ThroughSubmitData";

const MinHeight = 1200;

class Layers extends eui.UILayer {
    public sceneLayer: eui.Group = null;
    public popupLayer: eui.Group = null;
    public topLayer: eui.UILayer = new eui.UILayer();
    public toastLayer: eui.UILayer = new eui.UILayer();
    init(root: eui.UILayer) {
        if (document.body.clientWidth / document.body.clientHeight > 750 / MinHeight) {
            let scroller = new eui.Scroller();
            root.addChild(scroller);
            scroller.viewport = this;
            scroller.bounces = false;
            scroller.addChild(this);
            this.popupLayer = new eui.Group();
            this.popupLayer.width = 750;
            this.popupLayer.height = MinHeight;
            this.sceneLayer = new eui.Group();
            this.sceneLayer.width = 750
            this.sceneLayer.height = MinHeight;
            this.addChild(this.sceneLayer);
            this.addChild(this.popupLayer);
        } else {
            root.addChild(this);
            this.popupLayer = new eui.UILayer();
            this.sceneLayer = new eui.Group();
            this.addChild(this.sceneLayer);
            this.addChild(this.popupLayer);
        }

        this.addChild(this.toastLayer);
        this.addChild(this.topLayer);


        this.popupLayer.visible = false;
        this.topLayer.visible = false;
        this.toastLayer.touchEnabled = false;
    }
}

const instance = new Layers();
export default instance