@@ -22,7 +22,22 @@ const boards = ref<Partial<Board>[]>([
22
22
{
23
23
id: " 3" ,
24
24
title: " My Third Board" ,
25
- order: " []" ,
25
+ order: " https://picsum.photos/480/270?watermelon=3" ,
26
+ },
27
+ {
28
+ id: " 4" ,
29
+ title: " And another one" ,
30
+ order: " https://picsum.photos/480/270?watermelon=4" ,
31
+ },
32
+ {
33
+ id: " 5" ,
34
+ title: " Cute boardie" ,
35
+ order: " https://picsum.photos/480/270?watermelon=5" ,
36
+ },
37
+ {
38
+ id: " 6" ,
39
+ title: " Serious corpo board" ,
40
+ order: " https://picsum.photos/480/270?watermelon=6" ,
26
41
},
27
42
]);
28
43
@@ -31,12 +46,40 @@ const alerts = useAlerts();
31
46
function createBoard() {
32
47
alerts .success (" Board created!" );
33
48
}
49
+
50
+ const getCoolGradient = (index ) => {
51
+ let finalGradientString = " " ;
52
+ switch (index ) {
53
+ case 1 :
54
+ finalGradientString = " from-orange-400 to-pink-500" ;
55
+ break ;
56
+ case 2 :
57
+ finalGradientString = " from-green-400 to-blue-400" ;
58
+ break ;
59
+ case 3 :
60
+ finalGradientString = " from-purple-400 to-blue-400" ;
61
+ break ;
62
+ default :
63
+ finalGradientString = " from-orange-400 to-yellow-500" ;
64
+ }
65
+ return finalGradientString ;
66
+ };
34
67
</script >
35
68
36
69
<template >
37
70
<h1 class =" mb-5 text-3xl" >Boards</h1 >
38
- <div class =" flex" >
39
- <BoardCard v-for =" board in boards" :key =" board.id" :board =" board" />
71
+ <div class =" flex flex-wrap gap-2" >
72
+ <div
73
+ class =" border rounded-md bg-gradient-to-tr"
74
+ v-for =" (board, index) in boards"
75
+ :key =" board.id"
76
+ :class =" getCoolGradient(index)"
77
+ >
78
+ <BoardCard
79
+ :board =" board"
80
+ class =" transition duration-100 ease-in border rounded-md hover:-rotate-3"
81
+ />
82
+ </div >
40
83
<button class =" text-gray-500" @click =" createBoard()" >
41
84
<span >New Board +</span >
42
85
</button >
0 commit comments