[feat] animations
This commit is contained in:
7
src/ts/gui/animation.ts
Normal file
7
src/ts/gui/animation.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "../storage/database";
|
||||
|
||||
export function updateAnimationSpeed(){
|
||||
const db = get(DataBase);
|
||||
document.documentElement.style.setProperty('--risu-animation-speed', db.animationSpeed + 's');
|
||||
}
|
||||
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