mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-30 18:43:17 +00:00
fix: some perf and other improvements
This commit is contained in:
parent
a623887a11
commit
95131c40ab
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<MenuDesktop :collapsed="collapsed" :toggleCollapsed="toggleCollapsed" v-if="!isMobile" />
|
||||
<MenuMobile :collapsed="collapsed" :toggleCollapsed="toggleCollapsed" v-else />
|
||||
<MenuDesktop :collapsed="collapsed" :toggleCollapsed="toggleCollapsedDebounced" v-if="!isMobile" />
|
||||
<MenuMobile :collapsed="collapsed" :toggleCollapsed="toggleCollapsedDebounced" v-else />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -16,11 +16,25 @@ export default {
|
||||
},
|
||||
props: {
|
||||
collapsed: Boolean,
|
||||
toggleCollapse: Function,
|
||||
toggleCollapsed: Function,
|
||||
},
|
||||
data() {
|
||||
return { toggleCollapsedDisabled: false };
|
||||
},
|
||||
setup() {
|
||||
const isMobile = useIsMobile();
|
||||
return { isMobile };
|
||||
},
|
||||
methods: {
|
||||
toggleCollapsedDebounced() {
|
||||
if (!this.toggleCollapsedDisabled) {
|
||||
this.toggleCollapsed();
|
||||
this.toggleCollapsedDisabled = true;
|
||||
setTimeout(() => {
|
||||
this.toggleCollapsedDisabled = false;
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<div
|
||||
class="uk-flex uk-flex-middle"
|
||||
style="gap: 16px; transition: transform 300ms, gap 300ms;"
|
||||
:style="collapseText ? 'transform: scale(0); gap: 0;' : 'transition-delay: 170ms'"
|
||||
:style="collapseText ? 'transform: scale3d(0, 0, 0); gap: 0;' : 'transition-delay: 170ms'"
|
||||
v-if="!hideText"
|
||||
>
|
||||
<img src="/img/pipedPlay.svg" :class="{ 'piped-play': !hideText }" />
|
||||
@ -181,7 +181,7 @@ export default {
|
||||
}
|
||||
|
||||
.sidebar-link span {
|
||||
transition: font-size 400ms, padding 400ms;
|
||||
transition: font-size 400ms;
|
||||
}
|
||||
.collapse-text .sidebar-link span {
|
||||
font-size: 0;
|
||||
|
@ -33,7 +33,7 @@
|
||||
v-if="!isMobile"
|
||||
class="uk-flex uk-flex-middle"
|
||||
style="gap: 16px; transition: transform 400ms; transform-origin: left;"
|
||||
:style="!menuCollapsed ? 'transform: scale(0);' : {}"
|
||||
:style="!menuCollapsed ? 'transform: scale3d(0, 0, 0);' : {}"
|
||||
>
|
||||
<img src="/img/pipedPlay.svg" style="height: 36px;" />
|
||||
<img src="/img/piped.svg" />
|
||||
|
Loading…
Reference in New Issue
Block a user