StevenJPx2 / nugget

Democratize premium animations ✨
https://nugget.stevenjohn.co
MIT License
11 stars 1 forks source link
gsap locomotive-scroll nuxt nuxt-module nuxt3 vue

Nugget

Nugget

npm version npm downloads License Nuxt

Democratize premium animations using nugget. Nugget exposes different headless, unstyled composables and components to allow you to have the flexibility to animate what you want, but also has sane, beautiful presets that you do not have to break your head over.

Nugget Preview

Usage

<script setup lang="ts">
const container = ref<HTMLDivElement | null>(null);

const { play } = useBakedTransition({
  parentContainer: container,
  animationOptions: {
    translate: true,
    scale: "in",
    skew: "bottom",
  },
});
</script>

<template>
  <button @click="play()">Hello!</button>
  <h1
    v-split-animate="{
      baked: true,
      options: {
        splitBy: 'lines',
        animationOptions: { translate: true },
        splitOptions: {
          wrapping: {
            select: 'lines',
            wrapClass: 'inline-block overflow-hidden',
          },
        },
      },
    }"
  >
    Nuxt is so cool, and this module is quite awesome.
  </h1>
</template>

Quick Setup

  1. Add @fdcn/nugget dependency to your project
# Using pnpm
pnpm add -D @fdcn/nugget

# Using yarn
yarn add --dev @fdcn/nugget

# Using npm
npm install --save-dev @fdcn/nugget
  1. Add @fdcn/nugget to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ["@fdcn/nugget"],
});

That's it! You can now use Nugget Module in your Nuxt app ✨

Roadmap

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release