spotlight-vue
v0.5.1
Published
Key activable spotlight for Vue.js (initially built for Slidev)
Downloads
6
Readme
spotlight-vue
Key activable spotlight for Vue.js
(initially built for Slidev)
Installation
npm i spotlight-vue
Usage
Import with:
import Spotlight from 'spotlight-vue';
// Also import styles
import 'spotlight-vue/dist/style.css';
Register the plugin:
Vue.use(Spotlight);
Use it in your Vue.js
app with:
<spotlight/>
In your app, maintain the Shift key pressed and the spotlight should appear.
Parameters
activationKey
(type:string
, default:'Shift'
): The key to hold down to activate the spotlightactive
(type;boolean
): Activate manually the spotlightcolor
(type:string
, default:'black'
): CSS color of the spotlight shadowopacity
(type:number | string
, default:0.75
): Opacity of the spotlight shadowsize
(type:string
, default:100px
): Size of the spotlighttransitionDuration
(type:string
, default:200ms
): CSS transition durationsx
(type;number
): Set manually the spotlight X positiony
(type;number
): Set manually the spotlight Y position
Events
activate
: Fired when component is activateddeactivate
: Fired when component is deactivatedupdate
: Fired when component is active and position is updated
All three events also send a position object with the following shape:
x
(type:number
): X position in percentage of the containery
(type:number
): Y position in percentage of the container