You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I enter the main page (index.html) and navigate to the work page everything works as expected. But once I refresh the page in the workpage and not the initial page everything stops working -- what could be the reason for this?
I've tried refreshing animations in the barbajs code and it seems that it doesn't work even with the usage of Barba views to reinitialize the animations explicitly. Perhaps I'm calling my animations in the wrong barbaHook? I've already made issues with GSAP and I was told that this issue could be related to barba and not gsap itself but I'm still trying to figure it out with GSAP as well.
// NOTE: data.next = current containerbarba.init({sync: true,timeout: 7000,debug: true,// !IMPORTANTviews: [{namespace: 'work-page',afterEnter(){initWorkAnimations();ScrollTrigger.refresh();console.log('WORRRRRRK PAFGE ENTER');},}],transitions: [{name: 'default',asynconce(data){// Once page loadsinitSmoothScroll(data.next.container);initScripts();},asyncleave(data){pageTransitionIn(data,this)awaitdelay(1200)data.current.container.remove();},asyncenter(data){pageTransitionOut(data,this);},asyncbeforeEnter(data){ScrollTrigger.getAll().forEach((x)=>x.kill());// ctx.revert(); something I tried doing but nothing workedconsole.log('destroying everything');locoScroll.destroy();// Optional!initSmoothScroll(data.next.container);initScripts();ScrollTrigger.refresh();// IMPORTANT!}},{// Optionalname: 'to-home',from: {},to: {namespace: ['first-page']},once(data){// do something once on the initial page loadinitSmoothScroll(data.next.container);initScripts();},}]})
Expected behavior
No matter where the page refreshes all animations should be working even when transitioning from page to page at any page.
Actual behavior
Animations break once is refreshed at any other page (not being the index.html) meaning the animations stop working for my workpage.html and the rest.
ADDITIONAL BUG (MIGHT NOT BE RELATED)
I'm also having another weird issue where I want to run all my animations at the same time by setting an id on each body tag and checking if it exist then execute that animation. This works except once I get to the initWorkAnimations() stuff also breaks except the first page.
For example:
functioninitHomeAnimations(){if(document.body.id==='first-page'){// WORKS !!//Page 2consttlH=gsap.timeline(....}
functioninitWorkAnimations(){if(document.body.id==='work-page'){// WORKS !! BUT NOW initHomeAnimations() doesn't work//Page 2consttlH=gsap.timeline(....}
If I see 'work-page' to'first-page' everything works even the initHomeAnimations() which is weird but not when I set it to 'work-page'.
NOTE: I'm calling all my animations in my initScripts() but I excluded the initWorkAnimations() since it didn't work so I tried doing it explicitly with views.
// Main ScriptsfunctioninitScripts(){initNavAnimations();initMagneticButtons();initButtonsAnimations();initHomeAnimations();// initWorkAnimations();}
The problem
When I enter the main page (index.html) and navigate to the work page everything works as expected. But once I refresh the page in the workpage and not the initial page everything stops working -- what could be the reason for this?
I've tried refreshing animations in the barbajs code and it seems that it doesn't work even with the usage of Barba views to reinitialize the animations explicitly. Perhaps I'm calling my animations in the wrong barbaHook? I've already made issues with GSAP and I was told that this issue could be related to barba and not gsap itself but I'm still trying to figure it out with GSAP as well.
For full code: https://github.com/officialgio/officialgio.github.io
Visual: https://www.youtube.com/watch?v=FbkBvcjlCYI
Expected behavior
No matter where the page refreshes all animations should be working even when transitioning from page to page at any page.
Actual behavior
Animations break once is refreshed at any other page (not being the index.html) meaning the animations stop working for my workpage.html and the rest.
ADDITIONAL BUG (MIGHT NOT BE RELATED)
I'm also having another weird issue where I want to run all my animations at the same time by setting an id on each body tag and checking if it exist then execute that animation. This works except once I get to the
initWorkAnimations()
stuff also breaks except the first page.For example:
If I see 'work-page' to'first-page' everything works even the
initHomeAnimations()
which is weird but not when I set it to 'work-page'.NOTE: I'm calling all my animations in my
initScripts()
but I excluded theinitWorkAnimations()
since it didn't work so I tried doing it explicitly with views.The text was updated successfully, but these errors were encountered: