Files
Unify/application/demo/minimizeButton.js

123 lines
1.4 KiB
JavaScript
Raw Normal View History

2025-12-25 11:16:59 +01:00
import icon from '/elements/icon.js';
export default class minimizeButton {
//showFps = true;
text = "<"
color = "white"
fontWeight = "bold"
cursor = "pointer"
propegateEvent = false
zIndex = 5000
transition = "1s easeInOutQuart";
margin = 10;
position = "absolute";
#ifdef ANDROID
top = "4px"
#else
bottom = "4px"
#endif
left = "0"
zIndex = "100000"
transform = "rotate(0)" ;
open() {
var menu = this.parent.leftSide;
//this.setImage("chevron-right.svg")
this.transform = "scale(1, 1)";
#ifdef ANDROID
menu.boxHeight = "100vh";
#else
menu.boxWidth = 220;
#endif
menu.state = "visible";
this.parent.rightSide.borderRadius = "";
}
close() {
var menu = this.parent.leftSide;
//this.setImage("chevron-left.svg")
this.transform = "scale(-1, 1)";
#ifdef ANDROID
menu.boxHeight = "0";
#else
menu.boxWidth = "0";
#endif
menu.state = "hidden";
var that = this;
setTimeout(function(){
console.log("asd");
that.parent.rightSide.borderRadius = 12;
}, 1000)
}
click() {
var menu = this.parent.leftSide;
var state = menu.state;
if( state == "visible" ) {
this.close();
} else {
this.open();
}
}
}