1.0.2 • Published 2 years ago

sf-vue-background-animation v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

sf-vue-background-animation

The component is made for vue version 3. With the help of predefined animations, we can use almost anything as a background animation.

Preview

Installing

npm install sf-vue-background-animation

Usage

main.js

import { createApp } from 'vue'
import App from './App.vue'
import VueBackgroundAnimation from 'sf-vue-background-animation'

const app = createApp(App)

app.use(VueBackgroundAnimation)

app.mount('#app')

Then we simply place it in the scope where we want to use it.

### Example

>some-component.vue
```pug
<template lang="pug">

	.container
		sf-vue-background-animation(animation="float", :top="15", :left="50")
			img(src="@/assets/images/some-picture.svg")

</template>
<style  lang="scss" scoped>
	.container{
		position: relative;
	}
</style>

If the component is not parameterized, or if a non-existent animation is specified, the default values apply.

Tip: give the parent component a relative position!

Props

NameTypeDescriptionPossible valuesDefaults
animationStringpredefined animationsfloat, pulsedefault
showBooleanvisibility of the componentany valid boolean valuetrue
topNumberthe position of the component from the top, the value is calculated as a percentageany valid number value18
leftNumberthe position of the component from the left, the value is calculated as a percentageany valid number value58
rotateNumberrotationany valid number value0
zIndexNumberz-indexany valid css value10
positionStringpositionany valid css valueabsolute
transitionStringtransitionany valid css valueall 7s ease

Slots

default slot

License

Released under MIT by Schön Ferenc.

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago