Просмотр исходного кода

Merge branch '19-waveui' of fyindr/siimee into master

tags/0.0.1
maeda 3 лет назад
Родитель
Сommit
6737eebfc0
51 измененных файлов: 693 добавлений и 2736 удалений
  1. 8
    6
      backend/.prettierrc
  2. 1
    1
      backend/lib/index.js
  3. 1
    1
      backend/lib/plugins/survey.js
  4. 19
    13
      backend/lib/routes/membership/join.js
  5. 8
    4
      backend/lib/routes/notification/index.js
  6. 11
    7
      backend/lib/routes/profile/get.js
  7. 12
    8
      backend/lib/routes/profile/match.js
  8. 11
    7
      backend/lib/routes/profile/respond.js
  9. 11
    7
      backend/lib/routes/profile/update.js
  10. 5
    3
      backend/lib/routes/survey/questions.js
  11. 6
    4
      backend/lib/routes/survey/responses.js
  12. 1
    1
      backend/lib/routes/user/create-profile.js
  13. 1
    1
      backend/lib/routes/user/list-profiles.js
  14. 3
    1
      backend/lib/routes/user/login.js
  15. 4
    4
      backend/lib/routes/user/signup.js
  16. 1
    0
      backend/lib/services/matchqueue.js
  17. 21
    12
      backend/lib/services/notification.js
  18. 27
    18
      backend/lib/services/profile/index.js
  19. 34
    10
      backend/lib/services/profile/profiler.js
  20. 7
    7
      backend/lib/services/profile/scorer.js
  21. 2
    2
      backend/lib/services/profile/tagger.js
  22. 3
    3
      backend/lib/services/profile/zipcoder.js
  23. 5
    2
      backend/lib/services/user.js
  24. 2
    2
      backend/server/index.js
  25. 0
    0
      frontend/.eslintrc
  26. 1
    1
      frontend/.prettierrc
  27. 254
    1848
      frontend/package-lock.json
  28. 4
    8
      frontend/package.json
  29. 0
    9
      frontend/postcss.config.js
  30. 50
    61
      frontend/src/App.vue
  31. 4
    17
      frontend/src/components/MainNav.vue
  32. 6
    49
      frontend/src/components/Messages.vue
  33. 14
    44
      frontend/src/components/ProfileCardList.vue
  34. 6
    24
      frontend/src/components/SideBar.vue
  35. 14
    9
      frontend/src/main.js
  36. 1
    1
      frontend/src/router/index.js
  37. 0
    48
      frontend/src/sss/_variables.sss
  38. 0
    18
      frontend/src/sss/card.scss
  39. 0
    4
      frontend/src/sss/import.css
  40. 0
    217
      frontend/src/sss/partials/_helpers.sss
  41. 0
    13
      frontend/src/sss/partials/_ratios.sss
  42. 0
    40
      frontend/src/sss/partials/_reset.sss
  43. 0
    43
      frontend/src/sss/partials/_typography.sss
  44. 0
    16
      frontend/src/sss/theme.sss
  45. 8
    20
      frontend/src/views/HomeView.vue
  46. 5
    9
      frontend/src/views/LoginView.vue
  47. 6
    10
      frontend/src/views/MatchesView.vue
  48. 0
    2
      frontend/src/views/ProfileView.vue
  49. 64
    99
      frontend/src/views/SurveyView.vue
  50. 42
    0
      frontend/src/wave.js
  51. 10
    2
      frontend/vite.config.js

+ 8
- 6
backend/.prettierrc Просмотреть файл

@@ -1,6 +1,8 @@
1
-trailingComma: "all"
2
-tabWidth: 4
3
-semi: false
4
-singleQuote: true
5
-bracketSpacing: true
6
-arrowParens: "avoid"
1
+{
2
+    "trailingComma": "all",
3
+    "tabWidth": 4,
4
+    "semi": false,
5
+    "singleQuote": true,
6
+    "bracketSpacing": true,
7
+    "arrowParens": "avoid"
8
+}

+ 1
- 1
backend/lib/index.js Просмотреть файл

@@ -41,7 +41,7 @@ exports.plugin = {
41 41
         await server.register(ProfilePlugin, {
42 42
             routes: { prefix: '/profile' },
43 43
         })
44
-        
44
+
45 45
         await server.register(NotificationPlugin, {
46 46
             routes: { prefix: '/notification' },
47 47
         })

+ 1
- 1
backend/lib/plugins/survey.js Просмотреть файл

@@ -24,5 +24,5 @@ module.exports = {
24 24
 
25 25
         await server.route(ResponseQuestionsRoute)
26 26
     },
27
-    models: { ReponseKeyModel }
27
+    models: { ReponseKeyModel },
28 28
 }

+ 19
- 13
backend/lib/routes/membership/join.js Просмотреть файл

@@ -15,18 +15,20 @@ const pluginConfig = {
15 15
 
16 16
 const validators = {
17 17
     params: params.profileId,
18
-    payload: groupingSchema.single.append({
19
-        target_id: Joi.number().required(),
20
-        role: Joi.string(),
21
-    }).label('grouping_membership_single')
18
+    payload: groupingSchema.single
19
+        .append({
20
+            target_id: Joi.number().required(),
21
+            role: Joi.string(),
22
+        })
23
+        .label('grouping_membership_single'),
22 24
 }
23 25
 
24 26
 const responseSchemas = {
25 27
     response: Joi.object({
26 28
         memberships: Joi.array().items(),
27
-        hasMatch: Joi.boolean()
29
+        hasMatch: Joi.boolean(),
28 30
     }).label('grouping_membership_list'),
29
-    error: errorSchema.single
31
+    error: errorSchema.single,
30 32
 }
31 33
 
32 34
 module.exports = {
@@ -99,18 +101,22 @@ module.exports = {
99 101
         /** Validate based on validators object */
100 102
         validate: {
101 103
             ...validators,
102
-            failAction: 'log'
104
+            failAction: 'log',
103 105
         },
104 106
 
105 107
         /** Validate the server response */
106 108
         response: {
107 109
             status: {
108
-                200: apiSchema.single.append({
109
-                    data: responseSchemas.response,
110
-                }).label('join_grouping_res'),
111
-                409: apiSchema.single.append({
112
-                    data: responseSchemas.error,
113
-                }).label('error_single_res'),
110
+                200: apiSchema.single
111
+                    .append({
112
+                        data: responseSchemas.response,
113
+                    })
114
+                    .label('join_grouping_res'),
115
+                409: apiSchema.single
116
+                    .append({
117
+                        data: responseSchemas.error,
118
+                    })
119
+                    .label('error_single_res'),
114 120
             },
115 121
         },
116 122
     },

+ 8
- 4
backend/lib/routes/notification/index.js Просмотреть файл

@@ -15,7 +15,7 @@ const pluginConfig = {
15 15
 }
16 16
 
17 17
 const validators = {
18
-    params: params.profileId
18
+    params: params.profileId,
19 19
 }
20 20
 
21 21
 module.exports = {
@@ -31,7 +31,12 @@ module.exports = {
31 31
             const input = new PassThrough({ objectMode: true })
32 32
             const eventType = 'stonk'
33 33
 
34
-            const msg = { profile_id, name: 'BDGRS', price: (500 + Math.floor(Math.random() * 100)).toString(), order: null }
34
+            const msg = {
35
+                profile_id,
36
+                name: 'BDGRS',
37
+                price: (500 + Math.floor(Math.random() * 100)).toString(),
38
+                order: null,
39
+            }
35 40
 
36 41
             // Write to the input stream
37 42
             setInterval(() => {
@@ -48,8 +53,7 @@ module.exports = {
48 53
         /** Validate based on validators object */
49 54
         validate: {
50 55
             ...validators,
51
-            failAction: 'log'
56
+            failAction: 'log',
52 57
         },
53
-
54 58
     },
55 59
 }

+ 11
- 7
backend/lib/routes/profile/get.js Просмотреть файл

@@ -20,7 +20,7 @@ const responseSchemas = {
20 20
 }
21 21
 
22 22
 const validators = {
23
-    params: params.profileId
23
+    params: params.profileId,
24 24
 }
25 25
 
26 26
 module.exports = {
@@ -65,12 +65,16 @@ module.exports = {
65 65
         /** Validate the server response */
66 66
         response: {
67 67
             status: {
68
-                200: apiSchema.single.append({
69
-                    data: responseSchemas.profile,
70
-                }).label('profile_single_res'),
71
-                409: apiSchema.single.append({
72
-                    data: responseSchemas.error,
73
-                }).label('error_single_res'),
68
+                200: apiSchema.single
69
+                    .append({
70
+                        data: responseSchemas.profile,
71
+                    })
72
+                    .label('profile_single_res'),
73
+                409: apiSchema.single
74
+                    .append({
75
+                        data: responseSchemas.error,
76
+                    })
77
+                    .label('error_single_res'),
74 78
             },
75 79
         },
76 80
     },

+ 12
- 8
backend/lib/routes/profile/match.js Просмотреть файл

@@ -3,7 +3,7 @@
3 3
 const Joi = require('joi')
4 4
 const apiSchema = require('../../schemas/api')
5 5
 const errorSchema = require('../../schemas/errors')
6
-const surveyResponseSchema = require('../../schemas/responses') 
6
+const surveyResponseSchema = require('../../schemas/responses')
7 7
 
8 8
 const pluginConfig = {
9 9
     handlerType: 'match',
@@ -17,7 +17,7 @@ const validators = {}
17 17
 
18 18
 const responseSchemas = {
19 19
     response: surveyResponseSchema.list,
20
-    error: errorSchema.single
20
+    error: errorSchema.single,
21 21
 }
22 22
 
23 23
 module.exports = {
@@ -66,12 +66,16 @@ module.exports = {
66 66
         /** Validate the server response */
67 67
         response: {
68 68
             status: {
69
-                200: apiSchema.single.append({
70
-                    data: responseSchemas.response,
71
-                }).label('response_list_res'),
72
-                409: apiSchema.single.append({
73
-                    data: responseSchemas.error,
74
-                }).label('error_single_res')
69
+                200: apiSchema.single
70
+                    .append({
71
+                        data: responseSchemas.response,
72
+                    })
73
+                    .label('response_list_res'),
74
+                409: apiSchema.single
75
+                    .append({
76
+                        data: responseSchemas.error,
77
+                    })
78
+                    .label('error_single_res'),
75 79
             },
76 80
         },
77 81
     },

+ 11
- 7
backend/lib/routes/profile/respond.js Просмотреть файл

@@ -16,7 +16,7 @@ const pluginConfig = {
16 16
 
17 17
 const responseSchemas = {
18 18
     response: surveyResponseSchema.list,
19
-    error: errorSchema.single
19
+    error: errorSchema.single,
20 20
 }
21 21
 
22 22
 const validators = {
@@ -91,12 +91,16 @@ module.exports = {
91 91
         /** Validate the server response */
92 92
         response: {
93 93
             status: {
94
-                201: apiSchema.single.append({
95
-                    data: responseSchemas.response,
96
-                }).label('response_list_res'),
97
-                409: apiSchema.single.append({
98
-                    data: responseSchemas.error,
99
-                }).label('error_single_res')
94
+                201: apiSchema.single
95
+                    .append({
96
+                        data: responseSchemas.response,
97
+                    })
98
+                    .label('response_list_res'),
99
+                409: apiSchema.single
100
+                    .append({
101
+                        data: responseSchemas.error,
102
+                    })
103
+                    .label('error_single_res'),
100 104
             },
101 105
         },
102 106
     },

+ 11
- 7
backend/lib/routes/profile/update.js Просмотреть файл

@@ -16,7 +16,7 @@ const pluginConfig = {
16 16
 
17 17
 const responseSchemas = {
18 18
     response: surveyResponseSchema.list,
19
-    error: errorSchema.single
19
+    error: errorSchema.single,
20 20
 }
21 21
 
22 22
 const validators = {
@@ -86,12 +86,16 @@ module.exports = {
86 86
         /** Validate the server response */
87 87
         response: {
88 88
             status: {
89
-                200: apiSchema.single.append({
90
-                    data: responseSchemas.response,
91
-                }).label('response_list_res'),
92
-                409: apiSchema.single.append({
93
-                    data: responseSchemas.error,
94
-                }).label('error_single_res')
89
+                200: apiSchema.single
90
+                    .append({
91
+                        data: responseSchemas.response,
92
+                    })
93
+                    .label('response_list_res'),
94
+                409: apiSchema.single
95
+                    .append({
96
+                        data: responseSchemas.error,
97
+                    })
98
+                    .label('error_single_res'),
95 99
             },
96 100
         },
97 101
     },

+ 5
- 3
backend/lib/routes/survey/questions.js Просмотреть файл

@@ -59,9 +59,11 @@ module.exports = {
59 59
 
60 60
         /** Validate the server response */
61 61
         response: {
62
-            schema: apiSchema.single.append({
63
-                data: responseSchemas.response
64
-            }).label('question_list_res'),
62
+            schema: apiSchema.single
63
+                .append({
64
+                    data: responseSchemas.response,
65
+                })
66
+                .label('question_list_res'),
65 67
             failAction: 'log',
66 68
         },
67 69
     },

+ 6
- 4
backend/lib/routes/survey/responses.js Просмотреть файл

@@ -25,7 +25,7 @@ const validators = {
25 25
     // payload: true,
26 26
 }
27 27
 const responseSchemas = {
28
-    response: surveyResponseSchema.keys
28
+    response: surveyResponseSchema.keys,
29 29
 }
30 30
 
31 31
 module.exports = {
@@ -60,9 +60,11 @@ module.exports = {
60 60
 
61 61
         /** Validate the server response */
62 62
         response: {
63
-            schema: apiSchema.single.append({
64
-                data: responseSchemas.response
65
-            }).label('response_list_res'),
63
+            schema: apiSchema.single
64
+                .append({
65
+                    data: responseSchemas.response,
66
+                })
67
+                .label('response_list_res'),
66 68
             failAction: 'log',
67 69
         },
68 70
     },

+ 1
- 1
backend/lib/routes/user/create-profile.js Просмотреть файл

@@ -36,7 +36,7 @@ const responseSchemas = {
36 36
         user_id: Joi.number(),
37 37
         user_name: Joi.string(),
38 38
     }).label('created_profile'),
39
-    error: errorSchema.single
39
+    error: errorSchema.single,
40 40
 }
41 41
 
42 42
 module.exports = {

+ 1
- 1
backend/lib/routes/user/list-profiles.js Просмотреть файл

@@ -28,7 +28,7 @@ const validators = {
28 28
 
29 29
 const responseSchemas = {
30 30
     profilesList: profileSchema.list,
31
-    error: errorSchema.single
31
+    error: errorSchema.single,
32 32
 }
33 33
 
34 34
 module.exports = {

+ 3
- 1
backend/lib/routes/user/login.js Просмотреть файл

@@ -18,7 +18,9 @@ const validators = {
18 18
         payload: Joi.object({
19 19
             user: userSchema.single,
20 20
             error: errorSchema.single,
21
-        }).append().label('login_payload'),
21
+        })
22
+            .append()
23
+            .label('login_payload'),
22 24
     },
23 25
     user: userSchema.single,
24 26
 }

+ 4
- 4
backend/lib/routes/user/signup.js Просмотреть файл

@@ -14,8 +14,8 @@ const pluginConfig = {
14 14
 
15 15
 const validators = {
16 16
     post: {
17
-        payload: userSchema.userSignup
18
-    }
17
+        payload: userSchema.userSignup,
18
+    },
19 19
 }
20 20
 
21 21
 const responseSchemas = {
@@ -27,7 +27,7 @@ const responseSchemas = {
27 27
         is_admin: Joi.number(),
28 28
         is_verified: Joi.number(),
29 29
     }).label('created_user'),
30
-    error: errorSchema.single
30
+    error: errorSchema.single,
31 31
 }
32 32
 
33 33
 module.exports = {
@@ -55,7 +55,7 @@ module.exports = {
55 55
                         is_poster: userType,
56 56
                         is_admin: 0,
57 57
                         is_verified: 0,
58
-                    }
58
+                    },
59 59
                 })
60 60
                 return h
61 61
                     .response({

+ 1
- 0
backend/lib/services/matchqueue.js Просмотреть файл

@@ -39,6 +39,7 @@ module.exports = class MatchQueueService extends Schmervice.Service {
39 39
         })
40 40
         return queueByProfileId
41 41
     }
42
+
42 43
     /**
43 44
      * Saves Scored Profile Ids to MatchQue IN ORDER
44 45
      * @param {number} profileId

+ 21
- 12
backend/lib/services/notification.js Просмотреть файл

@@ -17,8 +17,12 @@ const stringifyEvent = function (event) {
17 17
     const endl = '\r\n'
18 18
     for (const i in event) {
19 19
         let val = event[i]
20
-        if (val instanceof Buffer) { val = val.toString() }
21
-        if (typeof val === 'object') { val = JSON.stringify(val) }
20
+        if (val instanceof Buffer) {
21
+            val = val.toString()
22
+        }
23
+        if (typeof val === 'object') {
24
+            val = JSON.stringify(val)
25
+        }
22 26
         str += i + ': ' + val + endl
23 27
     }
24 28
     str += endl
@@ -29,7 +33,7 @@ const stringifyEvent = function (event) {
29 33
  * Transform extension
30 34
  * ?: I don't really get what this is doing
31 35
  * @param {object} options
32
- * @param {object} objectMode 
36
+ * @param {object} objectMode
33 37
  */
34 38
 class Transformer extends Transform {
35 39
     constructor(options, objectMode) {
@@ -37,16 +41,20 @@ class Transformer extends Transform {
37 41
         options = options || {}
38 42
         this.counter = 1
39 43
         this.event = options.event || null
40
-        this.generateId = options.generateId ? options.generateId : () => {
41
-            return this.counter++
42
-        }
44
+        this.generateId = options.generateId
45
+            ? options.generateId
46
+            : () => {
47
+                  return this.counter++
48
+              }
43 49
     }
44
-    _transform (chunk, encoding, callback) {
50
+    _transform(chunk, encoding, callback) {
45 51
         const event = {
46 52
             id: this.generateId(chunk),
47
-            data: chunk
53
+            data: chunk,
54
+        }
55
+        if (this.event) {
56
+            event.event = this.event
48 57
         }
49
-        if (this.event) { event.event = this.event }
50 58
         this.push(stringifyEvent(event))
51 59
         callback()
52 60
     }
@@ -54,7 +62,7 @@ class Transformer extends Transform {
54 62
         this.push(stringifyEvent(ENDER))
55 63
         callback()
56 64
     }
57
-} 
65
+}
58 66
 
59 67
 /**
60 68
  * Take an event stream and write content to another stream
@@ -95,7 +103,8 @@ const onEvent = (event, h, streamOptions) => {
95 103
         //     event.pipe(stream)
96 104
         // }
97 105
         console.log('streamOptions :', streamOptions)
98
-        return h.response(active)
106
+        return h
107
+            .response(active)
99 108
             .header('content-type', 'text/event-stream')
100 109
             .header('content-encoding', 'identity')
101 110
     }
@@ -116,4 +125,4 @@ const onEvent = (event, h, streamOptions) => {
116 125
     // internals.writeEvent(event, active)
117 126
 }
118 127
 
119
-module.exports = { onEvent }
128
+module.exports = { onEvent }

+ 27
- 18
backend/lib/services/profile/index.js Просмотреть файл

@@ -82,8 +82,12 @@ module.exports = class ProfileService extends Schmervice.Service {
82 82
             // CHECKTHIS: Added this because we added user.user_name to CompleteProfile
83 83
             // so without this, we get undefined user_name
84 84
             .withGraphFetched('user')
85
-        
86
-        return profiler.makeCompleteProfilesFromProfile(profilesEntries, type, this.tagLookup)
85
+
86
+        return profiler.makeCompleteProfilesFromProfile(
87
+            profilesEntries,
88
+            type,
89
+            this.tagLookup,
90
+        )
87 91
     }
88 92
 
89 93
     async getProfilesFor(profileIdArray, type, includeResponses = true) {
@@ -106,7 +110,7 @@ module.exports = class ProfileService extends Schmervice.Service {
106 110
             profilesEntries,
107 111
             type,
108 112
             includeResponses,
109
-            this.tagLookup
113
+            this.tagLookup,
110 114
         )
111 115
     }
112 116
 
@@ -128,13 +132,14 @@ module.exports = class ProfileService extends Schmervice.Service {
128 132
              * Using using the input and converting to index
129 133
              * of the generated possible prescore array in config
130 134
              * DUPLICATE:See saveResponseForProfile() line 343
131
-             */ 
135
+             */
132 136
             let convertedResponse = responseToSave
133
-            if(scoring._isScorableResponse(responseToSave.response_key_id)) {
137
+            if (scoring._isScorableResponse(responseToSave.response_key_id)) {
134 138
                 // Convert -3 to 0, 0 to 3, 3 to 6
135 139
                 const offset = (config.scoreVals.length - 1) / 2
136 140
                 const indexFromInput = parseInt(responseToSave.val) + offset
137
-                convertedResponse.val = config.scoreVals[indexFromInput].toString()
141
+                convertedResponse.val =
142
+                    config.scoreVals[indexFromInput].toString()
138 143
             }
139 144
 
140 145
             const responseInfo = {
@@ -194,7 +199,7 @@ module.exports = class ProfileService extends Schmervice.Service {
194 199
         )
195 200
         if (matchingResponses.length > 0) {
196 201
             const alreadyAnswered = matchingResponses.map(
197
-                matchingRes => matchingRes.response_key_id
202
+                matchingRes => matchingRes.response_key_id,
198 203
             )
199 204
             await Response.query()
200 205
                 .where({ profile_id: profileId })
@@ -206,9 +211,9 @@ module.exports = class ProfileService extends Schmervice.Service {
206 211
          * Convert indexes to actual score values
207 212
          * Using using the input and converting to index
208 213
          * of the generated possible prescore array in config
209
-         */ 
214
+         */
210 215
         let convertedResponse = responseToSave
211
-        if(scoring._isScorableResponse(responseToSave.response_key_id)) {
216
+        if (scoring._isScorableResponse(responseToSave.response_key_id)) {
212 217
             // Convert -3 to 0, 0 to 3, 3 to 6
213 218
             const offset = (config.scoreVals.length - 1) / 2
214 219
             const indexFromInput = parseInt(responseToSave.val) + offset
@@ -251,7 +256,7 @@ module.exports = class ProfileService extends Schmervice.Service {
251 256
             .findOne('profile_id', profileId)
252 257
             .withGraphFetched('responses')
253 258
             .withGraphFetched('user')
254
-        
259
+
255 260
         // Move unneeded responses
256 261
         const userZip = zipcoder.getZipCodeFromProfile(userProfile)
257 262
 
@@ -263,13 +268,15 @@ module.exports = class ProfileService extends Schmervice.Service {
263 268
 
264 269
         // TODO: Let Objection optimize this
265 270
         const isPosterOpposite = userProfile.user.is_poster == 1 ? 0 : 1
266
-        profileIdsOfOppositeType = profileIdsOfOppositeType.filter(profile => {
267
-            return profile.user.is_poster == isPosterOpposite
268
-        }).filter(profile => {
269
-            // Only include profiles that included zipcode response
270
-            return zipcoder.getZipCodeFromProfile(profile) ? true : false
271
-        })
272
-        
271
+        profileIdsOfOppositeType = profileIdsOfOppositeType
272
+            .filter(profile => {
273
+                return profile.user.is_poster == isPosterOpposite
274
+            })
275
+            .filter(profile => {
276
+                // Only include profiles that included zipcode response
277
+                return zipcoder.getZipCodeFromProfile(profile) ? true : false
278
+            })
279
+
273 280
         const profilePlusDistance = await Promise.all(
274 281
             profileIdsOfOppositeType.map(async profile => {
275 282
                 const targetZip = zipcoder.getZipCodeFromProfile(profile)
@@ -315,7 +322,9 @@ module.exports = class ProfileService extends Schmervice.Service {
315 322
             'zip_code_id',
316 323
             parseInt(zipCode),
317 324
         )
318
-        if (!zipInfo) { console.error('zip:', zipCode) }
325
+        if (!zipInfo) {
326
+            console.error('zip:', zipCode)
327
+        }
319 328
         return {
320 329
             latitude: parseFloat(zipInfo.latitude),
321 330
             longitude: parseFloat(zipInfo.longitude),

+ 34
- 10
backend/lib/services/profile/profiler.js Просмотреть файл

@@ -33,26 +33,50 @@ class CompleteProfile {
33 33
             // [] of all "profile" responses
34 34
             this.responses = profile.responses
35 35
             // image, language, duration, presence, blurb, urgency, role, pronouns, distance
36
-            const prefs = ['zipcode', 'duration', 'presence', 'urgency', 'role', 'pronouns', 'distance']
36
+            const prefs = [
37
+                'zipcode',
38
+                'duration',
39
+                'presence',
40
+                'urgency',
41
+                'role',
42
+                'pronouns',
43
+                'distance',
44
+            ]
37 45
             const prefsKeys = config.prefKeys
38 46
             prefs.forEach((pref, i) => {
39 47
                 this.profile_prefs[pref] = this.responses.filter(
40
-                    r => r.response_key_id === prefsKeys[i]
48
+                    r => r.response_key_id === prefsKeys[i],
41 49
                 )[0]
42 50
             })
43
-            this.profile_description = this.responses.filter(r => r.response_key_id === config.blurbKey).map(r => r.val)[0]
44
-            this.profile_media = this.responses.filter(r => r.response_key_id === config.mediaKey).map(r => r.val)
45
-            this.profile_languages = this.responses.filter(r => r.response_key_id === config.langKey).map(r => r.val)
51
+            this.profile_description = this.responses
52
+                .filter(r => r.response_key_id === config.blurbKey)
53
+                .map(r => r.val)[0]
54
+            this.profile_media = this.responses
55
+                .filter(r => r.response_key_id === config.mediaKey)
56
+                .map(r => r.val)
57
+            this.profile_languages = this.responses
58
+                .filter(r => r.response_key_id === config.langKey)
59
+                .map(r => r.val)
46 60
         }
47 61
     }
48 62
 }
49 63
 
50
-const makeCompleteProfiles = (profileIdArray, profilesEntries, type, includeResponses, tagLookup) => {
64
+const makeCompleteProfiles = (
65
+    profileIdArray,
66
+    profilesEntries,
67
+    type,
68
+    includeResponses,
69
+    tagLookup,
70
+) => {
51 71
     const completeProfiles = []
52 72
     profileIdArray.forEach(pid => {
53 73
         profilesEntries.forEach(entry => {
54 74
             if (entry.profile_id == pid) {
55
-                const complete = new CompleteProfile(entry, type, includeResponses)
75
+                const complete = new CompleteProfile(
76
+                    entry,
77
+                    type,
78
+                    includeResponses,
79
+                )
56 80
                 tagger.setProfileTags(entry, complete, tagLookup)
57 81
                 completeProfiles.push(complete)
58 82
             }
@@ -60,7 +84,7 @@ const makeCompleteProfiles = (profileIdArray, profilesEntries, type, includeResp
60 84
     })
61 85
     return completeProfiles
62 86
 }
63
-const makeCompleteProfilesFromProfile = (profilesEntries, type, tagLookup)=> {
87
+const makeCompleteProfilesFromProfile = (profilesEntries, type, tagLookup) => {
64 88
     profilesEntries.forEach(profile => {
65 89
         tagger.setProfileTags(profile, profile, tagLookup)
66 90
     })
@@ -74,5 +98,5 @@ const makeCompleteProfilesFromProfile = (profilesEntries, type, tagLookup)=> {
74 98
 module.exports = {
75 99
     CompleteProfile,
76 100
     makeCompleteProfiles,
77
-    makeCompleteProfilesFromProfile
78
-}
101
+    makeCompleteProfilesFromProfile,
102
+}

+ 7
- 7
backend/lib/services/profile/scorer.js Просмотреть файл

@@ -20,7 +20,7 @@ const makeScoreLookup = (aspects, labels) => {
20 20
 
21 21
 const _isScorableResponse = res_key_id => {
22 22
     let isScorable = false
23
-    if(config.resKeys.includes(res_key_id)) {
23
+    if (config.resKeys.includes(res_key_id)) {
24 24
         isScorable = true
25 25
     }
26 26
     return isScorable
@@ -32,11 +32,11 @@ const scoreResponses = (seeker, potentialMatch, prescoreLookup) => {
32 32
             error: `complete responses for profile: ${seeker.profile_id} unqeual to profile: ${potentialMatch.profile_id} | ${seeker.responses.length}:${potentialMatch.responses.length}`,
33 33
         }
34 34
 
35
-    const aRes = seeker.responses.filter(
36
-        res =>  _isScorableResponse(res.response_key_id)
35
+    const aRes = seeker.responses.filter(res =>
36
+        _isScorableResponse(res.response_key_id),
37 37
     )
38
-    const bRes = potentialMatch.responses.filter(
39
-        res =>  _isScorableResponse(res.response_key_id)
38
+    const bRes = potentialMatch.responses.filter(res =>
39
+        _isScorableResponse(res.response_key_id),
40 40
     )
41 41
 
42 42
     const composite = []
@@ -72,5 +72,5 @@ module.exports = {
72 72
     _isScorableResponse,
73 73
     scoreResponses,
74 74
     makeScoreLookup,
75
-    scoreAll
76
-}
75
+    scoreAll,
76
+}

+ 2
- 2
backend/lib/services/profile/tagger.js Просмотреть файл

@@ -3,5 +3,5 @@ const setProfileTags = (inProfile, outProfile, tagLookup) => {
3 3
 }
4 4
 
5 5
 module.exports = {
6
-    setProfileTags
7
-}
6
+    setProfileTags,
7
+}

+ 3
- 3
backend/lib/services/profile/zipcoder.js Просмотреть файл

@@ -6,7 +6,7 @@ const config = require('../../../db/data-generator/config.json')
6 6
 const getZipCodeFromProfile = profile => {
7 7
     // There should only be one zip code entry per profile
8 8
     let zipRes = profile.responses.find(
9
-        res => res.response_key_id == config.zipcodeKey
9
+        res => res.response_key_id == config.zipcodeKey,
10 10
     )
11 11
     return zipRes.val
12 12
 }
@@ -21,5 +21,5 @@ const filterByDistance = (profileList, max) => {
21 21
 
22 22
 module.exports = {
23 23
     getZipCodeFromProfile,
24
-    filterByDistance
25
-}
24
+    filterByDistance,
25
+}

+ 5
- 2
backend/lib/services/user.js Просмотреть файл

@@ -58,9 +58,12 @@ module.exports = class UserService extends Schmervice.Service {
58 58
      */
59 59
     async signup({ password, userInfo }, txn) {
60 60
         const { User } = this.server.models()
61
-        const matchingEmails = await User.query().where('user_email', userInfo.user_email)
61
+        const matchingEmails = await User.query().where(
62
+            'user_email',
63
+            userInfo.user_email,
64
+        )
62 65
 
63
-        if(matchingEmails.length > 0) { 
66
+        if (matchingEmails.length > 0) {
64 67
             throw `User ${userInfo.user_email} already exists: Cannot create a user without a unique email`
65 68
         }
66 69
         const user = await User.query(txn).insert(userInfo)

+ 2
- 2
backend/server/index.js Просмотреть файл

@@ -25,7 +25,7 @@ exports.deployment = async ({ start } = {}) => {
25 25
 if (require.main === module) {
26 26
     exports.deployment({ start: true })
27 27
 
28
-    process.on('unhandledRejection', (err) => {
28
+    process.on('unhandledRejection', err => {
29 29
         throw err
30 30
     })
31
-}
31
+}

frontend/.eslintrc.json → frontend/.eslintrc Просмотреть файл


frontend/.prettierrc.json → frontend/.prettierrc Просмотреть файл

@@ -10,4 +10,4 @@
10 10
     "pugFramework": "vue",
11 11
     "pugSingleFileComponentIndentation": false,
12 12
     "pugClassNotation": "literal"
13
-}
13
+}

+ 254
- 1848
frontend/package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 4
- 8
frontend/package.json Просмотреть файл

@@ -15,25 +15,21 @@
15 15
         "pubnub": "^5.0.0",
16 16
         "vue": "^3.2.31",
17 17
         "vue-eslint-parser": "^9.0.2",
18
-        "vue-router": "^4.0.14"
18
+        "vue-router": "^4.0.14",
19
+        "wave-ui": "^2.40.2"
19 20
     },
20 21
     "devDependencies": {
21 22
         "@prettier/plugin-pug": "^1.19.2",
22 23
         "@vitejs/plugin-vue": "^2.2.4",
23 24
         "@vue/compiler-sfc": "^3.2.31",
24
-        "autoprefixer": "^10.4.2",
25 25
         "cross-env": "^7.0.3",
26 26
         "eslint": "^8.11.0",
27 27
         "eslint-config-prettier": "^8.5.0",
28 28
         "eslint-plugin-vue": "^8.5.0",
29
-        "naive-ui": "^2.26.4",
30
-        "postcss": "^8.4.8",
31
-        "postcss-calc": "^8.2.4",
32
-        "postcss-import": "^14.0.2",
33
-        "precss": "^4.0.0",
34 29
         "pug": "^3.0.2",
35 30
         "pug-plain-loader": "^1.1.0",
36
-        "sugarss": "^4.0.1",
31
+        "sass": "^1.54.4",
32
+        "sass-loader": "^10.3.1",
37 33
         "vite": "^2.8.6",
38 34
         "vite-fs": "^0.0.2",
39 35
         "watch": "^1.0.2"

+ 0
- 9
frontend/postcss.config.js Просмотреть файл

@@ -1,9 +0,0 @@
1
-module.exports = {
2
-    parser: 'sugarss',
3
-    plugins: [
4
-        require('postcss-import'),
5
-        require('postcss-calc'),
6
-        require('precss'),
7
-        require('autoprefixer'),
8
-    ],
9
-}

+ 50
- 61
frontend/src/App.vue Просмотреть файл

@@ -1,20 +1,46 @@
1 1
 <template lang="pug">
2
-SideBar(
3
-    v-if="showSidebar"
4
-    :pid="getPid"
5
-    @updatePid="setPid"
6
-    @hide="showSidebar = false"
7
-)
8
-RouterView(
9
-    :pid="getPid"
10
-    @updatePid="setPid"
11
-    @show-sidebar="showSidebar = !showSidebar"
12
-)
2
+w-app
3
+    w-drawer(v-model="openDrawer")
4
+    w-flex.my12(:gap="3" align-center wrap)
5
+        w-button.ma1(@click="$waveui.notify('Information.')" bg-color="info") Notify info
6
+        w-button.ma1(@click="$waveui.notify('Success!', 'success')" bg-color="success") Notify success
7
+        w-button.ma1(@click="$waveui.notify('Warning!', 'warning')" bg-color="warning") Notify warning
8
+        w-button.ma1(@click="$waveui.notify('Error :(', 'error', 0)" bg-color="error") Permanent error
9
+    w-flex.my12(align-center wrap)
10
+        w-spinner(bounce)
11
+        w-input Label
12
+        w-checkbox Single option
13
+    w-flex.my12
14
+        w-button(@click="openDrawer = true" outline="")
15
+            | Open drawer
16
+    w-flex.my12(grow column)
17
+        w-slider(:model-value="40" thumb-label step-label :step="20" color="primary-light3").mt12
18
+        .mt4 v-model:
19
+            code.ml1 {{ sliderVal }}
20
+    w-flex.my12(:gap="3" align-center wrap)
21
+        | Show menu on:
22
+        w-menu
23
+            template(#activator="{ on }")
24
+                w-button(v-on="on") Show menu
25
+            | Menu content
26
+        w-badge.mr10(bg-color="error")
27
+            template(#badge) 3
28
+            w-icon(color="grey-light1" size="2.5em") mdi mdi-email
29
+    SideBar(
30
+        v-if="showSidebar"
31
+        :pid="getPid"
32
+        @updatePid="setPid"
33
+        @hide="showSidebar = false"
34
+    )
35
+    RouterView(
36
+        :pid="getPid"
37
+        @updatePid="setPid"
38
+        @show-sidebar="showSidebar = !showSidebar"
39
+    )
13 40
 </template>
14 41
 
15 42
 <script>
16
-import * as sss from '@/sss/import.css'
17
-
43
+import 'wave-ui/dist/wave-ui.css'
18 44
 import SideBar from './components/SideBar.vue'
19 45
 
20 46
 import { Chatter, currentProfile, StonkAlert } from './services'
@@ -26,23 +52,27 @@ const DEV_PID = 45
26 52
 export default {
27 53
     components: { SideBar },
28 54
     data: () => ({
29
-        showSidebar: false
55
+        showSidebar: false,
56
+        sliderVal: 1,
57
+        openDrawer: false,
30 58
     }),
31 59
     computed: {
32
-        getPid: () => currentProfile.id.value
60
+        getPid: () => (currentProfile.id.value ? currentProfile.id.value : 999),
33 61
     },
34 62
     async created() {
35 63
         /** Get questions so we can compare against profile responses */
36 64
         await surveyFactory.getQuestions()
37 65
 
38
-        /** 
66
+        /**
39 67
          * Development mode turns router guards off so
40
-         * we hard set the profile id instead of 
68
+         * we hard set the profile id instead of
41 69
          * using the login form
42
-        */
43
-        if(DEV_MODE) { this.setPid(DEV_PID) }
70
+         */
71
+        if (DEV_MODE) {
72
+            this.setPid(DEV_PID)
73
+        }
44 74
 
45
-        if(currentProfile.isLoggedIn) {
75
+        if (currentProfile.isLoggedIn) {
46 76
             console.warn(`setting up Chatter and Toaster for ${this.getPid}...`)
47 77
             this.setupChatter()
48 78
             this.setupToaster()
@@ -72,44 +102,3 @@ export default {
72 102
     },
73 103
 }
74 104
 </script>
75
-
76
-<style lang="postcss">
77
-@import './sss/theme.sss'
78
-
79
-#app
80
-    display: flex
81
-    flex-direction: row
82
-    text-align: center
83
-    color: $primary
84
-    font-family: $sans
85
-    background-color: $dark
86
-    overflow-x: hidden
87
-    height: 100%
88
-    > main
89
-        position: relative
90
-        height: 100%
91
-        > header
92
-            h2
93
-                font-size: $ms-1
94
-        > article
95
-            height: 100%
96
-            width: 100%
97
-            flex-direction: column
98
-    
99
-    button
100
-        padding: $ms-0
101
-        background-color: $primary
102
-        border: 1px transparent solid
103
-        border-radius: $ms-1
104
-        transition: $transition
105
-        &:hover
106
-            background-color: $secondary
107
-            border: 1px transparent solid
108
-            border-radius: $ms-1
109
-            cursor: pointer
110
-            color: $primary
111
-        &:disabled
112
-            cursor: default
113
-            color: $primary
114
-            background-color: $light
115
-</style>

+ 4
- 17
frontend/src/components/MainNav.vue Просмотреть файл

@@ -1,9 +1,9 @@
1 1
 <template lang="pug">
2
-nav#main-header.w-full.z-top.f-row.around.p-2
2
+nav#main-header
3 3
     button(@click="$emit('show-sidebar')") toggle sidebar
4
-    router-link.header__icon.mobile--only(:to="`/matches`") matches
5
-    router-link.header__icon(to='/') home
6
-    router-link.header__icon.mobile--only(:to="`/survey`") survey
4
+    router-link(:to="`/matches`") matches
5
+    router-link(to='/') home
6
+    router-link(:to="`/survey`") survey
7 7
 </template>
8 8
 
9 9
 <script>
@@ -11,16 +11,3 @@ export default {
11 11
     name: 'MainNav',
12 12
 }
13 13
 </script>
14
-
15
-<style lang="postcss">
16
-#main-header
17
-  position: absolute
18
-  bottom: 1vh
19
-  right: 0
20
-
21
-
22
-@media only screen and (min-width: 768px)
23
-  .mobile--only
24
-    /* display: none */
25
-    display: block
26
-</style>

+ 6
- 49
frontend/src/components/Messages.vue Просмотреть файл

@@ -7,11 +7,10 @@
7 7
         :key='profile.profile_id' 
8 8
         :class="[pid == profile.profile_id ? 'active' : '', 'sidebar__message', 'f-col', 'start']"
9 9
     )
10
-    .f-row.start
11
-        img(:src='profile.avatar')
12
-        .message__right.f-col
13
-            h4.message__name {{ profile.name }}
14
-            p.message__content {{ profile.metadata.rawMetadata || &quot;Hello I&apos;m using tinder!&quot; }}
10
+    img(:src='profile.avatar')
11
+    .message__right
12
+        h4.message__name {{ profile.name }}
13
+        p.message__content {{ profile.metadata.rawMetadata || &quot;Hello I&apos;m using tinder!&quot; }}
15 14
 </template>
16 15
 
17 16
 <script>
@@ -19,54 +18,12 @@ import { mixins } from '../utils'
19 18
 
20 19
 export default {
21 20
     name: 'ProfileMessages',
22
-    mixins: [ mixins.pidMixin ],
21
+    mixins: [mixins.pidMixin],
23 22
     props: {
24 23
         matches: {
25 24
             type: [Object, Array],
26
-            default: () => []
25
+            default: () => [],
27 26
         },
28 27
     },
29 28
 }
30 29
 </script>
31
-
32
-<style lang="postcss">
33
-
34
-.sidebar
35
-    &--messages
36
-        padding: 20px 10px
37
-        /* overflow-y: scroll */
38
-        text-align: left
39
-        a
40
-            color: black
41
-            text-decoration: none
42
-            &:hover
43
-                background: #f9f9ff
44
-                transition: 0.5s
45
-            &.active
46
-                background: #ececff
47
-                transition: 0.5s
48
-    &__message
49
-        display: flex
50
-        align-items: center
51
-        margin: 20px 0
52
-        img
53
-            object-fit: cover
54
-            width: 70px
55
-            height: 70px
56
-            border-radius: 50%
57
-
58
-.message
59
-    &__title
60
-        color: #fd5068
61
-        text-transform: uppercase
62
-        margin-bottom: 10px
63
-    &__right
64
-        margin-left: 10px
65
-    &__name
66
-        padding-top: 5px
67
-        font-weight: 600
68
-    &__content
69
-        padding-top: 10px
70
-        line-height: 1em
71
-        
72
-</style>

+ 14
- 44
frontend/src/components/ProfileCardList.vue Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 <template lang="pug">
2
-section.profile-card-list.w-full
2
+section.profile-card-list
3 3
     .swipe(
4 4
         v-if="!isGrid"
5 5
         :config="config"
@@ -8,14 +8,14 @@ section.profile-card-list.w-full
8 8
         v-for="(profile, i) in loadedProfiles"
9 9
         :style="{ 'z-index': 1000-i }"
10 10
     )
11
-        .card.b-solid.bg-cover.randomize(
11
+        .card.randomize(
12 12
             :style="{ 'background-image': `url(${profile.avatar})`, 'top': `${randomize(10)}px`, 'right': `${randomize(20)}px`, 'transform': `rotate(${randomize(7)}deg)` }"
13 13
         )
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
14
+            .card--content
15
+                p(style="color: magenta;") profile: {{ profile.pid }}
16
+                .card--content--lower
17
+                    h4 {{ profile.name }}
18
+                    nav.swipe_icons
19 19
                         //- Accept
20 20
                         button(@click="accept") Accept
21 21
                         button(@click="view(profile.pid)") view
@@ -26,15 +26,15 @@ section.profile-card-list.w-full
26 26
         v-else
27 27
         :key="profile.pid"
28 28
         v-for="(profile, i) in loadedProfiles"
29
-    ).f-row
30
-            .card.b-solid.bg-cover(
29
+    )
30
+            .card.bg-cover(
31 31
                 :style="{ 'background-image': `url(${profile.avatar})` }"
32 32
             )
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
33
+                .card--content
34
+                    p(style="color: magenta;") profile: {{ profile.pid }}
35
+                    .card--content--lower
36
+                        h4 {{ profile.name }}
37
+                        nav.swipe_icons
38 38
                             button(@click="view(profile.pid)") view
39 39
 </template>
40 40
 
@@ -118,33 +118,3 @@ const config = {
118 118
 // Copy profiles so we don't mutate the original
119 119
 const loadedProfiles = [...props.profiles]
120 120
 </script>
121
-
122
-<style lang="postcss">
123
-.profile-card-list
124
-    display: flex
125
-    justify-content: center
126
-
127
-.swipe
128
-    position: absolute
129
-.randomize
130
-    position: relative
131
-
132
-.card
133
-    position: relative
134
-    background-color: #fff
135
-    height: 60vw
136
-    width: 40vw
137
-    max-height: 600px
138
-    max-width: 400px
139
-    background-position: center
140
-    &--content
141
-        width: 100%
142
-        height: 100%
143
-        font-size: 3vw
144
-        &--lower
145
-            background-color: goldenrod
146
-            nav > button
147
-                font-size: 2vw
148
-
149
-
150
-</style>

+ 6
- 24
frontend/src/components/SideBar.vue Просмотреть файл

@@ -1,12 +1,10 @@
1 1
 <template lang="pug">
2
-aside.sidebar.p-1.f-col.z-top
3
-    .temp-control-box.f-row.start.center
2
+aside.sidebar
3
+    .temp-control-box
4 4
         input(v-model="switchToPID")
5
-        button(@click="$emit('updatePid', switchToPID)").t-up.p-0 switch profile
5
+        button(@click="$emit('updatePid', switchToPID)") switch profile
6 6
     
7 7
     Messages(:matches="matches" :pid="pid")
8
-    
9
-    .spacer.f-grow
10 8
 </template>
11 9
 
12 10
 <script>
@@ -14,8 +12,8 @@ import Messages from './Messages.vue'
14 12
 import { mixins } from '../utils'
15 13
 
16 14
 export default {
17
-    components: { Messages }, 
18
-    mixins: [ mixins.pidMixin ],
15
+    components: { Messages },
16
+    mixins: [mixins.pidMixin],
19 17
     data: () => ({
20 18
         switchToPID: null,
21 19
         matches: [
@@ -36,22 +34,6 @@ export default {
36 34
     mounted() {
37 35
         // Set the form to display the default pid set in Home.vue
38 36
         this.switchToPID = this.pid
39
-    }
37
+    },
40 38
 }
41 39
 </script>
42
-
43
-<style lang="postcss">
44
-aside.sidebar
45
-    background-color: yellow
46
-    height: 100vh
47
-    position: fixed
48
-    h3
49
-        padding: 2vh
50
-
51
-.search
52
-    display: flex
53
-    flex-direction: row
54
-    input
55
-        border: 0
56
-
57
-</style>

+ 14
- 9
frontend/src/main.js Просмотреть файл

@@ -1,7 +1,10 @@
1 1
 import { createApp } from 'vue'
2
-import router from './router'
2
+import { router } from './router'
3 3
 import { checkLoginStatus } from './router/guards'
4 4
 
5
+import WaveUI from '../node_modules/wave-ui/src/wave-ui/core'
6
+import components from './wave'
7
+
5 8
 import App from './App.vue'
6 9
 import MainNav from './components/MainNav.vue'
7 10
 
@@ -12,21 +15,23 @@ const DEV = import.meta.env.VITE_DEV == 'true'
12 15
  */
13 16
 router.beforeEach((to, from, next) => {
14 17
     /**
15
-     * Skip any route guarding with `npm run dev`
16
-     */
17
-    if(DEV) { next() }
18
-
19
-    /**
18
+     * Skip any route guarding with `npm run dev` or
20 19
      * Use the loginService to deal with login details
21
-     * Activate with `npm run nodev`
20
+     * NOTE: Activate with `npm run nodev`
22 21
      */
23
-    else {
22
+    if (DEV) {
23
+        next()
24
+    } else {
24 25
         checkLoginStatus(to, next)
25 26
     }
26 27
 })
27 28
 
28 29
 const run = entry => {
29
-    const siimee = createApp(App).use(router)
30
+    const siimee = createApp(App)
31
+    siimee.use(WaveUI, { components })
32
+    new WaveUI(siimee)
33
+
34
+    siimee.use(router)
30 35
     siimee.component('MainNav', MainNav)
31 36
     siimee.mount(entry)
32 37
 }

+ 1
- 1
frontend/src/router/index.js Просмотреть файл

@@ -49,4 +49,4 @@ const router = createRouter({
49 49
     routes,
50 50
 })
51 51
 
52
-export default router
52
+export { router }

+ 0
- 48
frontend/src/sss/_variables.sss Просмотреть файл

@@ -1,48 +0,0 @@
1
-@import './partials/_ratios.sss'
2
-
3
-/**
4
-  * Misc
5
-  */
6
-$transition: 300ms
7
-
8
-/**
9
-  * Page
10
-  */
11
-$max-width: 80vw
12
-
13
-
14
-/**
15
-  * Fonts
16
-  */
17
-$sans: 'helvetica', 'calibri', 'sans-serif'
18
-$serif: 'georgia', 'serif'
19
-$mono: 'input', 'consolas','monospace'
20
-
21
-
22
-/**
23
-  * Modular Scale
24
-  */
25
-$base: 0.7em
26
-$scale: $golden
27
-
28
-$ms-0: calc($base)
29
-$ms-1: calc($ms-0 * $scale)
30
-$ms-2: calc($ms-1 * $scale)
31
-$ms-3: calc($ms-2 * $scale)
32
-$ms-4: calc($ms-3 * $scale)
33
-$ms-5: calc($ms-4 * $scale)
34
-$ms-6: calc($ms-5 * $scale)
35
-$ms-7: calc($ms-6 * $scale)
36
-$ms-8: calc($ms-7 * $scale)
37
-$ms-9: calc($ms-8 * $scale)
38
-
39
-/**
40
-  * Color Scale
41
-  */
42
-$cbase: 0.3
43
-$cs-0: calc($cbase)
44
-$cs-1: calc($cs-0 * $scale)
45
-$cs-2: calc($cs-1 * $scale)
46
-$cs-3: calc($cs-2 * $scale)
47
-$cs-4: calc($cs-3 * $scale)
48
-$cs-5: calc($cs-4 * $scale)

+ 0
- 18
frontend/src/sss/card.scss Просмотреть файл

@@ -1,18 +0,0 @@
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
-}

+ 0
- 4
frontend/src/sss/import.css Просмотреть файл

@@ -1,4 +0,0 @@
1
-@import './partials/_reset.sss'
2
-@import './partials/_ratios.sss'
3
-@import './partials/_helpers.sss'
4
-@import './partials/_typography.sss'

+ 0
- 217
frontend/src/sss/partials/_helpers.sss Просмотреть файл

@@ -1,217 +0,0 @@
1
-@import '../_variables.sss'
2
-@import '../theme.sss'
3
-
4
-.w
5
-    &-full
6
-        width: 100%
7
-    &-half
8
-        width: 50%
9
-    
10
-/* Flex box  */
11
-%flexy
12
-    display: flex
13
-    justify-content: center
14
-    align-items: center
15
-
16
-.f
17
-    &-row, &-col
18
-        @extend %flexy
19
-        &.start
20
-            align-items: flex-start
21
-            justify-content: flex-start
22
-        &.end 
23
-            align-items: flex-end
24
-            justify-content: flex-end
25
-        &.between
26
-            justify-content: space-between
27
-        &.around
28
-            justify-content: space-around
29
-        &.even
30
-            justify-content: space-evenly
31
-        &.stretch
32
-            align-content: stretch
33
-        &.baseline
34
-            align-items: baseline
35
-        &.center
36
-            align-items: flex-start
37
-            justify-content: flex-start
38
-        &.wrap
39
-            flex-wrap: wrap
40
-    &-row
41
-        flex-direction: row
42
-        &.reverse
43
-            flex-direction: row-reverse
44
-    &-col
45
-        flex-direction: column
46
-        &.reverse
47
-            flex-direction: column-reverse
48
-    &-grow
49
-        flex-grow: 1
50
-
51
-/* Borders */
52
-.b
53
-    &-none
54
-        border: none
55
-    &-solid
56
-        border: 1px solid $dark
57
-    &-dot
58
-        border: 1px dotted $dark
59
-    &-solid, &-dot
60
-        &.rounded
61
-            border-radius: $ms-0
62
-        &.invert
63
-            border-color: $light
64
-
65
-/* Backgrounds */
66
-.bg
67
-    &-none
68
-        background-color: none
69
-    &-primary
70
-        background-color: $primary
71
-    &-dark
72
-        background-color: $dark
73
-    &-light
74
-        background-color: $light
75
-    &-cover
76
-        background-size: cover
77
-    &-contain
78
-        background-size: contain
79
-    &-repeat
80
-        background-repeat: repeat
81
-
82
-/* Colors */
83
-.primary
84
-    color: $primary
85
-.dark
86
-    color: $dark
87
-.light
88
-    color: $light
89
-
90
-/* Padding */
91
-.p
92
-    &-none
93
-        padding: none
94
-    &-0
95
-        padding: $ms-0
96
-    &-1
97
-        padding: $ms-1
98
-    &-2
99
-        padding: $ms-2
100
-    &h
101
-        &-0
102
-            padding: 0 $ms-0
103
-        &-1
104
-            padding: 0 $ms-1
105
-        &-2
106
-            padding: 0 $ms-2
107
-    &v
108
-        &-0
109
-            padding: $ms-0 0
110
-        &-1
111
-            padding: $ms-1 0
112
-        &-2
113
-            padding: $ms-2 0
114
-    &t
115
-        &-0
116
-            padding-top: $ms-0
117
-        &-1
118
-            padding-top: $ms-1
119
-        &-2
120
-            padding-top: $ms-2
121
-    &b
122
-        &-0
123
-            padding-bottom: $ms-0
124
-        &-1
125
-            padding-bottom: $ms-1
126
-        &-2
127
-            padding-bottom: $ms-2
128
-    &l
129
-        &-0
130
-            padding-left: $ms-0
131
-        &-1
132
-            padding-left: $ms-1
133
-        &-2
134
-            padding-left: $ms-2
135
-    &r
136
-        &-0
137
-            padding-right: $ms-0
138
-        &-1
139
-            padding-right: $ms-1
140
-        &-2
141
-            padding-right: $ms-2
142
-
143
-/* Margin */
144
-.m
145
-    &-none
146
-        margin: none
147
-    &-0
148
-        margin: $ms-0
149
-    &-1
150
-        margin: $ms-1
151
-    &-2
152
-        margin: $ms-2
153
-    &h
154
-        &-0
155
-            margin: 0 $ms-0
156
-        &-1
157
-            margin: 0 $ms-1
158
-        &-2
159
-            margin: 0 $ms-2
160
-    &v
161
-        &-0
162
-            margin: $ms-0 0
163
-        &-1
164
-            margin: $ms-1 0
165
-        &-2
166
-            margin: $ms-2 0
167
-    &t
168
-        &-0
169
-            margin-top: $ms-0
170
-        &-1
171
-            margin-top: $ms-1
172
-        &-2
173
-            margin-top: $ms-2
174
-    &b
175
-        &-0
176
-            margin-bottom: $ms-0
177
-        &-1
178
-            margin-bottom: $ms-1
179
-        &-2
180
-            margin-bottom: $ms-2
181
-    &l
182
-        &-0
183
-            margin-left: $ms-0
184
-        &-1
185
-            margin-left: $ms-1
186
-        &-2
187
-            margin-left: $ms-2
188
-    &r
189
-        &-0
190
-            margin-right: $ms-0
191
-        &-1
192
-            margin-right: $ms-1
193
-        &-2
194
-            margin-right: $ms-2
195
-
196
-.z
197
-    &-bottom
198
-        position: relative
199
-        z-index: -1
200
-    &-10
201
-        position: relative
202
-        z-index: 10
203
-    &-20
204
-        position: relative
205
-        z-index: 20
206
-    &-30
207
-        position: relative
208
-        z-index: 30
209
-    &-40
210
-        position: relative
211
-        z-index: 40
212
-    &-50
213
-        position: relative
214
-        z-index: 50
215
-    &-top
216
-        position: relative
217
-        z-index: 10001

+ 0
- 13
frontend/src/sss/partials/_ratios.sss Просмотреть файл

@@ -1,13 +0,0 @@
1
-$minor-second: 1.067
2
-$major-second: 1.125
3
-$minor-third: 1.2
4
-$major-third: 1.25
5
-$perfect-fourth: 1.333
6
-$augmented-fourth: 1.414
7
-$perfect-fifth: 1.5
8
-$minor-sixth: 1.6
9
-$golden: 1.618
10
-$major-sixth: 1.667
11
-$minor-seventh: 1.778
12
-$major-seventh: 1.875
13
-$octave: 2

+ 0
- 40
frontend/src/sss/partials/_reset.sss Просмотреть файл

@@ -1,40 +0,0 @@
1
-@import '../_variables.sss'
2
-@import '../theme.sss'
3
-
4
-*
5
-    margin: 0
6
-    padding: 0
7
-    box-sizing: border-box
8
-    &:before, &:after
9
-        background-repeat: no-repeat
10
-        box-sizing: inherit
11
-    $:focus
12
-        outline: none !important
13
-
14
-::before, ::after
15
-    text-decoration: inherit
16
-    vertical-align: inherit
17
-
18
-html
19
-    cursor: default
20
-    font-family: system-ui
21
-    line-height: $ms-0
22
-    tab-size: 4
23
-
24
-body
25
-    margin: 0
26
-    font-size: $ms-1
27
-    font-family: $sans
28
-
29
-nav
30
-    ol, ul
31
-        list-style: none
32
-
33
-// Good for SPAs
34
-html, body
35
-    height: 100%
36
-
37
-button, input, select, textarea
38
-    font-family: inherit
39
-    font-size: inherit
40
-    line-height: inherit

+ 0
- 43
frontend/src/sss/partials/_typography.sss Просмотреть файл

@@ -1,43 +0,0 @@
1
-@import '../_variables.sss'
2
-@import '../theme.sss'
3
-
4
-h1
5
-    font-size: $ms-5
6
-    line-height: $ms-5
7
-h2
8
-    font-size: $ms-3
9
-    line-height: $ms-3
10
-h3
11
-    font-size: $ms-2
12
-    line-height: $ms-2
13
-h4
14
-    font-size: $ms-1
15
-    line-height: $ms-2
16
-p
17
-    font-size: $ms-1
18
-    line-height: $ms-2
19
-
20
-.t
21
-    &-center
22
-        width: 100%
23
-        text-align: center
24
-    &-right
25
-        width: 100%
26
-        text-align: right
27
-    &-left
28
-        width: 100%
29
-        text-align: left
30
-    &-up
31
-        text-transform: uppercase
32
-    &-cap
33
-        text-transform: capitalize
34
-    &-sans
35
-        font-family: $sans
36
-    &-serif
37
-        font-family: $serif
38
-    &-mono
39
-        font-family: $mono
40
-
41
-a
42
-    &:hover
43
-        cursor: pointer

+ 0
- 16
frontend/src/sss/theme.sss Просмотреть файл

@@ -1,16 +0,0 @@
1
-@import './_variables.sss'
2
-
3
-/**
4
- * Colors
5
- */
6
-$hue: 50
7
-$bg: calc($hue * $cs-5)
8
-$bright: 70%
9
-$opacity: 1
10
-
11
-$primary: hsla($hue, 80%, calc($bright * $cs-5), $opacity)
12
-$secondary: hsla($bg, 20%, calc($bright * $cs-0), $opacity)
13
-$hilite: hsla($hue, 80%, calc($bright * $cs-0), $opacity)
14
-
15
-$light: hsla(100, 100%, calc($bright * $cs-0), $opacity)
16
-$dark: hsla(001, 0%, 5%, $opacity)

+ 8
- 20
frontend/src/views/HomeView.vue Просмотреть файл

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2
-main.view--home.f-col.start.w-full
2
+main.view--home
3 3
     header
4 4
         h2 home - profile: {{ pid }}
5
-
5
+        
6 6
     article(v-if="cards.length && !loading")
7 7
         ProfileCardList(:profiles="cards" :pid="pid" @reload="getCards")
8 8
 
@@ -20,10 +20,10 @@ import { mixins } from '../utils'
20 20
 
21 21
 /** Callback used to format incoming into card */
22 22
 const convertToCard = profile => {
23
-    if(profile.type !== 'profile') {
23
+    if (profile.type !== 'profile') {
24 24
         console.error(`Cannot convert ${profile} to Card. Invalid entity.`)
25 25
     }
26
-    if(!profile.isValid()) {
26
+    if (!profile.isValid()) {
27 27
         console.warn(`Profile ${profile.profile_id} is not a valid profile.`)
28 28
     }
29 29
     return new Card({
@@ -36,7 +36,7 @@ const convertToCard = profile => {
36 36
 export default {
37 37
     name: 'HomeView',
38 38
     components: { ProfileCardList },
39
-    mixins: [ mixins.pidMixin, mixins.cardMixin ],
39
+    mixins: [mixins.pidMixin, mixins.cardMixin],
40 40
     methods: {
41 41
         /** Gets called from cardMixin */
42 42
         async getCards() {
@@ -44,23 +44,11 @@ export default {
44 44
             try {
45 45
                 const queueList = await fetchQueueByProfileId(this.pid)
46 46
                 this.cards = this._reformat(queueList, convertToCard)
47
-            } catch (err) { console.error(err) }
47
+            } catch (err) {
48
+                console.error(err)
49
+            }
48 50
             this.loading = false
49 51
         },
50 52
     },
51 53
 }
52 54
 </script>
53
-
54
-<style lang="postcss">
55
-main
56
-    position: relative
57
-    height: 100%
58
-    > article
59
-        height: 100%
60
-        width: 100%
61
-        flex-direction: column
62
-
63
-    input, button
64
-        position: relative
65
-        z-index: 1000
66
-</style>

+ 5
- 9
frontend/src/views/LoginView.vue Просмотреть файл

@@ -18,24 +18,24 @@ import { currentProfile } from '../services'
18 18
 export default {
19 19
     data: () => ({
20 20
         form: {
21
-            profileId: null
21
+            profileId: null,
22 22
         },
23 23
     }),
24 24
     methods: {
25 25
         async onSubmit() {
26
-            if(!this.form.profileId) console.error('No profile in form')
27
-            
26
+            if (!this.form.profileId) console.error('No profile in form')
27
+
28 28
             /**
29 29
              * Default to the HomeView and alter as needed (side-effects!)
30 30
              */
31 31
             const toRoute = { name: 'HomeView' }
32
-            
32
+
33 33
             /**
34 34
              * Profile needs a complete survey and
35 35
              * alters the url if it's incomplete
36 36
              */
37 37
             const alreadyLoggedIn = await currentProfile.isLoggedIn
38
-            if(!alreadyLoggedIn) {
38
+            if (!alreadyLoggedIn) {
39 39
                 await currentProfile.login(this.form.profileId)
40 40
             }
41 41
 
@@ -44,7 +44,3 @@ export default {
44 44
     },
45 45
 }
46 46
 </script>
47
-
48
-<style lang="postcss">
49
-
50
-</style>

+ 6
- 10
frontend/src/views/MatchesView.vue Просмотреть файл

@@ -20,10 +20,10 @@ import { mixins } from '../utils'
20 20
 
21 21
 /** Callback used to format incoming into card */
22 22
 const convertToCard = grouping => {
23
-    if(grouping.type !== 'grouping') {
23
+    if (grouping.type !== 'grouping') {
24 24
         console.error(`Cannot convert ${grouping} to Card. Invalid entity.`)
25 25
     }
26
-    if(!grouping.profile.isValid()) {
26
+    if (!grouping.profile.isValid()) {
27 27
         console.warn(`Profile in ${grouping} is not a valid profile.`)
28 28
     }
29 29
     return new Card({
@@ -36,7 +36,7 @@ const convertToCard = grouping => {
36 36
 export default {
37 37
     name: 'MatchView',
38 38
     components: { ProfileCardList },
39
-    mixins: [ mixins.pidMixin, mixins.cardMixin ],
39
+    mixins: [mixins.pidMixin, mixins.cardMixin],
40 40
     methods: {
41 41
         /** Gets called from cardMixin */
42 42
         async getCards() {
@@ -44,15 +44,11 @@ export default {
44 44
             try {
45 45
                 const matchList = await fetchMembershipsByProfileId(this.pid)
46 46
                 this.cards = this._reformat(matchList, convertToCard)
47
-            } catch (err) { console.error(err) }
47
+            } catch (err) {
48
+                console.error(err)
49
+            }
48 50
             this.loading = false
49 51
         },
50 52
     },
51 53
 }
52 54
 </script>
53
-
54
-<style lang="postcss">
55
-.row
56
-    display: flex
57
-    flex-direction: row
58
-</style>

+ 0
- 2
frontend/src/views/ProfileView.vue Просмотреть файл

@@ -60,5 +60,3 @@ export default {
60 60
     },
61 61
 }
62 62
 </script>
63
-
64
-<style lang="postcss"></style>

+ 64
- 99
frontend/src/views/SurveyView.vue Просмотреть файл

@@ -61,14 +61,21 @@ main.view--survey.f-col.start.w-full
61 61
 import { surveyFactory, randomSurveyResponses } from '@/utils'
62 62
 import { allSteps, aspectResponses, possible } from '@/utils/lang'
63 63
 
64
-import { currentProfile, createProfileForUserId, fetchProfileByProfileId, scoreSurveyByProfileId, signupUser } from '@/services'
64
+import {
65
+    currentProfile,
66
+    createProfileForUserId,
67
+    fetchProfileByProfileId,
68
+    scoreSurveyByProfileId,
69
+    signupUser,
70
+} from '@/services'
65 71
 
66 72
 import { maxDistanceKey } from '../../../backend/db/data-generator/config.json'
67 73
 
68 74
 export default {
69 75
     props: {
70 76
         pid: {
71
-            type: Number,
77
+            type: String,
78
+            default: () => '1',
72 79
         },
73 80
     },
74 81
     data() {
@@ -86,7 +93,7 @@ export default {
86 93
                 honesty: 0,
87 94
                 respect: 0,
88 95
             },
89
-            aspectResponses: Object.values(aspectResponses.usa)
96
+            aspectResponses: Object.values(aspectResponses.usa),
90 97
         }
91 98
     },
92 99
     computed: {
@@ -116,7 +123,12 @@ export default {
116 123
             toGen.forEach(async () => {
117 124
                 const randRes = randomSurveyResponses(this.bypassCount)
118 125
                 randRes.forEach((tr, i) => {
119
-                    this.storeResponseLike(i, tr.idOrPrompt, tr.idOrPrompt, tr.val)
126
+                    this.storeResponseLike(
127
+                        i,
128
+                        tr.idOrPrompt,
129
+                        tr.idOrPrompt,
130
+                        tr.val,
131
+                    )
120 132
                 })
121 133
                 this.bypassCount++
122 134
                 await this.onSave()
@@ -128,14 +140,14 @@ export default {
128 140
             // Also update the form model state for now
129 141
             // We probably can refactor this out
130 142
             this.profile[prompt] = val
131
-            
143
+
132 144
             /**
133 145
              * If NO response id is present, that means the answer
134 146
              * is required and associated with a User and NOT a Profile
135 147
              **/
136 148
             this.responseLikes[`step-${step}`] = {
137 149
                 idOrPrompt: id ? id : prompt,
138
-                val: val.toString()
150
+                val: val.toString(),
139 151
             }
140 152
         },
141 153
         _formatIntoResponses(survey) {
@@ -147,7 +159,7 @@ export default {
147 159
         },
148 160
         /**
149 161
          * Survey responses have User information
150
-         * mixed in with scoring information so we 
162
+         * mixed in with scoring information so we
151 163
          * need to separate them
152 164
          * @param {array} responseLikes answered by the survey
153 165
          */
@@ -155,7 +167,10 @@ export default {
155 167
             let survey = []
156 168
             const user = {}
157 169
             responseLikes.forEach(resLike => {
158
-                if(resLike.idOrPrompt && Number.isFinite(parseInt(resLike.idOrPrompt))) {
170
+                if (
171
+                    resLike.idOrPrompt &&
172
+                    Number.isFinite(parseInt(resLike.idOrPrompt))
173
+                ) {
159 174
                     survey.push(resLike)
160 175
                 } else {
161 176
                     user[resLike.idOrPrompt] = resLike.val
@@ -166,24 +181,34 @@ export default {
166 181
         async _createUserProfileRel(user, survey) {
167 182
             /** A User is required before creating a profile */
168 183
             const createdUser = await signupUser(user)
169
-            if(!createdUser) return
184
+            if (!createdUser) return
170 185
 
171
-            const userProfileRel = await createProfileForUserId(createdUser.user_id, survey)
172
-            if(!userProfileRel) return 
186
+            const userProfileRel = await createProfileForUserId(
187
+                createdUser.user_id,
188
+                survey,
189
+            )
190
+            if (!userProfileRel) return
173 191
 
174 192
             return userProfileRel
175 193
         },
176 194
         async _getProfileWithScore(createdProfileId, maxDistance) {
177 195
             /** A Profile is associated with n:1 user and referenced by profile id */
178
-            const fetchedProfile = await fetchProfileByProfileId(createdProfileId)
179
-            if(!fetchedProfile) {
180
-                console.error(`Could not fetch Profile ${createdProfileId}. Please check that a User and Profile were created.`)
196
+            const fetchedProfile = await fetchProfileByProfileId(
197
+                createdProfileId,
198
+            )
199
+            if (!fetchedProfile) {
200
+                console.error(
201
+                    `Could not fetch Profile ${createdProfileId}. Please check that a User and Profile were created.`,
202
+                )
181 203
                 return
182 204
             }
183 205
 
184 206
             /** Use profile answers to compare against other profile answers */
185
-            const scored = await scoreSurveyByProfileId(createdProfileId, maxDistance)
186
-            if(!scored) {
207
+            const scored = await scoreSurveyByProfileId(
208
+                createdProfileId,
209
+                maxDistance,
210
+            )
211
+            if (!scored) {
187 212
                 console.error(`Could not score Profile ${createdProfileId}.`)
188 213
                 return
189 214
             }
@@ -191,34 +216,46 @@ export default {
191 216
         },
192 217
         async _setLoginForProfile(profile) {
193 218
             const currentId = currentProfile.login(profile.profile_id)
194
-            if(currentId && profile.responses.length) {
219
+            if (currentId && profile.responses.length) {
195 220
                 // Stores responses without fetching again
196 221
                 currentProfile.setResponses(profile.responses)
197 222
             }
198
-            if(!currentProfile.isComplete) {
199
-                console.error(`Profile ${currentProfile.id} is incomplete. Please make sure all survey questions have been answered.`)
223
+            if (!currentProfile.isComplete) {
224
+                console.error(
225
+                    `Profile ${currentProfile.id} is incomplete. Please make sure all survey questions have been answered.`,
226
+                )
200 227
                 return
201 228
             }
202 229
         },
203 230
         async onSave() {
204
-            const [ user, survey] = this._separateUserInfoFromResponses(Object.values(this.responseLikes))
205
-            const maxDistanceRes = survey.find(res => res.response_key_id == maxDistanceKey)
231
+            const [user, survey] = this._separateUserInfoFromResponses(
232
+                Object.values(this.responseLikes),
233
+            )
234
+            const maxDistanceRes = survey.find(
235
+                res => res.response_key_id == maxDistanceKey,
236
+            )
206 237
             /**
207 238
              * Creating a profile only returns the created
208 239
              * user id and profile id
209 240
              **/
210
-            const userProfileRel = await this._createUserProfileRel(user, survey)
241
+            const userProfileRel = await this._createUserProfileRel(
242
+                user,
243
+                survey,
244
+            )
211 245
             const createdProfileId = userProfileRel.profile_id
212 246
 
213 247
             /** A Profile is associated with n:1 user and referenced by profile id */
214
-            const fetchedProfile = await this._getProfileWithScore(createdProfileId, maxDistanceRes.val)
215
-            
216
-            /** 
248
+            const fetchedProfile = await this._getProfileWithScore(
249
+                createdProfileId,
250
+                maxDistanceRes.val,
251
+            )
252
+
253
+            /**
217 254
              * Login only after there is a user and
218 255
              * that user has a profile and all responses
219
-            */
256
+             */
220 257
             this._setLoginForProfile(fetchedProfile)
221
-            
258
+
222 259
             this.$router.push({ name: 'HomeView' })
223 260
         },
224 261
         back(prompt) {
@@ -228,75 +265,3 @@ export default {
228 265
     },
229 266
 }
230 267
 </script>
231
-
232
-<style lang="postcss">
233
-.slide-up
234
-    &-leave, &-enter
235
-        &-active
236
-            transition-delay: 500ms
237
-            transition-property: opacity, background-color, font-size, transform, color
238
-            transition-timing-function: cubic-bezier(1, 0.3, 0.5, 1)
239
-            transition-duration: 300ms
240
-    &-enter-from, &-leave-to
241
-        opacity: 0
242
-
243
-.fade
244
-    animation: fadeIn 1200ms ease-in
245
-
246
-@keyframes fadeIn
247
-    0%
248
-        opacity: 0
249
-    50%
250
-        opacity: 0.5
251
-    100%
252
-        opacity:1
253
-
254
-h1
255
-    color: white
256
-
257
-main
258
-    padding: 5vh
259
-    display: flex
260
-    header
261
-        p
262
-            color: #666
263
-            line-height: 1.3em
264
-        color: #ccc
265
-        font-style: italic
266
-        text-align: left
267
-
268
-article
269
-    height: 100%
270
-    width: 100%
271
-    flex-direction: column
272
-    ul
273
-        height: 100%
274
-        list-style: none
275
-        button
276
-            padding: 1em
277
-        p
278
-            padding: 1em
279
-            color: white
280
-.form
281
-    border: 1px solid #fff
282
-    width: 100%
283
-    header, footer, ul
284
-        padding: 1vh
285
-    ul
286
-        display: flex
287
-        width: 100%
288
-        > li
289
-            flex-direction: column
290
-            border: 0px solid yellow
291
-            width: 100%
292
-            padding: 0
293
-            text-align: left
294
-            label
295
-                margin-right: 1vh
296
-            > h3
297
-                text-transform: capitalize
298
-                padding: 1vh 0
299
-            > div > span
300
-                display: block
301
-                text-align: center
302
-</style>

+ 42
- 0
frontend/src/wave.js Просмотреть файл

@@ -0,0 +1,42 @@
1
+/**
2
+ * We have to destructure the import for tree-shaking to work
3
+ */
4
+import {
5
+    WAlert,
6
+    WApp,
7
+    WBadge,
8
+    WButton,
9
+    WCard,
10
+    WCheckbox,
11
+    WDrawer,
12
+    WFlex,
13
+    WIcon,
14
+    WImage,
15
+    WInput,
16
+    WMenu,
17
+    WProgress,
18
+    WOverlay,
19
+    WSlider,
20
+    WSpinner,
21
+    WSteps,
22
+} from '../node_modules/wave-ui/src/wave-ui/components'
23
+
24
+export default {
25
+    WAlert,
26
+    WApp,
27
+    WBadge,
28
+    WButton,
29
+    WCard,
30
+    WCheckbox,
31
+    WDrawer,
32
+    WFlex,
33
+    WIcon,
34
+    WImage,
35
+    WInput,
36
+    WMenu,
37
+    WProgress,
38
+    WOverlay,
39
+    WSlider,
40
+    WSpinner,
41
+    WSteps,
42
+}

+ 10
- 2
frontend/vite.config.js Просмотреть файл

@@ -1,9 +1,17 @@
1 1
 import { defineConfig } from 'vite'
2 2
 import vue from '@vitejs/plugin-vue'
3
-import ViteFS from 'vite-fs'
3
+
4 4
 // https://vitejs.dev/config/
5 5
 export default defineConfig({
6
-    plugins: [vue(), ViteFS()],
6
+    css: {
7
+        preprocessorOptions: {
8
+            scss: {
9
+                additionalData:
10
+                    '$use-layout-classes: false;@import "/src/../node_modules/wave-ui/src/wave-ui/scss/_variables.scss";',
11
+            },
12
+        },
13
+    },
14
+    plugins: [vue()],
7 15
     resolve: {
8 16
         alias: {
9 17
             '@': require('path').resolve(__dirname, 'src'),

Загрузка…
Отмена
Сохранить