Skip to content

Commit 5003694

Browse files
committed
chore: card demo update
1 parent ed04c4f commit 5003694

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

demo-snippets/vue3/Card.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const props = defineProps({
1212

1313
<template>
1414
<GridLayout padding="4">
15-
<FlexboxLayout borderRadius="16" boxShadow="0 0 3 3 rgba(0,0,0,.12)" :style="{ 'background': props.data.bg }" class="flex-col p-3 justify-between rounded-lg h-full">
15+
<FlexboxLayout borderRadius="16" boxShadow="0 0 3 3 rgba(0,0,0,.12)" :backgroundColor="data.backgroundColor" class="flex-col p-3 justify-between rounded-lg h-full">
1616
<FlexboxLayout class="justify-between">
1717
<Label text="Credit" class="text-xl font-bold text-white"></Label>
1818
<!-- <Image :src="props.data.imgType" height="45"></Image> -->

demo-snippets/vue3/CardHome.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ function toggleItemHeight(item) {
9494
<Label ref="refTextHeader" text="Wallet" class="text-3xl font-bold text-black" horizontalAlignment="center"></Label>
9595
<Label ref="refShowBtn" text="close" style="font-size: 24;" height="45" width="45" rotate="90" class="m-icon-round bg-[#0666eb] rounded-full text-white text-center opacity-0 mr-2" horizontalAlignment="right" @tap="toggleStatus"></Label>
9696
</GridLayout>
97-
<CollectionView row="1" height="100%" :items="items" itemIdGenerator="index" :itemOverlap="`-${HEIGH_CARD - 60} 0 0 0`">
97+
<CollectionView row="1" height="100%" :items="items" itemIdGenerator="index">
9898
<template #default="{ item }">
99-
<GridLayout :height="item.expanded ? 2*HEIGH_CARD - 60 : HEIGH_CARD">
100-
<Card :height="HEIGH_CARD" :data="item" :sharedTransitionTag="`card_${item.id}`" @tap="toggleItemHeight(item)" verticalAlignment="top">
99+
<AbsoluteLayout :height="item.expanded ? HEIGH_CARD: 60">
100+
<Card :height="HEIGH_CARD" :data="item" :sharedTransitionTag="`card_${item.id}`" @tap="toggleItemHeight(item)" verticalAlignment="top" width="100%">
101101
</Card>
102-
</GridLayout>
102+
</AbsoluteLayout>
103103
</template>
104104
</CollectionView>
105105
<!-- <FlexboxLayout height="100%" marginTop="2" flexDirection="column">

demo-snippets/vue3/carddata.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,47 @@ export const dataCards: Card[] = [
88
id: 1,
99
name: 'Justine',
1010
number: '***** **** 0978',
11+
backgroundColor:'red',
1112
bg: 'linear-gradient(90deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 50%, rgba(245,144,2,1) 100%)',
1213
imgType: '~/assets/master-card.png'
1314
},
1415
{
1516
id: 2,
1617
name: 'Jenna',
1718
number: '***** **** 5782',
19+
backgroundColor:'green',
1820
bg: 'linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%)',
1921
imgType: '~/assets/visa-card.png'
2022
},
2123
{
2224
id: 3,
2325
name: 'Jessica',
2426
number: '***** **** 1093',
27+
backgroundColor:'blue',
2528
bg: 'linear-gradient(0deg, rgba(34,193,195,1) 0%, rgba(253,187,45,1) 100%)',
2629
imgType: '~/assets/master-card.png'
2730
},
2831
{
2932
id: 4,
3033
name: 'Justine',
3134
number: '***** **** 0978',
35+
backgroundColor:'rgba(0,58,180,1)',
3236
bg: 'linear-gradient(90deg, rgba(0,58,180,1) 0%, rgba(0,29,29,1) 50%, rgba(0,144,2,1) 100%)',
3337
imgType: '~/assets/master-card.png'
3438
},
3539
{
3640
id: 5,
3741
name: 'Jenna',
3842
number: '***** **** 5782',
43+
backgroundColor:'rgba(2,100,36,1)',
3944
bg: 'linear-gradient(90deg, rgba(2,100,36,1) 0%, rgba(9,109,121,1) 35%, rgba(0,212,255,1) 100%)',
4045
imgType: '~/assets/visa-card.png'
4146
},
4247
{
4348
id: 6,
4449
name: 'Jessica',
4550
number: '***** **** 1093',
51+
backgroundColor:'rgba(134,193,195,1)',
4652
bg: 'linear-gradient(0deg, rgba(134,193,195,1) 0%, rgba(253,187,145,1) 100%)',
4753
imgType: '~/assets/master-card.png'
4854
}

0 commit comments

Comments
 (0)