ソースを参照

:sparkles: adding naive-ui | adding vue-router | integrating some d changes

tags/0.0.1
j 4年前
コミット
775482b06a

+ 3799
- 79
frontend/package-lock.json
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 3
- 1
frontend/package.json ファイルの表示

@@ -10,12 +10,14 @@
10 10
     "events": "^3.3.0",
11 11
     "joi": "^17.4.0",
12 12
     "process": "^0.11.10",
13
-    "vue": "^3.0.5"
13
+    "vue": "^3.0.5",
14
+    "vue-router": "^4.0.12"
14 15
   },
15 16
   "devDependencies": {
16 17
     "@vitejs/plugin-vue": "^1.2.2",
17 18
     "@vue/compiler-sfc": "^3.0.5",
18 19
     "autoprefixer": "^10.2.5",
20
+    "naive-ui": "^2.20.3",
19 21
     "postcss": "^8.2.13",
20 22
     "postcss-calc": "^8.0.0",
21 23
     "postcss-import": "^14.0.1",

+ 5
- 6
frontend/src/App.vue ファイルの表示

@@ -1,9 +1,7 @@
1 1
 <template lang="pug">
2
-.cards.f-row
3
-    card(v-for="card in cards" :card="card" @on-remove="remove")
4
-.form.f-row(v-if="completedForm")
5
-    siimee-form(:form="completedForm")
6
-hello-world(msg="Hello Vue 3 + Vite")
2
+navbar
3
+main
4
+    router-view
7 5
 </template>
8 6
 
9 7
 <script>
@@ -22,9 +20,10 @@ import {
22 20
 import helloWorld from '@/components/HelloWorld.vue'
23 21
 import card from '@/components/card.vue'
24 22
 import form from '@/components/form.vue'
23
+import navbar from '@/components/navbar.vue'
25 24
 
26 25
 export default {
27
-    components: { card, 'siimee-form': form, helloWorld },
26
+    components: { card, 'siimee-form': form, helloWorld, navbar },
28 27
     setup() {
29 28
 
30 29
         const cards = ref([

+ 23
- 0
frontend/src/components/icon.vue ファイルの表示

@@ -0,0 +1,23 @@
1
+<template>
2
+  <div class="icon"></div>
3
+</template>
4
+
5
+<script>
6
+export default {
7
+  
8
+}
9
+</script>
10
+
11
+<style scoped>
12
+.icon {
13
+  display: block;
14
+  border-radius: 50%;
15
+  width: 48px;
16
+  height: 48px;
17
+  background-image: url('https://i.imgur.com/WFqSBgc.png');
18
+  background-color: rgba(20,20,20,0.3);
19
+  background-position: 50% 0;
20
+  background-size: auto 125%;
21
+  /* margin: 12px auto; */
22
+}
23
+</style>

+ 25
- 0
frontend/src/components/navbar.vue ファイルの表示

@@ -0,0 +1,25 @@
1
+<template lang="pug">
2
+nav(id="nav")
3
+  router-link(to="/") Browse
4
+  router-link(to="/match") Match
5
+  router-link(to="/account") Account
6
+</template>
7
+
8
+<script>
9
+export default {
10
+  
11
+}
12
+</script>
13
+
14
+<style lang="postcss">
15
+nav
16
+  display: flex
17
+  justify-content: space-evenly
18
+  background-color: #000
19
+  color: #fff
20
+  padding: 40px 0
21
+  margin: 0
22
+  position: absolute
23
+  bottom: 0
24
+  width: 100%
25
+</style>

+ 3
- 2
frontend/src/main.js ファイルの表示

@@ -1,4 +1,5 @@
1 1
 import { createApp } from 'vue'
2 2
 import App from './App.vue'
3
-  
4
-createApp(App).mount('#app')
3
+import router from './router'
4
+
5
+createApp(App).use(router).mount('#app')

+ 76
- 0
frontend/src/router/index.js ファイルの表示

@@ -0,0 +1,76 @@
1
+import { createRouter, createWebHistory } from 'vue-router'
2
+import home from '../views/home.vue'
3
+
4
+const routes = [
5
+    {
6
+        path: '/',
7
+        name: 'Home',
8
+        component: home,
9
+    },
10
+    {
11
+        path: '/account',
12
+        name: 'Account',
13
+        // route level code-splitting
14
+        // this generates a separate chunk (about.[hash].js) for this route
15
+        // which is lazy-loaded when the route is visited.
16
+        component: () =>
17
+            import(/* webpackChunkName: "about" */ '../views/account.vue'),
18
+    },
19
+    {
20
+        path: '/editprofile',
21
+        name: 'EditProfile',
22
+        component: () =>
23
+            import(
24
+                /* webpackChunkName: "AcctSettings" */ '../views/EditProfile.vue'
25
+            ),
26
+    },
27
+    {
28
+        path: '/EditSurvey',
29
+        name: 'EditSurvey',
30
+        component: () =>
31
+            import(
32
+                /* webpackChunkName: "AcctSettings" */ '../views/EditSurvey.vue'
33
+            ),
34
+    },
35
+    {
36
+        path: '/acctsettings',
37
+        name: 'AcctSettings',
38
+        component: () =>
39
+            import(
40
+                /* webpackChunkName: "AcctSettings" */ '../views/AcctSettings.vue'
41
+            ),
42
+    },
43
+    {
44
+        path: '/searchsettings',
45
+        name: 'SearchSettings',
46
+        component: () =>
47
+            import(
48
+                /* webpackChunkName: "AcctSettings" */ '../views/SearchSettings.vue'
49
+            ),
50
+    },
51
+    {
52
+        path: '/match',
53
+        name: 'Match',
54
+        // route level code-splitting
55
+        // this generates a separate chunk (about.[hash].js) for this route
56
+        // which is lazy-loaded when the route is visited.
57
+        component: () =>
58
+            import(/* webpackChunkName: "about" */ '../views/Match.vue'),
59
+    },
60
+    {
61
+        path: '/chat',
62
+        name: 'Chat',
63
+        // route level code-splitting
64
+        // this generates a separate chunk (about.[hash].js) for this route
65
+        // which is lazy-loaded when the route is visited.
66
+        component: () =>
67
+            import(/* webpackChunkName: "about" */ '../views/Chat.vue'),
68
+    },
69
+]
70
+
71
+const router = createRouter({
72
+    history: createWebHistory(),
73
+    routes,
74
+})
75
+
76
+export default router

+ 5
- 0
frontend/src/views/About.vue ファイルの表示

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

+ 5
- 0
frontend/src/views/AcctSettings.vue ファイルの表示

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

+ 111
- 0
frontend/src/views/Chat.vue ファイルの表示

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

+ 6
- 0
frontend/src/views/EditProfile.vue ファイルの表示

@@ -0,0 +1,6 @@
1
+<template>
2
+  <div class="EditProfile">
3
+    <h1>Edit Profile</h1>
4
+    <p>Edit Photos</p>
5
+  </div>
6
+</template>

+ 5
- 0
frontend/src/views/EditSurvey.vue ファイルの表示

@@ -0,0 +1,5 @@
1
+<template>
2
+  <div class="EditSurvey">
3
+    <h1>Edit Survey</h1>
4
+  </div>
5
+</template>

+ 124
- 0
frontend/src/views/Match.vue ファイルの表示

@@ -0,0 +1,124 @@
1
+<template>
2
+  <div class="match">
3
+    <div class="matches">
4
+      <h1>Matches</h1>
5
+      <!-- <n-button>naive-ui</n-button> -->
6
+      <div class="row">
7
+        <card />
8
+        <card />
9
+        <card />
10
+        <!-- <card /> -->
11
+      </div>
12
+    </div>
13
+
14
+    <div class="messages">
15
+      <h2>Messages</h2>
16
+      <div class="matched active">
17
+        <div class="icon">
18
+          <Icon />
19
+        </div>
20
+        <div class="messagecontent">
21
+            <h3>NSE Tropical</h3>
22
+            <span>
23
+              Recently active, match now!
24
+            </span>
25
+        </div>
26
+            <!-- <template #cover>
27
+            
28
+            </template> -->
29
+
30
+      </div>
31
+
32
+      <div class="matched">
33
+        <div class="icon">
34
+          <Icon />
35
+        </div>
36
+        <div class="messagecontent">
37
+            <h3>Golden Communications</h3>
38
+            Click to match now!
39
+        </div>
40
+      </div>
41
+
42
+      <div class="matched">
43
+        <div class="icon">
44
+          <Icon />
45
+        </div>
46
+        <div class="messagecontent">
47
+            <h3>Mojo Solutions</h3>
48
+            Click to match now!
49
+        </div>
50
+      </div>
51
+    </div>
52
+
53
+  </div>
54
+
55
+
56
+</template>
57
+
58
+<script>
59
+  import icon from '@/components/icon'
60
+  import card from '@/components/card'
61
+  import { defineComponent } from 'vue'
62
+  import { NButton } from 'naive-ui'
63
+
64
+  export default defineComponent({
65
+    components: {
66
+      NButton,
67
+      card,
68
+      icon
69
+    }
70
+  })
71
+</script>
72
+
73
+<style scoped>
74
+h3 {
75
+  margin: 0;
76
+}
77
+  .match {
78
+    width: 100%;
79
+    display: flex;
80
+    flex-direction: column;
81
+    padding: 20px;
82
+    text-align: left;
83
+  }
84
+
85
+  .row {
86
+    display: flex;
87
+    flex-direction: row;
88
+    /* width: 100vw; */
89
+    overflow:scroll;
90
+  }
91
+
92
+  .messagecontent {
93
+    width: 100%;
94
+    display: block;
95
+    text-align: left;
96
+    /* margin-bottom: 10px; */
97
+    background-color: transparent;
98
+    border: 0;
99
+    padding: 12px;
100
+    
101
+  }
102
+  .n-card__content {
103
+    padding-top: 0;
104
+  }
105
+
106
+  .matched {
107
+    display: flex;
108
+    flex-direction: row;
109
+    background-color: rgba(0,0,0,0.0);
110
+    margin-bottom: 12px;
111
+    border-bottom: 1px solid rgba(150,150,150,0.25);
112
+  }
113
+
114
+  .icon {
115
+    /* display: inline-block; */
116
+    padding: 8px 12px;
117
+    margin: -1px;
118
+    /* flex-grow: 0; */
119
+    border-bottom: 1px solid rgba(250,250,250,0.95);
120
+  }
121
+  .active {
122
+    /* background-color: rgba(250,50,50,0.3); */
123
+  }
124
+</style>

+ 8
- 0
frontend/src/views/SearchSettings.vue ファイルの表示

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

+ 89
- 0
frontend/src/views/account.vue ファイルの表示

@@ -0,0 +1,89 @@
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
+
89
+</style>

+ 19
- 0
frontend/src/views/home.vue ファイルの表示

@@ -0,0 +1,19 @@
1
+<template lang="pug">
2
+.home
3
+  n-button naive test
4
+  img(alt="Vue logo" src="../assets/logo.png")
5
+  hello-world
6
+</template>
7
+
8
+<script>
9
+// @ is an alias to /src
10
+import HelloWorld from '@/components/HelloWorld.vue'
11
+  import { NButton } from 'naive-ui'
12
+export default {
13
+  name: 'Home',
14
+  components: {
15
+    HelloWorld,
16
+    NButton
17
+  }
18
+}
19
+</script>

読み込み中…
キャンセル
保存