add: collapsing and deletion animation
Added collapsable cards and animation for deletion and card footer
This commit is contained in:
parent
c99c243dfc
commit
7c46be6227
6 changed files with 121 additions and 29 deletions
|
@ -23,14 +23,22 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const initialId = crypto.randomUUID()
|
||||
const randomUUID = () => {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, char => {
|
||||
const random = Math.random() * 16 | 0
|
||||
const value = char === 'x' ? random : (random & 0x3 | 0x8)
|
||||
return value.toString(16)
|
||||
})
|
||||
}
|
||||
|
||||
const initialId = randomUUID()
|
||||
|
||||
const cards = useState('cards', () => [
|
||||
initialId,
|
||||
])
|
||||
|
||||
const addCard = () => {
|
||||
cards.value.push(crypto.randomUUID())
|
||||
cards.value.push(randomUUID())
|
||||
}
|
||||
|
||||
const removeCard = (uuid : string) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue