Skip to content

Commit 32989b3

Browse files
committed
feat: animate heatmap scale
1 parent aeebaba commit 32989b3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

resources/js/components/video/VideoHeatmap.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ const heatMap = computed(() => {
9696
</script>
9797
<template>
9898
<svg
99-
:class="[getScreenSize() === 'default' ? 'opacity-65' : 'opacity-0 peer-hover:opacity-65', 'pointer-events-none h-6 w-full transition-opacity duration-(--duration-input)']"
99+
:class="[
100+
getScreenSize() === 'default' ? 'scale-y-100 opacity-65' : 'opacity-0 peer-hover:scale-y-100 peer-hover:opacity-65',
101+
'pointer-events-none h-10 w-full origin-bottom scale-y-0 duration-(--duration-input) ease-in-out',
102+
]"
100103
preserveAspectRatio="none"
101104
viewBox="0 0 1000 100"
102105
v-show="playbackHeatmap"
@@ -109,3 +112,8 @@ const heatMap = computed(() => {
109112
<rect class="ytp-heat-map-hover" clip-path="url(#4)" fill="white" fill-opacity="0.7" height="100%" width="100%" x="0" y="0"></rect>
110113
</svg>
111114
</template>
115+
<style lang="css" scoped>
116+
svg {
117+
transition-property: opacity, scale;
118+
}
119+
</style>

0 commit comments

Comments
 (0)