|
@@ -179,6 +179,7 @@ export function TimeLineLabelText(props) {
|
|
// console.log("keyframes-TimeLineLabelText", keyframes);
|
|
// console.log("keyframes-TimeLineLabelText", keyframes);
|
|
return (
|
|
return (
|
|
<TimeLineText
|
|
<TimeLineText
|
|
|
|
+ textType="label"
|
|
trigger={trigger}
|
|
trigger={trigger}
|
|
keyframes={keyframes}
|
|
keyframes={keyframes}
|
|
verticalOffset={verticalOffset}
|
|
verticalOffset={verticalOffset}
|
|
@@ -213,6 +214,7 @@ export function TimeLineWallText(props) {
|
|
|
|
|
|
return (
|
|
return (
|
|
<TimeLineText
|
|
<TimeLineText
|
|
|
|
+ textType="wall"
|
|
trigger={trigger}
|
|
trigger={trigger}
|
|
keyframes={keyframes}
|
|
keyframes={keyframes}
|
|
verticalOffset={verticalOffset}
|
|
verticalOffset={verticalOffset}
|
|
@@ -231,6 +233,7 @@ export function TimeLineTitleText(props) {
|
|
const trigger = props.trigger || Action.scrubPin;
|
|
const trigger = props.trigger || Action.scrubPin;
|
|
return (
|
|
return (
|
|
<TimeLineText
|
|
<TimeLineText
|
|
|
|
+ textType="title"
|
|
trigger={trigger}
|
|
trigger={trigger}
|
|
verticalOffset={verticalOffset}
|
|
verticalOffset={verticalOffset}
|
|
{...props}
|
|
{...props}
|
|
@@ -280,14 +283,14 @@ class TimeLineText extends Component {
|
|
((window.innerHeight * parentHeight) / 100)) *
|
|
((window.innerHeight * parentHeight) / 100)) *
|
|
100;
|
|
100;
|
|
this.top = lastHeight + "%";
|
|
this.top = lastHeight + "%";
|
|
- console.log("this.top", this.top);
|
|
|
|
|
|
+ this.props.debug && console.log(`${this.props.textType}-top: ${this.top}`);
|
|
}
|
|
}
|
|
|
|
+
|
|
componentDidCatch(error) {
|
|
componentDidCatch(error) {
|
|
console.error("error", error);
|
|
console.error("error", error);
|
|
}
|
|
}
|
|
createTimeLine() {
|
|
createTimeLine() {
|
|
if (!this.timeline) {
|
|
if (!this.timeline) {
|
|
- console.log("createTimeLine");
|
|
|
|
const start = this.props.keyframes[0].start;
|
|
const start = this.props.keyframes[0].start;
|
|
const end = this.props.keyframes[0].end;
|
|
const end = this.props.keyframes[0].end;
|
|
const dif = end - start;
|
|
const dif = end - start;
|
|
@@ -300,11 +303,11 @@ class TimeLineText extends Component {
|
|
(lastEnd - start) * (parseFloat(this.props.parentHeight) - 100);
|
|
(lastEnd - start) * (parseFloat(this.props.parentHeight) - 100);
|
|
|
|
|
|
const flag = `+=${timeRes}%`;
|
|
const flag = `+=${timeRes}%`;
|
|
- console.log("timeRes", flag);
|
|
|
|
-
|
|
|
|
|
|
+ this.props.debug && console.log("timeRes", flag);
|
|
this.timeline = gsap.timeline({
|
|
this.timeline = gsap.timeline({
|
|
scrollTrigger: Object.assign(
|
|
scrollTrigger: Object.assign(
|
|
{
|
|
{
|
|
|
|
+ markers: this.props.debug || false,
|
|
trigger: this.containerRef.current,
|
|
trigger: this.containerRef.current,
|
|
start: "top top",
|
|
start: "top top",
|
|
end: flag,
|
|
end: flag,
|
|
@@ -401,6 +404,7 @@ TimeLineText.propTypes = {
|
|
parentHeight: PropTypes.string,
|
|
parentHeight: PropTypes.string,
|
|
keyframes: PropTypes.arrayOf(PropTypes.object),
|
|
keyframes: PropTypes.arrayOf(PropTypes.object),
|
|
progressPosition: PropTypes.number,
|
|
progressPosition: PropTypes.number,
|
|
|
|
+ textType: PropTypes.string,
|
|
};
|
|
};
|
|
|
|
|
|
TimeLineText.defaultProps = {
|
|
TimeLineText.defaultProps = {
|