[feat] animations

This commit is contained in:
kwaroran
2023-07-20 22:29:43 +09:00
parent 244f06e2c4
commit 423bad2525
12 changed files with 350 additions and 201 deletions

7
src/ts/gui/animation.ts Normal file
View 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
View 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()
}
};
}