Jump to content
Search Community

microeinhundert

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by microeinhundert

  1. Hello everyone, i think this is more of a math related question i struggle finding a solution for.

     

    I have a slider that is draggable and stops at the different slides with a snap point. Now i want to tween a value from 0 to 1 while between the snap points. I need a way to calculate the progress to the next snap point, that means 0 if at one of the snap points and 1 if 1px in front of the next snap point, then back at 0 and again from the beginning. Is there some math magic ?that can give me this value?

     

    Thanks in advance.

     

     

    Bildschirmfoto 2019-06-14 um 07.53.27.png

  2. I ended up importing the plugins in nuxt.config.js like this:

     

      head: {
        script: [
          { src: '/DrawSVGPlugin.min.js' }
        ]
      },

     

    and placed the plugin file inside the static folder (ih the root directory) . This method also works with nuxt generate.

    • Like 5
  3. Just testet it with a fresh Nuxt.js project and got the same error as in the thread you linked, adding 

    if (isClient) {
       config.entry.app.push('gsap','gsap/DrawSVGPlugin');
    }

    to the extend function in nuxt.config.js fixed the problem.

    • Like 1
  4. Hello everyone,

     

    i just started using the Club Greensock Plugins with Nuxt.js and quickly faced the problem of importing them using the ES6 import syntax. I have tried multiple methods to get it working, but all i get is the error "Cannot read property 'middleware' of undefined" after importing it in my component with "import 'gsap/DrawSVGPlugin'". Importing TimelineMax works. The same happens when using a private git repo like described here:

     

    All the files from the Club Download's "bonus-files-for-npm-users" folder are in the root of the gsap package downloaded from npm, with a custom package.json like described in the post above.

     

    Thanks in advance

    • Like 1
×
×
  • Create New...