0.1.9 • Published 5 years ago

@morlz/motion v0.1.9

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@morlz/motion

Demo

npm run demo

See gif: npm.io

Installing

npm i @morlz/motion
yarn add @morlz/motion

Usage

index.js file:

import Vue from 'vue'
import Motion from '@morlz/motion'

//options are optional
Vue.use(Motion, {
	quasar: false,
	duration: 375
})

Layout.vue

<layout>
	<div>
		<router-view name="list"/>
	</div>

	<router-view name="modal"/>
</layout>

List.vue

<list>
	<item
		v-for="item in items"
		v-motion-from="'anynamespace'"/>
</list>

Modal.vue

<modal v-motion-to="'anynamespace'">
	<item-full/>
</modal>

routes.js

{
	path: '/any-path/',
	component: () => import ('#/Layout'),
	children: [
		{
			path: '',
			components: {
				list: () => import ('#/List')
			},
		},
		{
			path: ':id',
			components: {
				list: () => import ('#/List'),
				modal: () => import ('#/Modal')
			}
		},
	]
}

If you use Quasar-framework then use the noRouteDismiss attribute on QModal

API

Events

v-motion-to Has emit the following events to context vm:

  • motion:show when show animation start
  • motion:showed when show animation end
  • motion:hide when hide animation start
  • motion:hided when hide animation end
  • motion:move(styles) when animation is running

Modifers

v-motion-from.round If the starting block is round

Styles

  • width range 0 - 100 %
  • height range 0 - 100 %
  • x px position at the page by x axis
  • y px position at the page by y axis
  • r range 0 - 1 border radius
  • progress range 0 - 1 animation position

Injected $motion

Object styles vm.$motion updates only in the component containing v-motion-to.

  • current current styles
  • progress progress from styles
  • to styles of fullscreen modal

MIT License

Copyright (c) 2018 morlz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago