1.0.0 • Published 2 years ago

sf-vue-animated-cursor v1.0.0

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

sf-vue-animated-cursor

Parameterizable animated cursor for vue 3.

Preview

Installing

npm install sf-vue-animated-cursor

Usage

Two things can be called from the plugin.

  • basic cursor, which can be easily parameterized and with which you can build according to your own taste
  • default cursor, which is a built-in cursor that can only set the target, teleportTo, watch properties

Options

  • basic: if you want to use the built-in cursor instead of the basic cursor, you only need to specify 'basic: false' in the options

main.js

import { createApp } from 'vue'
import App from './App.vue'
import SfVueAnimatedCursor from 'sf-vue-animated-cursor'

const app = createApp(App)

app.use(SfVueAnimatedCursor, { basic: false });

app.mount('#app')

Then it can be placed anywhere, but make sure that the target value (by default #app) is valid.

### Example

>App.vue
```pug
<template lang="pug">

#app
    sf-vue-animated-cursor(
		target="#app"
		teleport-to="body"
  		@move="onMove"
  		@click="onClick"
  		@hover="onHover"
	)

</template>

Tip: With the teleport property, you can set where the cursor should be located in the html.

Props

All properties can be used only with the basic cursor. For the default cursor, you can only set the target, teleportTo, and watch properties.

NameTypeDescriptionPossible valuesDefaults
teleportToStringteleports the cursor to the specified selectorany html elementbody
targetStringthe cursor works within the specified selectorany html elemen#app
showBooleancursor visibilitytrue, falsetrue
watchBooleanif the emitted values are not needed, set it to falsetrue, falsetrue
widthNumbercursor widthany number6px
heightNumbercursor heightany number6px
bgColorStringcursor background colorany color#657786
borderColorStringcursor border colorany color#657786
borderWidthNumbercursor border widthany number1px
borderRadiusNumbercursor border radiusany number50%
slowDownNumberslowing down the speed of the animated cursorany number0s
hoverableStringthe class name that activates the hover effectany html elemenhoverable
hoverAnimationBooleanhover animation on/offtrue, falsetrue
clickAnimationBooleanclick animation on/offtrue, falsetrue
mixBlendModeStringmix blend modeany valid css valuedifference
scaleOnClickNumberthe scale value of the click eventany number2
scaleOnHoverClickNumberthe scale value of the click event, while hoveringany number2
scaleOnHoverNumberthe scale value of the hover eventany number3
opacityOnHoverNumberthe opacity value of the hover eventany number0.5

Emits

EventEmited values
moveposition x, position y, cursorvisibility
clicktrue, false
hovertrue, false

License

Released under MIT by Schön Ferenc.

1.0.0

2 years ago

0.1.4

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago