|
@@ -1627,33 +1627,37 @@ export default {
|
|
|
to_pg.opacity = 0;
|
|
|
let bg = this.paper_main_object.children.doleance_bg;
|
|
|
|
|
|
- // fade out the current visible cercle politique then fade in the new one
|
|
|
- let u = 0;
|
|
|
- let f = 6;
|
|
|
- let p = 10;
|
|
|
- let doDoleanceTransition = function(){
|
|
|
- // console.log(`doDoleanceTransition u:${u} from:${from_pg}, to:${to_pg}`);
|
|
|
- u++
|
|
|
- if (u <= f*2+p) {
|
|
|
- if (u<=f) {
|
|
|
- // fade out
|
|
|
- from_pg.opacity = bg.opacity = 1-u/f
|
|
|
- } else if(u>f && u<p+f) {
|
|
|
- // pause
|
|
|
- }else{
|
|
|
- // fade in
|
|
|
- to_pg.opacity = bg.opacity = (u-p-f)/f
|
|
|
- }
|
|
|
- window.requestAnimationFrame(doDoleanceTransition);
|
|
|
- }else{
|
|
|
- from_pg.visible = false;
|
|
|
- from_pg.opacity = 1;
|
|
|
- to_pg.opacity = 1;
|
|
|
- this.doleance_transition = false
|
|
|
- }
|
|
|
- }.bind(this)
|
|
|
-
|
|
|
- doDoleanceTransition()
|
|
|
+ // // fade out the current visible cercle politique then fade in the new one
|
|
|
+ new Tween.Tween({o: 1})
|
|
|
+ .to({
|
|
|
+ o: 0
|
|
|
+ }, 600)
|
|
|
+ .onUpdate((obj) => {
|
|
|
+ console.log(`tween update. o=${obj.o}`);
|
|
|
+ from_pg.opacity = bg.opacity = obj.o;
|
|
|
+ })
|
|
|
+ .onComplete((obj) => {
|
|
|
+ new Tween.Tween({o: 0})
|
|
|
+ .to({
|
|
|
+ o: 1
|
|
|
+ }, 900)
|
|
|
+ .onUpdate((objb) => {
|
|
|
+ to_pg.opacity = bg.opacity = objb.o;
|
|
|
+ })
|
|
|
+ .onComplete((obj) => {
|
|
|
+ from_pg.visible = false;
|
|
|
+ from_pg.opacity = 1;
|
|
|
+ to_pg.opacity = 1;
|
|
|
+ this.doleance_transition = false
|
|
|
+ })
|
|
|
+ .delay(500)
|
|
|
+ .easing(Tween.Easing.Quadratic.InOut)
|
|
|
+ .start();
|
|
|
+ })
|
|
|
+ .easing(Tween.Easing.Quadratic.Out)
|
|
|
+ .start();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
onIsHover(){
|
|
@@ -2122,9 +2126,10 @@ export default {
|
|
|
onBeforeEngineUpdate (event) {
|
|
|
|
|
|
// update the opening/closing tweening
|
|
|
- if (this.tween) {
|
|
|
- this.tween.update();
|
|
|
- }
|
|
|
+ // if (this.tween) {
|
|
|
+ // this.tween.update();
|
|
|
+ // }
|
|
|
+ Tween.update();
|
|
|
|
|
|
if (this.opened_concernement) {
|
|
|
// console.log("try to push aside", this.opened_concernement.opened_mapitem_id, this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]);
|