I know this is an amateur's question, but I having a hard time trying to use the scrolltrigger plugin with hype ( https://greensock.com/scrolltrigger/ )
My main goal is to make a page similar to this https://www.apple.com/airpods-pro/
I ve tried it with scrollmagic but never found out how to make those easy in-out scrollings
Any help would be much appreciated
Hans, i ve downloaded the example before posting, but my problem is that I can't figure out how to make scrolling smoother.
If you take a look on apple's page, the img sequence keeps playings a little, after we stop scrolling creating a smooth effect. In scrollTrigger there's an option called scrubbing, which, if set to 1, it achieves that.
Any suggestions?
thank you in advance
one last question...I ve manage to play a spritesheet with this method and worked as expected. But I think is not the optimal solution when loading heavy animations. Any chance to implement this with an image sequence???
For some reason the attached file when published, does not do produce the scroll animation in my browser. Chrome / Safari / Firefox.
Is it just my browser?
Also, curious to know what is the difference / Pros and Cons of using this approach vs. the approach below, which was found in another file on the forum:
var symbolInstance = hypeDocument.getSymbolInstanceById(element.id);
var timelineNameToControl = 'Menuscroll';
var duration = symbolInstance.durationForTimelineNamed(timelineNameToControl);
var step = duration/50;
if (window.addEventListener) {
window.addEventListener("mousewheel", getScrollDir, false);
//FF
window.addEventListener("DOMMouseScroll", getScrollDir, false);
}
function getScrollDir(e){
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
console.log(delta, duration);
if(delta === -1){
newTime = symbolInstance.currentTimeInTimelineNamed(timelineNameToControl) + step;
symbolInstance.goToTimeInTimelineNamed(newTime, timelineNameToControl);
} else {
newTime = symbolInstance.currentTimeInTimelineNamed(timelineNameToControl) - step;
symbolInstance.goToTimeInTimelineNamed(newTime, timelineNameToControl);
}
}
Hans, my main problems as I ve started a project based in your file, are two:
The spritesheet for the animation takes too long to load
The page isn't adjustable in terms of height (makes sense) as I cant scoll down to the bottom of the page (makes sense also). Scrollmagic example you provided Where I have to put prepared HTML, CSS and JS? has not this problem as it "freezes" it terms of height the position of the animation, but the rest of the page scrolls normally. Any change to have scrollmagic with scroll momentum???