add isActiveTab method

This commit is contained in:
ThatOneCalculator 2023-02-17 11:54:33 -08:00
parent 6d2f2efcf6
commit 9ed34f3704
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
1 changed files with 5 additions and 0 deletions

View File

@ -132,6 +132,11 @@ function onTabClick(tab: Tab, ev: MouseEvent): void {
}
}
const isActiveTab = (index: number) => {
const activeTab = tabRefs[props.tab]?.value ?? 0;
return index === activeTab;
};
const calcBg = () => {
const rawBg = metadata?.bg || 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);