UPD: TabSelect transition
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div
|
<div
|
||||||
:style="backgroundStyle"
|
:style="backgroundStyle"
|
||||||
|
:class="{'hidden': !showBackground}"
|
||||||
class="absolute bg-zinc-300 outline outline-zinc-100 rounded-xl transition-all duration-75 ease-out" />
|
class="absolute bg-zinc-300 outline outline-zinc-100 rounded-xl transition-all duration-75 ease-out" />
|
||||||
<div class="flex font-heading px-4 py-2 gap-2 relative">
|
<div class="flex font-heading px-4 py-2 gap-2 relative">
|
||||||
<TabSelectButton
|
<TabSelectButton
|
||||||
@@ -29,6 +30,8 @@ const model = defineModel({
|
|||||||
|
|
||||||
const buttons = ref({})
|
const buttons = ref({})
|
||||||
|
|
||||||
|
const showBackground = ref(false)
|
||||||
|
|
||||||
const backgroundStyle = ref({
|
const backgroundStyle = ref({
|
||||||
top: '0',
|
top: '0',
|
||||||
left: '0',
|
left: '0',
|
||||||
@@ -48,7 +51,10 @@ const updateBackgroundStyle = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch([model, buttons], updateBackgroundStyle)
|
watch([model, buttons], () => {
|
||||||
|
updateBackgroundStyle()
|
||||||
|
showBackground.value = true
|
||||||
|
})
|
||||||
|
|
||||||
let observer = null
|
let observer = null
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
class="flex-1 flex flex-col items-center rounded-xl p-1 gap-2 transition-colors"
|
class="flex-1 flex flex-col items-center rounded-xl p-1 gap-2 transition-all"
|
||||||
:class="{'text-black bg-zinc-300 hover:bg-zinc-200': selected,
|
:class="{'text-black bg-zinc-300 outline outline-zinc-100 hover:bg-zinc-200': selected,
|
||||||
'hover:bg-zinc-800 text-muted-foreground' : !selected}"
|
'hover:bg-zinc-800 text-muted-foreground' : !selected}"
|
||||||
@click="$emit('select'); $refs.title.scramble()">
|
@click="$emit('select'); $refs.title.scramble()">
|
||||||
<slot v-if="$slots['replace']" name="replace" />
|
<slot v-if="$slots['replace']" name="replace" />
|
||||||
|
|||||||
Reference in New Issue
Block a user