1.0.4 • Published 3 months ago

@ryinner/ts-enjoy-hint v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

ts-enjoy-hint

Typescript enjoy hints.

That a simple library based on canvas drawing.

Settings

// All settings.
setSettings({
    nextBtn: 'Next',
    nextBtnClass: 'ts-enjoy-hint-button--next',
    previousBtn: 'Previous',
    previousBtnClass: 'ts-enjoy-hint-button--previous',
    closeBtn: 'X',
    closeBtnClass: 'ts-enjoy-hint-button--close',
    scrollBehavior: 'smooth',
    zIndex: 10
});

Create

const tsEnjoyHintInstance = new TsEnjoyHint();

Hint list

const target = document.querySelector('#target');

tsEnjoyHintInstance.apply({ target });
//or
tsEnjoyHintInstance.apply({ target: '#target' });
//multiply
tsEnjoyHintInstance.apply([{ target: '#target' }, { target: '#second-target' }]);

Hint item setting

settingdescriptionvalue
targettarget for hintElement | selector
shapeselection shapecircle | rectangle
onEnterbefore enter hint(element) => void
onLeavebefore leave hint(element) => void
nextEventtarget event for show next hintstring

Style

import '@ryinner/ts-enjoy-hint/style.css'
1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago