[feat] animations
This commit is contained in:
15
src/ts/gui/tooltip.ts
Normal file
15
src/ts/gui/tooltip.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import tippy from 'tippy.js'
|
||||
import 'tippy.js/dist/tippy.css';
|
||||
|
||||
export function tooltip(node:HTMLElement, tip:string) {
|
||||
const instance = tippy(node, {
|
||||
content: tip,
|
||||
animation: 'fade',
|
||||
arrow: true,
|
||||
})
|
||||
return {
|
||||
destroy() {
|
||||
instance.destroy()
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user