|
|
@@ -1,37 +1,41 @@
|
|
1
|
1
|
<template lang="pug">
|
|
2
|
|
-section.profile_card_list.w-full
|
|
3
|
|
- .profile_card_list_container.w-full
|
|
4
|
|
- .swipe(
|
|
5
|
|
- v-if="!isGrid"
|
|
6
|
|
- :config="config"
|
|
7
|
|
- :key="profile.pid"
|
|
8
|
|
- @throwout="swipped(profile)"
|
|
9
|
|
- v-for="(profile, i) in loadedProfiles"
|
|
10
|
|
- :style="{ 'z-index': 1000-i }"
|
|
|
2
|
+section.profile-card-list.w-full
|
|
|
3
|
+ .swipe(
|
|
|
4
|
+ v-if="!isGrid"
|
|
|
5
|
+ :config="config"
|
|
|
6
|
+ :key="profile.pid"
|
|
|
7
|
+ @throwout="swipped(profile)"
|
|
|
8
|
+ v-for="(profile, i) in loadedProfiles"
|
|
|
9
|
+ :style="{ 'z-index': 1000-i }"
|
|
|
10
|
+ )
|
|
|
11
|
+ .card.b-solid.bg-cover.randomize(
|
|
|
12
|
+ :style="{ 'background-image': `url(${profile.avatar})`, 'top': `${randomize(10)}px`, 'right': `${randomize(20)}px`, 'transform': `rotate(${randomize(7)}deg)` }"
|
|
11
|
13
|
)
|
|
12
|
|
- .card.b-solid.rounded.bg-cover.randomize(
|
|
13
|
|
- :style="{ 'background-image': `url(${profile.avatar})`, 'top': `${randomize(10)}px`, 'right': `${randomize(20)}px`, 'transform': `rotate(${randomize(7)}deg)` }"
|
|
|
14
|
+ .card--content.f-col.between
|
|
|
15
|
+ p(style="color: magenta;").f-grow profile: {{ profile.pid }}
|
|
|
16
|
+ .card--content--lower.ph-1.w-full.f-col.between
|
|
|
17
|
+ h4.w-full.pv-1 {{ profile.name }}
|
|
|
18
|
+ nav.swipe_icons.pv-1.w-full.f-grow.f-row
|
|
|
19
|
+ //- Accept
|
|
|
20
|
+ button(@click="accept") Accept
|
|
|
21
|
+ button(@click="view(profile.pid)") view
|
|
|
22
|
+ //- Pass
|
|
|
23
|
+ button(@click="pass") Pass
|
|
|
24
|
+
|
|
|
25
|
+ .match-layout(
|
|
|
26
|
+ v-else
|
|
|
27
|
+ :key="profile.pid"
|
|
|
28
|
+ v-for="(profile, i) in loadedProfiles"
|
|
|
29
|
+ ).f-row
|
|
|
30
|
+ .card.b-solid.bg-cover(
|
|
|
31
|
+ :style="{ 'background-image': `url(${profile.avatar})` }"
|
|
14
|
32
|
)
|
|
15
|
|
- .card__content
|
|
16
|
|
- h3.p-1.mv-0.b-solid.rounded {{ profile.pid }} {{ profile.name }}
|
|
17
|
|
- nav.swipe_icons.w-full.f-row.between
|
|
18
|
|
- //- Accept
|
|
19
|
|
- button.p-1(@click="accept") Accept
|
|
20
|
|
- //- Hold
|
|
21
|
|
- button.p-1(@click="view(profile.pid)") view
|
|
22
|
|
- //- Pass
|
|
23
|
|
- button.p-1(@click="pass") Pass
|
|
24
|
|
-
|
|
25
|
|
- .match-layout(
|
|
26
|
|
- v-else
|
|
27
|
|
- :key="profile.pid"
|
|
28
|
|
- v-for="(profile, i) in loadedProfiles"
|
|
29
|
|
- )
|
|
30
|
|
- .card.b-solid.rounded.bg-cover(
|
|
31
|
|
- :style="{ 'background-image': `url(${profile.avatar})` }"
|
|
32
|
|
- )
|
|
33
|
|
- .card__content
|
|
34
|
|
- button(@click="view(profile.pid)").p-1.mv-0.b-solid.rounded {{ profile.pid }} {{ profile.name }}
|
|
|
33
|
+ .card--content.f-col.between
|
|
|
34
|
+ p(style="color: magenta;").f-grow profile: {{ profile.pid }}
|
|
|
35
|
+ .card--content--lower.ph-1.w-full.f-col.between
|
|
|
36
|
+ h4.w-full.pv-1 {{ profile.name }}
|
|
|
37
|
+ nav.swipe_icons.pv-1.w-full.f-grow.f-row
|
|
|
38
|
+ button(@click="view(profile.pid)") view
|
|
35
|
39
|
</template>
|
|
36
|
40
|
|
|
37
|
41
|
<script setup>
|
|
|
@@ -44,8 +48,7 @@ import {
|
|
44
|
48
|
|
|
45
|
49
|
const router = useRouter()
|
|
46
|
50
|
const emit = defineEmits(['reload'])
|
|
47
|
|
-// TODO: Please review this conversion from script to script setup
|
|
48
|
|
-// converted from the props section
|
|
|
51
|
+
|
|
49
|
52
|
const props = defineProps({
|
|
50
|
53
|
profiles: {
|
|
51
|
54
|
type: [Object, Array],
|
|
|
@@ -66,6 +69,7 @@ const props = defineProps({
|
|
66
|
69
|
type: Boolean,
|
|
67
|
70
|
},
|
|
68
|
71
|
})
|
|
|
72
|
+
|
|
69
|
73
|
const swipped = profile => {
|
|
70
|
74
|
const index = loadedProfiles.findIndex(u => u.pid == profile.pid)
|
|
71
|
75
|
loadedProfiles.splice(index, 1)
|
|
|
@@ -99,10 +103,8 @@ const view = pid => {
|
|
99
|
103
|
router.push({ path: `/matches/${pid}` })
|
|
100
|
104
|
}
|
|
101
|
105
|
const pass = () => {
|
|
102
|
|
- // const charmander = await db.get(`/profile/{profile_id}/queue/{target_id}/delete?include_profile=true&reinsert=true`)
|
|
103
|
|
- const profileId = props.pid
|
|
104
|
106
|
const targetId = props.profiles[0].pid
|
|
105
|
|
- updateQueueByProfileId(profileId, targetId, true)
|
|
|
107
|
+ updateQueueByProfileId(props.pid, targetId, true)
|
|
106
|
108
|
emit('reload')
|
|
107
|
109
|
}
|
|
108
|
110
|
|
|
|
@@ -118,7 +120,7 @@ const loadedProfiles = [...props.profiles]
|
|
118
|
120
|
</script>
|
|
119
|
121
|
|
|
120
|
122
|
<style lang="postcss">
|
|
121
|
|
-.profile_card_list_container
|
|
|
123
|
+.profile-card-list
|
|
122
|
124
|
display: flex
|
|
123
|
125
|
justify-content: center
|
|
124
|
126
|
|
|
|
@@ -130,19 +132,19 @@ const loadedProfiles = [...props.profiles]
|
|
130
|
132
|
.card
|
|
131
|
133
|
position: relative
|
|
132
|
134
|
background-color: #fff
|
|
133
|
|
- width: 250px
|
|
134
|
|
- max-width: 85vw
|
|
135
|
|
- height: 50vh
|
|
|
135
|
+ height: 60vw
|
|
|
136
|
+ width: 40vw
|
|
|
137
|
+ max-height: 600px
|
|
|
138
|
+ max-width: 400px
|
|
136
|
139
|
background-position: center
|
|
137
|
|
- &_content
|
|
|
140
|
+ &--content
|
|
138
|
141
|
width: 100%
|
|
139
|
142
|
height: 100%
|
|
140
|
|
- h3
|
|
141
|
|
- position: absolute
|
|
142
|
|
- bottom: 0
|
|
|
143
|
+ font-size: 3vw
|
|
|
144
|
+ &--lower
|
|
|
145
|
+ background-color: goldenrod
|
|
|
146
|
+ nav > button
|
|
|
147
|
+ font-size: 2vw
|
|
|
148
|
+
|
|
143
|
149
|
|
|
144
|
|
-.swipe_icons
|
|
145
|
|
- position: fixed
|
|
146
|
|
- bottom: 5vh
|
|
147
|
|
- width: 250px
|
|
148
|
150
|
</style>
|