Getting Started • Documentation • Need Help? • About • License
- You want integrated animation to your
NextJS project
and you chooseAnimeJS
. - This project will help you understand and can add a
Animation
forImage
/Text
/v.v
Demo AnimeJS NextJS is a small project for basic setup AnimeJS for NextJS. And it will use UI farmwork Tailwind CSS
# install libs
yarn
# run dev
yarn dev
# generate
yarn export
.
├── 📁 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
- Install lib
yarn add animejs
- Add element
image
with aid
<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
}, []);
Any of testing activities and reports goes here.
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.
- none (that are reported)
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:
- Email: [email protected]
This project is proudly licensed under the MIT license.