Bläddra i källkod

:recycle: moving things around again | using some helper classes | deleting old views

tags/0.0.1
j 4 år sedan
förälder
incheckning
6010545df2

+ 0
- 2
frontend/src/App.vue Visa fil

@@ -17,11 +17,9 @@ export default {
17 17
 @import './sss/theme.sss'
18 18
 
19 19
 #app
20
-    width: 100%
21 20
     text-align: center
22 21
     color: $primary
23 22
     font-family: $sans
24
-    padding: $ms-0
25 23
     background-color: $secondary
26 24
     overflow-x: hidden
27 25
 </style>

+ 23
- 0
frontend/src/components/MainNav.vue Visa fil

@@ -0,0 +1,23 @@
1
+<template lang="pug">
2
+nav#main-header.w-full.f-row.around
3
+    router-link.header__icon.mobile--only(to='/matches') matches
4
+    router-link.header__icon(to='/') home
5
+    router-link.header__icon.mobile--only(to='/profile') profile
6
+</template>
7
+
8
+<script>
9
+export default {
10
+    name: 'MainNav',
11
+}
12
+</script>
13
+
14
+<style lang="postcss">
15
+#main-header
16
+  border-bottom: 1px solid #f5f0f0c2
17
+  padding: 2px
18
+
19
+@media only screen and (min-width: 768px)
20
+  .mobile--only
21
+    /* display: none */
22
+    display: block
23
+</style>

+ 0
- 131
frontend/src/components/ProfileCard.vue Visa fil

@@ -1,131 +0,0 @@
1
-<template lang="pug">
2
-.profile__card
3
-  .profiler__card__container
4
-    .swipe(v-for="user in users" :key="user.id" @throwout="swipped(user)" :config="config")
5
-      .card(:style="{ 'background-image': `url(${user.avatar})` }")
6
-        .card__content
7
-          h3 {{ user.name }}
8
-    .swipe__icons // Icons
9
-</template>
10
-
11
-<script>
12
-export default {
13
-    name: 'profile-cards',
14
-    props: {
15
-        users: {
16
-            type: [Object, Array],
17
-            default: function () {
18
-                return [
19
-                    {
20
-                        uid: '1',
21
-                        name: 'Fullname',
22
-                        avatar: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/newborn-baby-boy-sleeping-peacefully-wearing-knit-royalty-free-image-1589459736.jpg?crop=0.669xw:1.00xh;0.228xw,0&resize=640:*',
23
-                        metadata: { age: '21', rawMetadata: 'Some Text Here!' },
24
-                    },
25
-                ]
26
-            },
27
-        },
28
-        uid: {
29
-            type: String,
30
-        },
31
-    },
32
-    data() {
33
-        return {
34
-            config: {
35
-                // allowedDirections: [VueSwing.Direction.LEFT, VueSwing.Direction.RIGHT],
36
-                minThrowOutDistance: 250,
37
-                maxThrowOutDistance: 300,
38
-            },
39
-            favorites: [],
40
-            requests: [],
41
-        }
42
-    },
43
-    created() {
44
-        this.getUser()
45
-    },
46
-    components: {},
47
-    methods: {
48
-        logOut() {},
49
-        reject() {
50
-            this.swipped(this.currentCard)
51
-        },
52
-        swipped(user) {
53
-            const index = this.users.findIndex(u => u.uid == user.uid)
54
-            this.users.splice(index, 1)
55
-            user.id = Date.now() + (Math.random() * 100000).toFixed()
56
-            this.users.unshift({ ...user })
57
-        },
58
-        getUser() {
59
-            return
60
-        },
61
-        onRequest() {
62
-            const data = { ...this.currentCard }
63
-            return
64
-        },
65
-    },
66
-    computed: {
67
-        currentCard() {
68
-            return this.users[this.users.length - 1]
69
-        },
70
-    },
71
-}
72
-</script>
73
-<style lang="postcss">
74
-.profile__card__container
75
-    display: flex
76
-    justify-content: center
77
-    margin-top: 10vh
78
-
79
-.swipe
80
-    position: absolute
81
-
82
-.card 
83
-    position: relative
84
-    background-color: #fff
85
-    width: 250px
86
-    padding: 20px
87
-    max-width: 85vw
88
-    height: 50vh
89
-    border-radius: 9px
90
-    background-size: cover
91
-    background-position: center
92
-    &__content
93
-        width: 100%
94
-        height: 100%
95
-    h3
96
-        position: absolute
97
-        bottom: 0
98
-        margin: 10px
99
-        color: #fff
100
-        background: linear-gradient(
101
-            109deg,
102
-            rgba(0, 0, 0, 0.5) 0%,
103
-            rgba(0, 0, 0, 0) 100%
104
-        )
105
-        border-radius: 9px
106
-        padding: 5px
107
-
108
-.swipe__icon
109
-    &s
110
-        position: fixed
111
-        bottom: 5vh
112
-        display: flex
113
-        width: 250px
114
-        justify-content: space-evenly
115
-        .material-design-icon__svg
116
-            background-color: white
117
-            box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.2) !important
118
-            border-radius: 30px
119
-            padding: 10px
120
-        &__container
121
-            display: flex
122
-            justify-content: center
123
-    &__close, &__star, &__heart
124
-        &:hover
125
-            transform: scale(1.06)
126
-            transition: all 0.2s ease-in-out
127
-
128
-@media only screen and (min-width: 768px)
129
-    .swipe__icon__power
130
-        display: none
131
-</style>

+ 107
- 0
frontend/src/components/ProfileCardList.vue Visa fil

@@ -0,0 +1,107 @@
1
+<template lang="pug">
2
+section.profile_card_list.w-full
3
+    .profile_card_list_container.w-full
4
+        .swipe(
5
+            :config='config'
6
+            :key='user.id'
7
+            @throwout='swipped(user)'
8
+            v-for='user in users'
9
+        )
10
+            .card.b-solid.rounded.p-0.bg-cover(
11
+                :style='{ "background-image": `url(${user.avatar})` }'
12
+            )
13
+                .card__content
14
+                    h3.p-1.mv-0.b-solid.rounded {{ user.name }}
15
+
16
+        nav.swipe_icons.w-full.f-row.between
17
+            h2 A
18
+            h2 H
19
+            h2 P
20
+</template>
21
+
22
+<script>
23
+export default {
24
+    name: 'ProfileCardList',
25
+    props: {
26
+        users: {
27
+            type: [Object, Array],
28
+            default: () => [
29
+                {
30
+                    uid: '1',
31
+                    name: 'Fullname',
32
+                    avatar: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/newborn-baby-boy-sleeping-peacefully-wearing-knit-royalty-free-image-1589459736.jpg?crop=0.669xw:1.00xh;0.228xw,0&resize=640:*',
33
+                    metadata: { age: '21', rawMetadata: 'Some Text Here!' },
34
+                },
35
+            ],
36
+        },
37
+        uid: {
38
+            type: String,
39
+            default: '9999',
40
+        },
41
+    },
42
+    data: () => ({
43
+        config: {
44
+            // allowedDirections: [VueSwing.Direction.LEFT, VueSwing.Direction.RIGHT],
45
+            minThrowOutDistance: 250,
46
+            maxThrowOutDistance: 300,
47
+        },
48
+        favorites: [],
49
+        requests: [],
50
+    }),
51
+    computed: {
52
+        currentCard() {
53
+            return this.users[this.users.length - 1]
54
+        },
55
+    },
56
+    created() {
57
+        this.getUser()
58
+    },
59
+    methods: {
60
+        logOut() {},
61
+        reject() {
62
+            this.swipped(this.currentCard)
63
+        },
64
+        swipped(user) {
65
+            const index = this.users.findIndex(u => u.uid == user.uid)
66
+            this.users.splice(index, 1)
67
+            user.id = Date.now() + (Math.random() * 100000).toFixed()
68
+            this.users.unshift({ ...user })
69
+        },
70
+        getUser() {
71
+            return
72
+        },
73
+        onRequest() {
74
+            const data = { ...this.currentCard }
75
+            return
76
+        },
77
+    },
78
+}
79
+</script>
80
+<style lang="postcss">
81
+.profile_card_list_container
82
+    display: flex
83
+    justify-content: center
84
+    margin: 5vh 0 0 0
85
+
86
+.swipe
87
+    position: absolute
88
+
89
+.card
90
+    position: relative
91
+    background-color: #fff
92
+    width: 250px
93
+    max-width: 85vw
94
+    height: 50vh
95
+    background-position: center
96
+    &_content
97
+        width: 100%
98
+        height: 100%
99
+    h3
100
+        position: absolute
101
+        bottom: 0
102
+
103
+.swipe_icons
104
+    position: fixed
105
+    bottom: 5vh
106
+    width: 250px
107
+</style>

+ 43
- 0
frontend/src/components/Sidebar.vue Visa fil

@@ -0,0 +1,43 @@
1
+<template lang="pug">
2
+aside.sidebar__messages.p-1
3
+    p messages
4
+    input
5
+    label search
6
+
7
+    router-link(
8
+        :class='[uid == user.uid ? "active" : "", "sidebar__message"]'
9
+        :key='user.uid'
10
+        :to='`/chats/${user.uid}`'
11
+        v-for='user in users'
12
+    )
13
+        h4.message__title.mv-0 {{ title }}
14
+        .row.f-row.mv-0
15
+            .message__left.mr-0
16
+                p avatar
17
+                p O
18
+            .message__right.t-left.f-grow
19
+                h4.message__name {{ user.name }}
20
+                p.message__content {{ user.metadata.rawMetadata || "Hello!" }}
21
+        hr
22
+</template>
23
+
24
+<script>
25
+export default {
26
+    data: () => ({
27
+        title: 'i am a title',
28
+        uid: 111,
29
+        users: [
30
+            {
31
+                name: 'bob mcrob',
32
+                uid: 111,
33
+                metadata: { rawMetadata: 'howdy howdy howdy' },
34
+            },
35
+            {
36
+                name: 'rob bebob',
37
+                uid: 112,
38
+                metadata: { rawMetadata: 'this is the last message' },
39
+            },
40
+        ],
41
+    }),
42
+}
43
+</script>

+ 0
- 36
frontend/src/shared/MainHeader.vue Visa fil

@@ -1,36 +0,0 @@
1
-<template>
2
-    <div id="main-header">
3
-        <router-link class="header__icon mobile--only" to="/matches">
4
-            <p>matches</p>
5
-        </router-link>
6
-
7
-        <router-link class="header__icon" to="/">
8
-            <p>home</p>
9
-        </router-link>
10
-
11
-        <router-link class="header__icon mobile--only" to="/profile">
12
-            <p>profile</p>
13
-        </router-link>
14
-    </div>
15
-</template>
16
-
17
-<script>
18
-export default {
19
-    name: 'main-header',
20
-}
21
-</script>
22
-
23
-<style lang="postcss">
24
-#main-header
25
-  display: flex
26
-  align-items: center
27
-  justify-content: space-around
28
-  z-index: 100
29
-  border-bottom: 1px solid #f5f0f0c2
30
-  padding: 2px
31
-
32
-@media only screen and (min-width: 768px)
33
-  .mobile--only
34
-    /* display: none */
35
-    display: block
36
-</style>

+ 0
- 43
frontend/src/shared/Sidebar.vue Visa fil

@@ -1,43 +0,0 @@
1
-<template lang="pug">
2
-aside.sidebar__messages
3
-    h1 messages
4
-    input
5
-    label search 
6
-    router-link(
7
-        :class='[uid == user.uid ? "active" : "", "sidebar__message"]'
8
-        :key='user.uid'
9
-        :to='`/chats/${user.uid}`'
10
-        v-for='user in users'
11
-    )
12
-        h4.message__title {{ title }}
13
-        .message__left
14
-            p avatar picture
15
-            p status doot
16
-        .message__right
17
-            h4.message__name {{ user.name }}
18
-            p.message__content {{ user.metadata.rawMetadata || "Hello!" }}
19
-        hr
20
-</template>
21
-
22
-<script>
23
-export default {
24
-    data() {
25
-        return {
26
-            title: 'i am a title',
27
-            uid: 111,
28
-            users: [
29
-                {
30
-                    name: 'bob mcrob',
31
-                    uid: 111,
32
-                    metadata: { rawMetadata: 'howdy howdy howdy' },
33
-                },
34
-                {
35
-                    name: 'rob bebob',
36
-                    uid: 112,
37
-                    metadata: { rawMetadata: 'this is the last message' },
38
-                },
39
-            ],
40
-        }
41
-    },
42
-}
43
-</script>

+ 4
- 0
frontend/src/sss/partials/_helpers.sss Visa fil

@@ -39,8 +39,12 @@
39 39
             flex-wrap: wrap
40 40
     &-row
41 41
         flex-direction: row
42
+        &.reverse
43
+            flex-direction: row-reverse
42 44
     &-col
43 45
         flex-direction: column
46
+        &.reverse
47
+            flex-direction: column-reverse
44 48
     &-grow
45 49
         flex-grow: 1
46 50
 

+ 0
- 5
frontend/src/views/Archive/About.vue Visa fil

@@ -1,5 +0,0 @@
1
-<template>
2
-    <div class="about">
3
-        <h1>This is an about page</h1>
4
-    </div>
5
-</template>

+ 0
- 5
frontend/src/views/Archive/AcctSettings.vue Visa fil

@@ -1,5 +0,0 @@
1
-<template>
2
-    <div class="AcctSettings">
3
-        <h1>Account Settings</h1>
4
-    </div>
5
-</template>

+ 0
- 106
frontend/src/views/Archive/Chat.vue Visa fil

@@ -1,106 +0,0 @@
1
-<template>
2
-    <div class="chat">
3
-        <div class="chat--nav">
4
-            <span>&lt; Back</span>
5
-            <h3>Company Name</h3>
6
-            <span>...</span>
7
-        </div>
8
-
9
-        <div class="chat--history">
10
-            <span>Hey there... </span>
11
-        </div>
12
-
13
-        <div class="message">
14
-            <!-- <h2>Messages</h2> -->
15
-            <span>Type messages here...</span>
16
-        </div>
17
-    </div>
18
-</template>
19
-
20
-<script>
21
-import icon from '@/components/icon'
22
-import card from '@/components/card'
23
-import { defineComponent } from 'vue'
24
-import { NButton } from 'naive-ui'
25
-
26
-export default defineComponent({
27
-    components: {
28
-        NButton,
29
-        card,
30
-        icon,
31
-    },
32
-})
33
-</script>
34
-
35
-<style lang="postcss">
36
-h3
37
-  margin: 0
38
-
39
-.chat
40
-  width: 100%
41
-  display: flex
42
-  flex-flow: column
43
-  /* padding: 20px */
44
-  text-align: left
45
-  height: 90%
46
-
47
-
48
-.chat--nav
49
-  display: flex
50
-  flex-direction: row
51
-  justify-content: space-between
52
-  border-bottom: 1px solid rgba(0,0,0,0.5)
53
-  width: 100%
54
-  & > *
55
-    padding: 10px
56
-
57
-
58
-
59
-.chat--history
60
-  padding: 20px
61
-  flex: 1
62
-  overflow: auto
63
-
64
-
65
-.row
66
-  display: flex
67
-  flex-direction: row
68
-  /* width: 100vw */
69
-  overflow:scroll
70
-
71
-
72
-.message
73
-  position: relative
74
-  bottom: 0
75
-  min-height: 60px
76
-  width: 100%
77
-  display: block
78
-  text-align: left
79
-  /* margin-bottom: 10px */
80
-  background-color: transparent
81
-  border: 1px solid #ccc
82
-  padding: 12px
83
-
84
-
85
-.n-card__content
86
-  padding-top: 0
87
-
88
-
89
-.matched
90
-  display: flex
91
-  flex-direction: row
92
-  background-color: rgba(0,0,0,0.0)
93
-  margin-bottom: 12px
94
-  border-bottom: 1px solid rgba(150,150,150,0.25)
95
-
96
-
97
-.icon
98
-  /* display: inline-block */
99
-  padding: 8px 12px
100
-  margin: -1px
101
-  /* flex-grow: 0 */
102
-  border-bottom: 1px solid rgba(250,250,250,0.95)
103
-
104
-.active
105
-  /* background-color: rgba(250,50,50,0.3) */
106
-</style>

+ 0
- 5
frontend/src/views/Archive/EditProfile.vue Visa fil

@@ -1,5 +0,0 @@
1
-<template lang="pug">
2
-.EditProfile
3
-    h1 Edit Profile
4
-    p Edit Photos
5
-</template>

+ 0
- 4
frontend/src/views/Archive/EditSurvey.vue Visa fil

@@ -1,4 +0,0 @@
1
-<template lang="pug">
2
-.EditSurvey
3
-  h1 Edit Survey
4
-</template>

+ 0
- 7
frontend/src/views/Archive/SearchSettings.vue Visa fil

@@ -1,7 +0,0 @@
1
-<template lang="pug">
2
-.SearchSettings
3
-  h1 Search Settings
4
-  p Max-Distance | Remote
5
-  p Part-time | Full-time
6
-  p Current Location
7
-</template>

+ 0
- 88
frontend/src/views/Archive/account.vue Visa fil

@@ -1,88 +0,0 @@
1
-<template lang="pug">
2
-.account
3
-  h1 Account
4
-  .user
5
-      .userprofile
6
-        span User Name
7
-    
8
-  .accountmenu
9
-    router-link(to="/editprofile")
10
-      .icon
11
-        p - Edit Profile
12
-    router-link(to="/editsurvey")
13
-      .icon
14
-        p + Edit Survey
15
-    
16
-  .settings
17
-    router-link(to="/searchsettings")
18
-      .icon
19
-        p - Search Settings
20
-    router-link(to="/acctsettings")
21
-      .icon
22
-        p - Account Settings
23
-</template>
24
-
25
-<style lang="postcss">
26
-.account
27
-  display: flex
28
-  flex-direction: column
29
-  justify-content: space-between
30
-  width: 100%
31
-  padding: 20px
32
-  text-align: left
33
-
34
-
35
-a
36
-  text-decoration: none
37
-
38
-
39
-.user
40
-  text-align: center
41
-  display: flex
42
-  flex-direction: column
43
-  align-items: center
44
-
45
-
46
-.userprofile
47
-  border-radius: 50%
48
-  width: 120px
49
-  height: 120px
50
-  background-image: url(https://images-ssl.gotinder.com/5b308e3bf4807f9329e93a38/640x800_75_e70182ed-938b-418e-8598-d844b4090ced.webp)
51
-  background-position: 50% 0
52
-  background-size: auto 125%
53
-  margin: 12px auto
54
-
55
-
56
-.icon
57
-  display: flex
58
-  justify-content: center
59
-  align-items: center
60
-  border-radius: 50%
61
-  width: 48px
62
-  height: 48px
63
-  background-color: rgba(20,20,20,0.3)
64
-  background-position: 50% 0
65
-  background-size: auto 125%
66
-  margin: 12px auto
67
-
68
-
69
-span
70
-  text-transform: uppercase
71
-  font-weight: 700
72
-  font-size: 1.2rem
73
-
74
-
75
-.accountmenu
76
-  display: flex
77
-  flex-direction: row
78
-  justify-content: space-between
79
-  margin-bottom: 5vh
80
-  padding: 0 5vh
81
-
82
-
83
-.settings
84
-  display: flex
85
-  flex-direction: row
86
-  justify-content: space-between
87
-  padding: 0 5vh
88
-</style>

+ 7
- 11
frontend/src/views/Chats.vue Visa fil

@@ -65,7 +65,7 @@ article#chats
65 65
 
66 66
 <script>
67 67
 export default {
68
-    name: 'chats',
68
+    name: 'ChatsView',
69 69
     props: {
70 70
         uid: {
71 71
             type: String,
@@ -79,15 +79,16 @@ export default {
79 79
             user: {},
80 80
         }
81 81
     },
82
-    components: {},
82
+    watch: {
83
+        messages() {
84
+            this.scrollToEnd()
85
+        },
86
+    },
83 87
     created() {
84 88
         this.getMessages()
85 89
         this.getUser()
86 90
         this.listenForMessage()
87 91
     },
88
-    destroyed() {
89
-        CometChat.removeMessageListener(this.uid)
90
-    },
91 92
     updated() {
92 93
         this.scrollToEnd()
93 94
     },
@@ -127,11 +128,6 @@ export default {
127 128
             return hrs + ':' + mins + timeType
128 129
         },
129 130
     },
130
-    watch: {
131
-        messages() {
132
-            this.scrollToEnd()
133
-        },
134
-    },
135 131
 }
136 132
 </script>
137 133
 
@@ -243,7 +239,7 @@ export default {
243 239
       border: none
244 240
       border-radius: 3px
245 241
       font-size: 1em
246
-      
242
+
247 243
 .msger-send-btn
248 244
   margin-left: 10px
249 245
   background: rgb(233, 12, 119)

+ 1
- 1
frontend/src/views/Profile.vue Visa fil

@@ -43,7 +43,7 @@
43 43
 
44 44
 <script>
45 45
 export default {
46
-    name: 'profile-update',
46
+    name: 'ProfileUpdate',
47 47
     data() {
48 48
         return {
49 49
             requesting: false,

+ 21
- 27
frontend/src/views/home.vue Visa fil

@@ -1,25 +1,25 @@
1 1
 <template lang="pug">
2
-article#home
3
-    .content-wrapper
4
-        .content
5
-            main-header
6
-            profile-cards(:uid='uid' :users='swipables')
2
+article#home.w-full.f-row.reverse
3
+    .content-wrapper.w-full
4
+        header
5
+            main-nav
6
+
7
+        profile-card-list(:uid='uid' :users='swipables')
7 8
     sidebar
8 9
 </template>
9 10
 
10 11
 <script>
11
-import mainHeader from '../shared/MainHeader.vue'
12
-import sidebar from '../shared/Sidebar.vue'
13
-import profileCards from '../components/ProfileCard.vue'
12
+import mainNav from '../components/MainNav.vue'
13
+import sidebar from '../components/Sidebar.vue'
14
+import profileCardList from '../components/ProfileCardList.vue'
15
+
14 16
 export default {
15
-    name: 'home',
16
-    components: { mainHeader, profileCards, sidebar },
17
-    data() {
18
-        return {
19
-            swipables: [],
20
-            uid: null,
21
-        }
22
-    },
17
+    name: 'HomeView',
18
+    components: { mainNav, profileCardList, sidebar },
19
+    data: () => ({
20
+        swipables: [],
21
+        uid: null,
22
+    }),
23 23
     created() {
24 24
         // this.uid = auth.currentUser?.uid || "99999";
25 25
         this.uid = '99999'
@@ -29,24 +29,18 @@ export default {
29 29
         getUsers() {
30 30
             const users = [
31 31
                 {
32
-                    name: "bob",
32
+                    name: 'bob',
33 33
                     id: 1234,
34
-                    metadata: { age: '21', rawMetadata: 'Some Text Here!' }
34
+                    metadata: { age: '21', rawMetadata: 'Some Text Here!' },
35 35
                 },
36 36
                 {
37
-                    name: "rob",
37
+                    name: 'rob',
38 38
                     id: 1235,
39
-                    metadata: { age: '21', rawMetadata: 'Some Text Here!' }
40
-                }
39
+                    metadata: { age: '21', rawMetadata: 'Some Text Here!' },
40
+                },
41 41
             ]
42 42
             this.swipables = users
43 43
         },
44 44
     },
45 45
 }
46 46
 </script>
47
-
48
-<style lang="postcss">
49
-#home
50
-    display: flex
51
-    flex-direction: row-reverse
52
-</style>

Laddar…
Avbryt
Spara