spotlight-vue

Key activable spotlight for Vue.js (initially built for Slidev)
1,508 1
Install
npm install spotlight-vue
Latest Version:0.5.1
Vue:3
License:MIT
Last Updated:Apr 2, 2024
Links: GitHub  ·  npm
Maintainer: tonai

spotlight-vue

NPM version

Key activable spotlight for Vue.js (initially built for Slidev)

Spotlight demo

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 spotlight
  • active (type; boolean): Activate manually the spotlight
  • color (type: string, default: 'black'): CSS color of the spotlight shadow
  • opacity (type: number | string, default: 0.75): Opacity of the spotlight shadow
  • size (type: string, default: 100px): Size of the spotlight
  • transitionDuration (type: string, default: 200ms): CSS transition durations
  • x (type; number): Set manually the spotlight X position
  • y (type; number): Set manually the spotlight Y position

Events

  • activate: Fired when component is activated
  • deactivate: Fired when component is deactivated
  • update: 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 container
  • y (type: number): Y position in percentage of the container

Related Packages

slidev-component-spotlight

Key activable spotlight for Slidev

1,429 6
slidev-addon-asciinema

Slidev addon to embed asciinema casts to presentations.

2,022 13
slidev-component-progress

Progress component for Slidev

1,858 24
@olzhas-adiyatov/slidev-addon-asciinema

A fork of the slidev addon to embed asciinema casts to presentations. In this fo...

797 0
slidev-component-poll

Poll component for Slidev

2,322 55

Version History

Version Released Vue License
0.5.1 ^3.2.31 MIT
0.4.5 ^3.2.31 GPL
0.4.4 ^3.2.27 GPL
0.4.3 ^3.2.27 GPL
0.4.2 ^3.2.27 GPL