UNPKG

visbug-lib

Version:

<p align="center"> <img src="./assets/visbug.png" width="300" height="300" alt="visbug"> <br> <a href="https://www.npmjs.org/package/visbug"><img src="https://img.shields.io/npm/v/visbug.svg?style=flat" alt="npm latest version number"></a> <a href

24 lines (18 loc) 552 B
import { Handles } from './handles.element' import { HandleStyles, HoverStyles } from '../styles.store' export class Hover extends Handles { constructor() { super() this.styles = [HandleStyles, HoverStyles] } render({ width, height, top, left }) { this.style.setProperty('--top', `${top + window.scrollY}px`) this.style.setProperty('--left', `${left + window.scrollX}px`) return ` <svg width="${width}" height="${height}"> <rect></rect> </svg> ` } } customElements.define('visbug-hover', Hover)