0.4.2 • Published 3 years ago

@spb-web/box-overlay v0.4.2

Weekly downloads
20
License
ISC
Repository
github
Last release
3 years ago

Main Hero Magic to highlight yourself!

@spb-web/box-overlay <@spb-web/box-overlay> GitHub issues

no dependencies, works with animated elements, simple api, typescript, modern, can highlight multiple elements

Demo | Docs | Issues

npm bundle size npm bundle size npm version

It uses Size Limit to control size.

Install

npm i @spb-web/box-overlay --save

Example

const boxOverlay = new BoxOverlay()

let currentIndex = 0

const selectors = [
    ['.example-element1'],
    ['.example-element2'],
    ['.example-element3'],
    ['.example-element1', '.example-element2'],
]

setInterval(() => {
    currentIndex+=1
    currentIndex = currentIndex >= selectors.length ? 0 : currentIndex

    boxOverlay.clear()

    selectors[currentIndex].forEach(boxOverlay.add)
}, 3000)

TODO:

  • Highlight multiple elements
  • Handle moving elements
  • Rounded corner
  • Use Size Limit
  • Add events
  • Control mouse events
  • Tests
  • Animation
  • Capture mouse/touch events
  • Use clip-path
  • Centrating highlighted area
  • Optimize scroll
0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago