Jump to content
Search Community

Ahmed Khalil

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Ahmed Khalil's Achievements

  1. for anyone who might face this issue, here is a script to load GSAP from the original CDN parallel with other scripts and wait for it to be ready on the page. This is for use with pure HTML implementation when you don't have control over the entire page (rare) <script> function loadScripts(scripts) { const promises = scripts.map((script) => { new Promise(function (resolve, reject) { var s; s = document.createElement("script"); if (script.type === "module") s.type = script.type; s.src = script.src; s.onload = resolve; s.onerror = reject; s.async = "async"; document.head.appendChild(s); }); }); return promises; } async function LoadAll() { const scripts = [ { type: "", src: "https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.0/gsap.min.js", }, { type: "module", src: "https://other-script.js", }, ]; const scriptPromises = loadScripts(scripts); await Promise.all(scriptPromises); } async function gsapReady() { return new Promise(function (resolve, reject) { if (window.gsap) { return resolve(); } else { setTimeout(async () => { return resolve(gsapReady()); }, 1); } }); } (async () => { await LoadAll(); await gsapReady(); console.log(gsap); })(); </script>
  2. Thank you so much, that works
  3. Hello, I'm using GSAP in an HTML file and can't use `npm` and i want to make sure the script is loaded before i start using it so my current implementation looks like this <script async src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.0/gsap.min.js"></script> <script type="module"> // import my stuff here console.log(gsap); // start using GSAP </script> I have to use async or defer while loading all external dependencies which means in slow connections my script will run in parallel while GSAP is still loading (already tested and it gives error that GSAP is not defined) is there a way to hold my script until GSAP is loaded? I tried: import {gsap} from 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.0/gsap.min.js'; but it didn't work, any ideas? Thank you
  4. This might be a bit out of the bloom, but is there a way to generate video from a GSAP animation? even with constraints
  5. does this website use https://alvarotrigo.com/fullPage ? (I'm not sure)
  6. @ZachSaucier Thanks so much, actually my team is looking to dig deeper in this area, essentially what we are building is a `cool new shopping experience` we come from long experience in ecommerce and want to blend that with webGL and GSAP. Is there other areas you recommend us to explore beside Curtain JS? Thanks so much Ahmed
  7. Hello friends, Does anyone know how Simon here created the photos effect for the sample projects? https://simondaufresne.com/ Simon, if you are here, you are an absolute legend bro Best, Ahmed
×
×
  • Create New...