0.1.1 • Published 4 years ago

selection-highlighter v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

selection-highlighter

Work in progress

A simple selection-highlighter

API

const id = generateHighlightId();

const selection = Highlighter.serializeSelection({id, selection: window.getSelection()});

// const range = Highlighter.getRangeFromSerializedSelection(selection)

Highlighter.paintSerializedSelection(selection,
    (e) => {
        e.style.textDecoration = "underline";
        e.style.textDecorationColor = "orange";
    });

setTimeout(() => {
    Highlighter.unpaintSerializedSelection(selection);
}, 3000);
0.1.1

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago