Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new registerEases option #44

Merged
merged 1 commit into from
May 6, 2023
Merged

Conversation

ivodolenc
Copy link
Member

Type of Change

  • New feature

Request Description

Adds new registerEases option that provides an easy way to register global eases.

Register Eases

// nuxt.config.ts

{
  gsap: {
    registerEases: [
      {
        name: 'customEase',
        ease: progress => {
          return progress // linear
        }
      },
      {
        name: 'customEase2'
        // ...
      }
    ]
  }
}

Available globally

const { $gsap } = useNuxtApp()

$gsap.to('.class', { x: 100, ease: 'customEase' })
$gsap.to('#id', { x: 200, ease: 'customEase2' })

@ivodolenc ivodolenc added the feat New feature label May 6, 2023
@ivodolenc ivodolenc merged commit e03b9b0 into main May 6, 2023
@ivodolenc ivodolenc deleted the feat/register-eases branch May 6, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant