Преглед изворни кода

cards are rendered in a stack

tags/0.0.1
diaseu пре 4 година
родитељ
комит
70c0ccd11c

+ 2
- 3
backend/db/data-generator/index.js Прегледај датотеку

@@ -70,10 +70,9 @@ const generateUsers = () => {
70 70
 
71 71
         var mediaArray = []
72 72
         for (let i=0; i < 3; i++) {
73
-            
73
+            mediaArray.push(random.media())
74 74
         }
75
-
76
-        user.user_media = random.media()
75
+        user.user_media = mediaArray
77 76
     })
78 77
     console.log('COMPLETED: Generated Users...')
79 78
     return users

+ 2
- 2
backend/db/data-generator/random.js Прегледај датотеку

@@ -30,7 +30,7 @@ const randomName = (length = 4) => {
30 30
     }
31 31
     return str
32 32
 }
33
-const randomMedia = max => {
33
+const randomMedia = () => {
34 34
     const stockimg = [
35 35
         'https://i.imgur.com/a4wirDS.png',
36 36
         'https://i.imgur.com/F6GxGXG.jpeg',
@@ -40,7 +40,7 @@ const randomMedia = max => {
40 40
         'https://i.imgur.com/rOjRCgo.jpeg',
41 41
         'https://i.imgur.com/FwSdQww.jpeg',
42 42
         'https://i.imgur.com/JjZyzXL.jpeg',
43
-
43
+        'https://i.imgur.com/1DsSQ1s.jpeg',
44 44
     ]
45 45
     return randomValFrom(stockimg)
46 46
 }

+ 21
- 4
frontend/src/components/ProfileCardList.vue Прегледај датотеку

@@ -6,6 +6,7 @@ section.profile_card_list.w-full
6 6
             :key='profile.profile_id'
7 7
             @throwout='swipped(profile)'
8 8
             v-for='profile in profiles'
9
+            :style='{ "left": `vh` }'
9 10
         )
10 11
             .card.b-solid.rounded.p-0.bg-cover(
11 12
                 :style='{ "background-image": `url(${profile.user.user_media})` }'
@@ -17,8 +18,6 @@ section.profile_card_list.w-full
17 18
 </template>
18 19
 
19 20
 <script>
20
-
21
-
22 21
 export default {
23 22
     name: 'ProfileCardList',
24 23
     props: {
@@ -77,10 +76,29 @@ export default {
77 76
 }
78 77
 </script>
79 78
 <style lang="postcss">
80
-.profile_card_list_container
79
+@import '../sss/card.scss'
80
+
81
+.profile_card_list
81 82
     display: flex
82 83
     justify-content: center
83 84
     margin: 5vh 0 0 0
85
+    position: relative
86
+
87
+
88
+.profile_card_list_container
89
+    margin: 0 auto
90
+    width: 30%
91
+    position: relative
92
+    .swipe
93
+        list-style: none
94
+        background: #fff
95
+        box-shadow: 0 0 2px rgba(0,0,0,.2), 1px 1px 1px rgba(0,0,0,.2)
96
+        position: absolute
97
+        line-height: 300px
98
+        text-align: center
99
+        border: 1px solid #ECECEC
100
+        border-radius: 8px
101
+        
84 102
 
85 103
 .swipe
86 104
     
@@ -92,7 +110,6 @@ export default {
92 110
     max-width: 85vw
93 111
     height: 50vh
94 112
     background-position: center
95
-    border-radius: 3vh
96 113
     border: 1px solid #fff
97 114
     &_content
98 115
         width: 100%

+ 18
- 0
frontend/src/sss/card.scss Прегледај датотеку

@@ -0,0 +1,18 @@
1
+$n: 100;
2
+$cardbase: 2px;
3
+$cardtop: -1px;
4
+$index: 9999;
5
+
6
+@for $i from 0 through $n {
7
+  .swipe:nth-child(#{$i}) {
8
+    position: absolute;
9
+    left: calc($cardbase * $i);
10
+    top: calc($cardtop * $i);
11
+    z-index: calc($index - $i);
12
+  }
13
+}
14
+
15
+
16
+.swipe .card h3 {
17
+    color: blue!important;
18
+}

Loading…
Откажи
Сачувај