First commit
This commit is contained in:
122
application/demo/minimizeButton.js
Normal file
122
application/demo/minimizeButton.js
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user