Giter Club home page Giter Club logo

demo-nextjs-animejs's Introduction

Demo AnimeJS NextJS

Guide setup AnimeJS for Nextjs with Tailwind CSS

GitHub Workflow Status GitHub last commit node-current GitHub

Getting StartedDocumentationNeed Help?AboutLicense


Introduction

  1. You want integrated animation to your NextJS project and you choose AnimeJS.
  2. This project will help you understand and can add a Animation for Image/Text/v.v

Demo AnimeJS NextJS is a small project for basic setup AnimeJS for NextJS. And it will use UI farmwork Tailwind CSS


Key Features


Usage

# install libs
yarn
# run dev
yarn dev
# generate
yarn export

Getting Started

Structure

.
├── 📁 assets
   ├── 📁 styles
      └── 📝 globals.scss
   └── 📁 images
├── 📁 components
   ├── 📁 common
   └── 📁 partials
├── 📁 layouts
   ├── 📁 components
   └── 📝 default.jsx
├── 📁 pages
   ├── 📝 _app.jsx
   ├── 📝 _document.jsx
   ├── 📝 index.jsx
   ├── 📝 demo.jsx
   └── 📝 user.jsx
├── 📁 public
├── 📝 .env
├── 📝 .env.development
├── 📝 .env.production
├── 📝 jsconfig.js
├── 📝 next.config.js
├── 📝 postcss.config.js
├── 📝 tailwind.config.js
└── 📝 README.md

Prerequisites

Documentation

Configuration

  • Install lib
yarn add animejs

Example using animejs in component Logo

  • Add element image with a id
<img id="logo" src="/logo.png" alt="logo" className="w-24 mr-2" />
  • Add scripts animation for this image
useEffect(() => {
  const logoAnimation = anime.timeline({
    autoplay: true,
    delay: 200
  });
  logoAnimation
    .add({
      targets: '#logo',
      translateY: [-100, 0],
      opacity: [0, 1],
      elasticity: 600,
      duration: 1600
    })
    .add({
      targets: '#logo',
      rotate: [-360, 0],
      duration: 3000,
      elasticity: 600,
      offset: 100
    });
}, []);

Remember, you need cover codes in:

// code to run on component mount (componentDidMount)
useEffect(() => {
  // scripts animation
}, []);

Performance and testing

Any of testing activities and reports goes here.


Support

Get Help

You have a question or problem wasn't solved? No worries! Just open up a new issue in the GitHub issue tracker. Please provide all information to reproduce your problem. If you don't have a GitHub account, you can contact me directly.


About

Known Issues

  • none (that are reported)

Contact

If you haven't done so already, please check out Get Help for the fastest possible help on your issue. Alternatively you can get in touch with me by:


License

This project is proudly licensed under the MIT license.

demo-nextjs-animejs's People

Contributors

nguyentrisinh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.