Top Related Projects
Javascript library to create physics-based animations
JavaScript animation engine
GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
The motion graphics toolbelt for the web
🤹 Vue Composables putting your components in motion
🎬 Scene.js is JavaScript & CSS timeline-based animation library
Quick Overview
Vue Kinesis is a lightweight Vue.js component library that allows developers to easily create interactive animations based on mouse or device movement. It provides a set of components and directives to create parallax effects, transformations, and other motion-based interactions without complex JavaScript or CSS.
Pros
- Easy to integrate and use with Vue.js projects
- Highly customizable with various animation types and properties
- Responsive and works well on both desktop and mobile devices
- Lightweight and performant
Cons
- Limited documentation and examples
- May require additional optimization for complex animations
- Dependency on Vue.js framework
- Might not be suitable for projects requiring more advanced or specific animation needs
Code Examples
- Basic Kinesis Container:
<template>
<kinesis-container>
<kinesis-element :strength="10">
<h1>Hello, Vue Kinesis!</h1>
</kinesis-element>
</kinesis-container>
</template>
This example creates a basic kinesis container with a single element that moves based on mouse movement.
- Custom Transformation:
<template>
<kinesis-container>
<kinesis-element
:strength="20"
type="depth"
:transformOrigin="'50% 50%'"
>
<img src="your-image.jpg" alt="Animated Image" />
</kinesis-element>
</kinesis-container>
</template>
This example applies a depth transformation to an image, creating a 3D-like effect.
- Multiple Elements with Different Properties:
<template>
<kinesis-container>
<kinesis-element :strength="10" type="translate">
<h2>Translate Me</h2>
</kinesis-element>
<kinesis-element :strength="20" type="rotate">
<p>Rotate Me</p>
</kinesis-element>
<kinesis-element :strength="15" type="scale">
<div>Scale Me</div>
</kinesis-element>
</kinesis-container>
</template>
This example demonstrates multiple kinesis elements with different transformation types within a single container.
Getting Started
-
Install the package:
npm install vue-kinesis
-
Import and use in your Vue.js project:
import Vue from 'vue' import VueKinesis from 'vue-kinesis' Vue.use(VueKinesis)
-
Use the components in your template:
<template> <kinesis-container> <kinesis-element :strength="10"> <p>Your content here</p> </kinesis-element> </kinesis-container> </template>
-
Customize the animation properties as needed using the available props and options.
Competitor Comparisons
Javascript library to create physics-based animations
Pros of dynamics.js
- Framework-agnostic, can be used with any JavaScript project
- Focuses on physics-based animations, offering more realistic motion
- Smaller library size, potentially better performance for simple animations
Cons of dynamics.js
- Less feature-rich compared to vue-kinesis
- Requires more manual setup and configuration
- Not specifically designed for Vue.js integration
Code Comparison
dynamics.js:
dynamics.animate(element, {
translateX: 100,
scale: 2
}, {
type: dynamics.spring,
duration: 1000
});
vue-kinesis:
<kinesis-container>
<kinesis-element :strength="10">
<div>Animated content</div>
</kinesis-element>
</kinesis-container>
Key Differences
- vue-kinesis is specifically designed for Vue.js, offering easier integration with Vue components
- dynamics.js provides more control over animation physics, while vue-kinesis focuses on declarative, component-based animations
- vue-kinesis offers a wider range of animation types and effects out of the box
- dynamics.js requires more JavaScript code to set up animations, while vue-kinesis uses a more declarative, template-based approach
Use Cases
-
Choose dynamics.js for:
- Framework-agnostic projects
- Precise control over physics-based animations
- Smaller, focused animation needs
-
Choose vue-kinesis for:
- Vue.js projects
- Quick implementation of complex animations
- Declarative, component-based animation structure
JavaScript animation engine
Pros of anime
- More versatile, can be used with any JavaScript project, not limited to Vue.js
- Larger community and more frequent updates
- Supports a wider range of animation types and properties
Cons of anime
- Requires more manual setup and configuration for complex animations
- Steeper learning curve for beginners
- May have a larger file size, potentially impacting page load times
Code Comparison
vue-kinesis:
<kinesis-container>
<kinesis-element :strength="10">
<div>Animated element</div>
</kinesis-element>
</kinesis-container>
anime:
anime({
targets: '.element',
translateX: 250,
rotate: '1turn',
duration: 800,
easing: 'easeInOutQuad'
});
Summary
vue-kinesis is specifically designed for Vue.js projects, offering easy-to-use components for mouse-based animations. It's ideal for quickly adding interactive elements to Vue applications.
anime is a more general-purpose animation library that can be used in any JavaScript project. It offers greater flexibility and a wider range of animation options but requires more setup and JavaScript knowledge to implement effectively.
The choice between the two depends on the project requirements, the developer's familiarity with Vue.js, and the complexity of the desired animations.
GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
Pros of GSAP
- More comprehensive animation capabilities, including complex timelines and advanced easing
- Broader browser support and better performance optimization
- Extensive documentation and large community support
Cons of GSAP
- Steeper learning curve due to its extensive feature set
- Larger file size, which may impact load times for smaller projects
- Not specifically designed for Vue.js, requiring additional setup for integration
Code Comparison
GSAP:
import { gsap } from "gsap";
gsap.to(".box", { duration: 1, x: 100, y: 100, rotation: 360 });
vue-kinesis:
<template>
<kinesis-container>
<kinesis-element :strength="10">
<div class="box"></div>
</kinesis-element>
</kinesis-container>
</template>
Summary
GSAP offers a more powerful and versatile animation toolkit suitable for complex projects across various frameworks. vue-kinesis, on the other hand, provides a simpler, Vue-specific solution for basic parallax and motion effects. While GSAP excels in animation capabilities and performance, vue-kinesis offers easier integration and a gentler learning curve for Vue.js developers working on smaller projects or those primarily focused on parallax effects.
The motion graphics toolbelt for the web
Pros of mojs
- More comprehensive animation toolkit with a wider range of features
- Language-agnostic, can be used with various frameworks or vanilla JavaScript
- Larger community and more extensive documentation
Cons of mojs
- Steeper learning curve due to its extensive API
- Potentially heavier in terms of file size and performance impact
Code Comparison
mojs:
const burst = new mojs.Burst({
radius: { 0: 100 },
count: 5,
children: {
shape: 'circle',
fill: { 'cyan' : 'yellow' },
duration: 2000
}
});
vue-kinesis:
<kinesis-container>
<kinesis-element :strength="10">
<div class="box"></div>
</kinesis-element>
</kinesis-container>
Key Differences
- vue-kinesis is specifically designed for Vue.js, while mojs is framework-agnostic
- mojs offers more complex animations and effects, while vue-kinesis focuses on simpler, mouse-based interactions
- vue-kinesis has a more declarative, component-based approach, whereas mojs uses a programmatic API
Use Cases
- Choose mojs for complex, custom animations across various web projects
- Opt for vue-kinesis when working with Vue.js and needing quick, interactive mouse-based effects
Community and Support
mojs has a larger community and more resources available, while vue-kinesis is more niche but well-suited for Vue.js developers looking for simple interactivity.
🤹 Vue Composables putting your components in motion
Pros of motion
- More comprehensive animation capabilities, including spring animations and scroll-based effects
- Better TypeScript support and type definitions
- Actively maintained with frequent updates and a larger community
Cons of motion
- Steeper learning curve due to more complex API
- Potentially higher bundle size for simpler animation needs
Code Comparison
vue-kinesis:
<kinesis-container>
<kinesis-element :strength="10">
<div>Animated element</div>
</kinesis-element>
</kinesis-container>
motion:
<template>
<div v-motion :initial="{ opacity: 0, y: 100 }" :enter="{ opacity: 1, y: 0 }">
Animated element
</div>
</template>
Summary
motion offers more advanced animation features and better TypeScript support, making it suitable for complex projects. However, it may be overkill for simple animations. vue-kinesis provides a simpler API for basic mouse-based animations but lacks the versatility of motion. Choose motion for comprehensive animation needs and active development, or vue-kinesis for straightforward mouse-driven effects with a gentler learning curve.
🎬 Scene.js is JavaScript & CSS timeline-based animation library
Pros of Scene.js
- More versatile, supporting various animation types beyond just kinetic effects
- Offers a wider range of features, including timeline controls and easing functions
- Can be used with multiple frameworks, not limited to Vue.js
Cons of Scene.js
- Steeper learning curve due to more complex API and features
- Potentially heavier in terms of file size and performance impact
Code Comparison
Vue Kinesis:
<kinesis-container>
<kinesis-element :strength="10">
<div>Animated element</div>
</kinesis-element>
</kinesis-container>
Scene.js:
import Scene from "scenejs";
const scene = new Scene({
".animated": {
0: { opacity: 0, transform: "translate(0, 0)" },
1: { opacity: 1, transform: "translate(100px, 100px)" },
},
});
scene.play();
Summary
Vue Kinesis is a simpler, more focused library for creating kinetic effects in Vue.js applications. It's easier to use for basic animations but limited in scope. Scene.js, on the other hand, offers a more comprehensive animation toolkit that can be used across different frameworks. It provides more advanced features but requires a deeper understanding of its API. The choice between the two depends on the specific project requirements and the developer's familiarity with animation concepts.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
October 2024: A full TS version is now available KinesisJS. You can use it in your vue projects if you need any of the new features. It works with Vue but a dedicated Vue version is in the works.
March 2024: The project has been on standby for a while now. But good news! I'm working on a brand new version, more robust, with better documentation and more features!
What's in preparation:
- Rewriting everything in TS
- New interactions
- A detailed documentation
- A vanilla TS version
vue-kinesis
Easy to use Vue.js components for creating interactive animations
Demo
Tutorials
- LogRocket - Top 5 Vue Animation Libraries
- LogRocket - Interactive Vue Animations with Kinesis
- Leonardo Gruppelli - Kinesis Animation for Nuxt
- Coliss - 便å©ãªã®ãç»å ´ï¼Vue.jsã§ã¤ã³ã¿ã©ã¯ãã£ããªã¢ãã¡ã¼ã·ã§ã³ãç°¡åã«å®è£ ã§ãã軽éã³ã³ãã¼ãã³ã -Kinesis
- Kabanoki - ã³ã¤ãåããï¼ï¼çãªã¢ãã¡ã¼ã·ã§ã³ãä»ãããããvue-kinesisã
- Mebee - Nuxt.js vue-kinesisã使ç¨ãã¦ã¢ãã¡ã¼ã·ã§ã³ãããã
- ... Feel free to open a PR if you want to suggest a tutorial link ð
Vue3 - Installation
npm install --save vue-kinesis@next
Vue3 - Default import
Install all the components:
import { createApp } from "vue";
import App from "./App.vue";
import VueKinesis from "vue-kinesis";
const app = createApp(App);
app.use(VueKinesis);
app.mount("#app");
Vue2 - Installation
npm install --save vue-kinesis
Vue2 - Default import
Install all the components:
import Vue from 'vue'
import VueKinesis from 'vue-kinesis'
Vue.use(VueKinesis)
Use specific components:
import Vue from 'vue'
import { KinesisContainer, KinesisElement } from 'vue-kinesis'
Vue.component('kinesis-container', KinesisContainer)
Vue.component('kinesis-element', KinesisElement)
Browser
<script src="vue.js"></script>
<script src="vue-kinesis.min.js"></script>
Usage
Props
kinesis-container
Prop | Type | Default Value | Description |
---|---|---|---|
active | Boolean | true | To enable or disable the interactions |
duration | Number | 1000 | Speed of the parallax animation in ms |
easing | String | "cubic-bezier(0.23, 1, 0.32, 1)" | Easing of the parallax animation |
tag | String | div | Takes any valid html tag |
event | String | "move" | Event to which the container will react. Possible values are "move" and "scroll" |
perspective | Number | 1000 | Effective for the 'depth' parallax type |
audio | String | Path towards an audio file | |
playAudio | Boolean | Start/Stop the attached audio file |
kinesis-element
Prop | Type | Default Value | Description |
---|---|---|---|
strength | Number | 10 | Strength of the motion effect |
type | String | "translate" | translate - rotate - scale - scaleX - scaleY - depth - depth_inv |
tag | String | "div" | Takes any valid html tag |
transformOrigin | String | "center" | Similar to the CSS transform-origin property |
originX | Number | 50 | The motion's origin relative to the container, on the X axis. 50 being the center of the container, 0 the left side, 100 the right side. |
originY | Number | 50 | The motion's origin relative to the container, on the Y axis. 50 being the center of the container, 0 the top side, 100 the bottom side. |
axis | String | null | Constrain the movement to one axis. Possible values: "x" - "y" |
maxX | Number | null | Limit the maximum range of the movement on the X axis |
maxY | Number | null | Limit the maximum range of the movement on the Y axis |
minX | Number | null | Limit the minimum range of the movement on the X axis |
minY | Number | null | Limit the minimum range of the movement on the Y axis |
cycle | Number | 0 | How many times the movement will repeat |
kinesis-audio
Prop | Type | Default Value | Description |
---|---|---|---|
audioIndex | Number | 50 | To which frequency to react, on a range of integer values that goes from 0 to 127. |
strength | Number | 10 | Strength of the motion effect |
type | String | "translate" | translate - rotate - scale - scaleX - scaleY - depth - depth_inv |
tag | String | "div" | Takes any valid html tag |
transformOrigin | String | "center" | Similar to the CSS transform-origin property |
originX | Number | 50 | The motion's origin relative to the container, on the X axis. 50 being the center of the container, 0 the left side, 100 the right side. |
originY | Number | 50 | The motion's origin relative to the container, on the Y axis. 50 being the center of the container, 0 the top side, 100 the bottom side. |
axis | String | null | Constrain the movement to one axis. Possible values: "x" - "y" |
maxX | Number | null | Limit the maximum range of the movement on the X axis |
maxY | Number | null | Limit the maximum range of the movement on the Y axis |
minX | Number | null | Limit the minimum range of the movement on the X axis |
minY | Number | null | Limit the minimum range of the movement on the Y axis |
cycle | Number | 0 | How many times the movement will repeat |
Migrating from vue-mouse-parallax
Migration from vue-mouse-parallax is quite easy:
Components
- parallax-container -> kinesis-container
- parallax-element -> kinesis-element
Props
- parallaxStrength -> strength
- animationDuration -> duration
Prop values
- translation -> translate
- rotation -> rotate
License
Top Related Projects
Javascript library to create physics-based animations
JavaScript animation engine
GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
The motion graphics toolbelt for the web
🤹 Vue Composables putting your components in motion
🎬 Scene.js is JavaScript & CSS timeline-based animation library
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot