Closed BB-000 closed 4 years ago
Once you install it like npm install scrollscene
navigate to node_modules/scrollscene
and check out all the files. There's only a few there. You can import each file as you see fit. Let me know if that works.
Technically you should be able to
const plugin = require('scrollscene');
console.log(plugin.ScrollScene);
console.log(plugin.ScrollObserver);
Thanks, I did try that but couldn't get it to work. Tried again but no more luck. Loads of requirejs errors. Possibly because the .js files in node_modules are 'esm' or 'commonjs' flavours?
e.g. "Uncaught Error: Module name "@babel/runtime/helpers/interopRequireDefault" has not been loaded yet for context: . Use require([])" and "require.js:166 Uncaught Error: Module name "is-client" has not been loaded yet for context: . Use require([])"
Anyway I've spent way too much time trying to get scrollmagic working in stupid magento 2 :( I've decided to code a simple function myself
Cheers!
@BB-000 are you on the latest version? That is a babel error, and I have that set as a dependency.
Just wanted to call out as well if you're interested in using ScrollMagic like this, just reference it on the CDN. https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js
The entire purpose of this package was really to combat ESM issues. I'd give it a shot with just using script
inclusions like the good ol' days. Nothing wrong with that!
Unfortunately even just using Githubissues.
Hi, I need to use this, but am in a Magento 2 project 🤢 so have to use their flavour of requireJs...
Is there a .js file available I can load in myself using this?
I have tried unsuccessfully to get it working in Magento2 using npm.
Cheers!!