|
@@ -22,7 +22,6 @@ export default function Viewer(props) {
|
|
|
: element;
|
|
|
});
|
|
|
const debug = props.debug || false;
|
|
|
- // console.log("lazyHeight", lazyHeight);
|
|
|
return (
|
|
|
<LazyLoad height={lazyHeight} offset={1e4}>
|
|
|
<ViewerInner {...props} debug={debug}>
|
|
@@ -204,17 +203,8 @@ class ViewerInner extends Component {
|
|
|
this.context.imageSmoothingQuality = "high";
|
|
|
}
|
|
|
initializeTimeline() {
|
|
|
- // const openLoading = () => {
|
|
|
- // gsap.to(this.loadingWrap.current, {
|
|
|
- // autoAlpha: 1,
|
|
|
- // });
|
|
|
- // };
|
|
|
- // const closeLoading = () => {
|
|
|
- // gsap.to(this.loadingWrap.current, {
|
|
|
- // autoAlpha: 0,
|
|
|
- // });
|
|
|
- // };
|
|
|
- // closeLoading();
|
|
|
+ this.props.debug && console.log(this.props.path, "initializeTimeline");
|
|
|
+ this.leaveHideElements();
|
|
|
this.timeline = gsap.timeline({
|
|
|
scrollTrigger: {
|
|
|
trigger: this.containerRef.current,
|
|
@@ -240,22 +230,21 @@ class ViewerInner extends Component {
|
|
|
},
|
|
|
onEnter: () => {
|
|
|
this.isAbove = false;
|
|
|
- console.log(this.props.path, "onEnter");
|
|
|
this.enterShowElements();
|
|
|
+ this.props.debug && console.log(this.props.path, "onEnter");
|
|
|
},
|
|
|
onEnterBack: () => {
|
|
|
- // openLoading();
|
|
|
- console.log(this.props.path, "onEnterBack");
|
|
|
this.isBelow = false;
|
|
|
this.enterShowElements();
|
|
|
+ this.props.debug && console.log(this.props.path, "onEnterBack");
|
|
|
},
|
|
|
onLeave: () => {
|
|
|
- console.log(this.props.path, "onLeave");
|
|
|
+ this.props.debug && console.log(this.props.path, "onLeave");
|
|
|
this.isAbove = true;
|
|
|
this.leaveHideElements();
|
|
|
},
|
|
|
onLeaveBack: () => {
|
|
|
- console.log(this.props.path, "onLeaveBack");
|
|
|
+ this.props.debug && console.log(this.props.path, "onLeaveBack");
|
|
|
this.isBelow = true;
|
|
|
this.leaveHideElements();
|
|
|
},
|
|
@@ -325,7 +314,8 @@ class ViewerInner extends Component {
|
|
|
}
|
|
|
}
|
|
|
initializeExitTween() {
|
|
|
- console.log(this.props.path, "initializing exit tween ");
|
|
|
+ this.props.debug &&
|
|
|
+ console.log(this.props.path, "initializing exit tween ");
|
|
|
this.exitTimeline = gsap.timeline({
|
|
|
scrollTrigger: {
|
|
|
scrub: true,
|
|
@@ -423,11 +413,13 @@ class ViewerInner extends Component {
|
|
|
}
|
|
|
|
|
|
enterShowElements() {
|
|
|
+ this.props.debug && console.log(this.props.path, "show-process-bar");
|
|
|
gsap.set(this.processBarRef.current, {
|
|
|
autoAlpha: 1,
|
|
|
});
|
|
|
}
|
|
|
leaveHideElements() {
|
|
|
+ this.props.debug && console.log(this.props.path, "hide-process-bar");
|
|
|
gsap.set(this.processBarRef.current, {
|
|
|
autoAlpha: 0,
|
|
|
});
|