All Projects → ismail9k → vue3-spring

ismail9k / vue3-spring

Licence: other
A spring-physics based animation library, and more

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to vue3-spring

React Spring
✌️ A spring physics based React animation library
Stars: ✭ 21,938 (+73026.67%)
Mutual labels:  animation-library, spring-physics
Parade
Parallax Scroll-Jacking Effects Engine for iOS / tvOS
Stars: ✭ 754 (+2413.33%)
Mutual labels:  parallax, animation-library
scrollxp
Alpine.js-esque library for scrolling animations on websites
Stars: ✭ 50 (+66.67%)
Mutual labels:  parallax, animation-library
circulate
An operating system for lending libraries
Stars: ✭ 51 (+70%)
Mutual labels:  hacktoberfest2021
cc-project-vue
一个基于vue3.0+antd+less+spring boot +mybatis+mysql+maven基础权限管理平台
Stars: ✭ 20 (-33.33%)
Mutual labels:  vue3
Open-Sentencing
To help public defenders better serve their clients, Open Sentencing shows racial bias in data such as demographics providing insights for each case
Stars: ✭ 69 (+130%)
Mutual labels:  hacktoberfest2021
react-awesome-loaders
🚀 High quality, super responsive and completely customisable Loading Animations to insert into your website with single line of code.
Stars: ✭ 146 (+386.67%)
Mutual labels:  animation-library
cerbero
Track your users interactions
Stars: ✭ 56 (+86.67%)
Mutual labels:  hacktoberfest2021
bootstrap-vue-3
Early (but lovely) implementation of Vue 3, Bootstrap 5 and Typescript
Stars: ✭ 314 (+946.67%)
Mutual labels:  vue3
excel-date-to-js
Convert Excel date in integer format into JS date. Dates are stored as numbers in Excel and count the number of days since January 0, 1900 (1900 standard, for mac it is 1904, which means January 0, 1904 is the start date). Times are handled internally as numbers between 0 and 1.
Stars: ✭ 26 (-13.33%)
Mutual labels:  hacktoberfest2021
roataway-web
Roataway web site
Stars: ✭ 15 (-50%)
Mutual labels:  hacktoberfest2021
AntiRickRoll
Chrome extension that blocks Rickrolls!
Stars: ✭ 22 (-26.67%)
Mutual labels:  hacktoberfest2021
abp-vnext-pro
Abp Vnext 的 Vue3 实现版本
Stars: ✭ 352 (+1073.33%)
Mutual labels:  vue3
vitepress-for-component
📖 针对组件开发的VitePress。
Stars: ✭ 142 (+373.33%)
Mutual labels:  vue3
HacktoberFest 2021
Hacktoberfest 2021 contribution repository✨
Stars: ✭ 43 (+43.33%)
Mutual labels:  hacktoberfest2021
basicprograms
This repo contains basics programs of all languages.
Stars: ✭ 17 (-43.33%)
Mutual labels:  hacktoberfest2021
hacktoberfest-2021
Hacktoberfest 2021. Don't forget to spread love and if you like give me a ⭐️
Stars: ✭ 17 (-43.33%)
Mutual labels:  hacktoberfest2021
smart-tagz
🏷Smart input tags for Vue
Stars: ✭ 28 (-6.67%)
Mutual labels:  vue3
space-voyager
Interactive Space App . Attention Contributers! join discord server for discussion of Issues, Pull requests https://discord.gg/FpEK9AqbCf
Stars: ✭ 18 (-40%)
Mutual labels:  hacktoberfest2021
C-plus-plus-Algorithms
Repo contains some of the most common Data Structure and Algorithm in cpp. It will be helpful in future application of Competitive Programming as well as various tech Interviews.
Stars: ✭ 19 (-36.67%)
Mutual labels:  hacktoberfest2021

Vue 3 Spring

A spring-physics based animation library, in addition to more components, to cover most of the UI related animations, when CSS is not enough for you. It shipped with Composition-API-friendly animation functions to support model-based API, in additional to animation components for the ones who prefer the template-based way This library represents the Vue3 alternative for react-spring and react-motion.

Animation Functions

Composition-API-friendly functions to support model-based API

Spring

The primary animation component, which is a spring-physics based. Its main role is to move property from one value to another, with more natural animation and easing.

Using

spring function task SpringValue as its first argument, and SpringProps optional as the second argument.

Single Value
import { spring } from 'vue3-spring';

export default {
  name: 'App',
  setup() {
    // If you passed to the spring a number as it's value
    // it return a Vue ref object.
    const mySpring = spring(100 /* [, config] */);

    // To update the spring desired value
    mySpring.value = 200;

    return { mySpring };
  },
};
Multiple Values
import { spring } from 'vue3-spring';

export default {
  name: 'App',
  setup() {
    // If you passed to the spring an object of values
    // it return a Vue reactive object, for those values
    const mySpring = spring({ x: 100, y: 20 }, { dumping: 5 });

    // To update the spring desired values
    mySpring.x = 200;
    mySpring.y = -10;

    return { mySpring };
  },
};
Reactive Values

spring also accepts Vue reactive data type (reactive, ref) as its value. It will automatically update the current spring value, when the reactive values changed.

import { ref, reactive } from 'vue';
import { spring } from 'vue3-spring';

export default {
  setup() {
    const mouse = reactive({ x: 0, y: 0 });
    const mouseSpring = spring(mouse);

    // this will update mouseSpring as well
    mouse.x = 5;

    const singleValue = ref(0);
    const singleValueSpring = spring(singleValue);

    // this will update singleValueSpring as well
    singleValue.value = 5;

    return {
      mouseSpring,
    };
  },
};

Spring Props

To config the spring physical properties, and initial values

prop type default description
from number | object 0 init value
stiffness number 170 spring stiffness, in kg / s^2
damping number 26 damping constant, in kg / s
mass number 1 spring mass
velocity number 0 initial velocity
precision number 2 number of digits to round the values, increase the number to increase precision
framesPerSecond number 60 display refresh rate
isPendulum boolean false is the animation will start agin after is dumped

Spring Value

Spring value could be number, object, Vue reactive object, or Vue ref object.

type return type auto update multiple values
number ref false false
object reactive false true
ref ref true false
reactive reactive true true

Parallax

Used move property from one value to another, based on the scrolled distance.

COMING SOON

Present

Used to apply CSS animation class to an element, when it enters the view-port.

COMING SOON

Animation Components

Components for the ones who prefer the template-based way

SpringProvider

SpringProvider accepts props same the spring function

Using

Single Value
<template>
  <spring-provider v-slot="{ value }" :to="positionX" :damping="10">
    <div class="circle" :style="{ transform: `translateX(${value}px)` }"></div>
  </spring-provider>
</template>

<script>
import { SpringProvider } from 'vue3-spring';

export default {
  name: 'App',
  components: { SpringProvider },
  data: () => ({
    positionX: 100,
  }),
};
</script>
Multiple Values
<template>
  <spring-provider v-slot="{ x, y }" :to="mouse" :damping="10">
    <div class="circle" :style="{ transform: `translate(${x}px, ${y}px)` }"></div>
  </spring-provider>
</template>

<script>
import { SpringProvider } from 'vue3-spring';

export default {
  name: 'App',
  components: { SpringProvider },
  data: () => ({
    mouse: { x: 0, y: 0 },
  }),
};
</script>

ParallaxProvider

COMING SOON

PresentProvider

COMING SOON

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].