Jump to content
Search Community

tdjmNZ

Members
  • Posts

    1
  • Joined

  • Last visited

tdjmNZ's Achievements

0

Reputation

  1. Hi there, Love the GSAP library! I'm curious to know what the GSAP community's UX thoughts are on fully letting timelines play out before a new event timeline is initialised? For Example User clicks on icon. Event triggers icon morph-in animation & modal open visibility animation. User clicks on morphed-in icon. Event triggers icon morph-out animation & modal close visibility animation. Timeline is about 0.8 seconds long. Would you prefer to run something like this to ensure the morph in/out & modal open/close animation timelines are forced to fully finish before the in/out open/close plays? if ( !trigger.classList.contains("active") ) { if (tlIconMorphOut.isActive()) { return; } tlIconMorphIn.restart(); tlIconMorphIn.play(); tlModalOpen.restart(); tlModalOpen.play(); trigger.classList.add("active"); } else { if (tlIconMorphIn.isActive()) { return; } tlIconMorphOut.restart(); tlIconMorphOut.play(); tlModalClose.restart(); tlModalClose.play(); trigger.classList.remove("active"); } Or immediately on event trigger? Thanks!
×
×
  • Create New...