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

:recycle: readding card and header components

tags/0.0.1
J 4 лет назад
Родитель
Сommit
71fb8fd0e8
3 измененных файлов: 81 добавлений и 76 удалений
  1. 60
    62
      frontend/src/components/TinderCard.vue
  2. 16
    12
      frontend/src/shared/MainHeader.vue
  3. 5
    2
      frontend/src/views/home.vue

+ 60
- 62
frontend/src/components/TinderCard.vue Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="tinder__card">
3 3
     <div class="tinder__card__container">
4
-      <vue-swing
4
+      <div
5 5
         v-for="user in users"
6 6
         :key="user.id"
7 7
         @throwout="swipped(user)"
@@ -16,7 +16,7 @@
16 16
             <h3>{{ user.name }}</h3>
17 17
           </div>
18 18
         </div>
19
-      </vue-swing>
19
+      </div>
20 20
 
21 21
       <div class="swipe__icons">
22 22
         // Icons
@@ -50,7 +50,7 @@ export default {
50 50
   data() {
51 51
     return {
52 52
       config: {
53
-        allowedDirections: [VueSwing.Direction.LEFT, VueSwing.Direction.RIGHT],
53
+        // allowedDirections: [VueSwing.Direction.LEFT, VueSwing.Direction.RIGHT],
54 54
         minThrowOutDistance: 250,
55 55
         maxThrowOutDistance: 300,
56 56
       },
@@ -89,69 +89,67 @@ export default {
89 89
   },
90 90
 };
91 91
 </script>
92
-<style scoped>
93
-.card {
94
-  position: relative;
95
-  background-color: #fff;
96
-  width: 250px;
97
-  padding: 20px;
98
-  max-width: 85vw;
99
-  height: 50vh;
100
-  border-radius: 9px;
101
-  background-size: cover;
102
-  background-position: center;
103
-}
104
-.tinder__card__container {
105
-  display: flex;
106
-  justify-content: center;
107
-  margin-top: 10vh;
108
-}
109
-.swipe {
110
-  position: absolute;
111
-}
112
-.card__content {
113
-  width: 100%;
114
-  height: 100%;
115
-}
116
-.card h3 {
117
-  position: absolute;
118
-  bottom: 0;
119
-  margin: 10px;
120
-  color: #fff;
92
+<style lang="postcss">
93
+.card
94
+  position: relative
95
+  background-color: #fff
96
+  width: 250px
97
+  padding: 20px
98
+  max-width: 85vw
99
+  height: 50vh
100
+  border-radius: 9px
101
+  background-size: cover
102
+  background-position: center
103
+
104
+.tinder__card__container
105
+  display: flex
106
+  justify-content: center
107
+  margin-top: 10vh
108
+
109
+.swipe
110
+  position: absolute
111
+
112
+.card__content
113
+  width: 100%
114
+  height: 100%
115
+
116
+.card h3
117
+  position: absolute
118
+  bottom: 0
119
+  margin: 10px
120
+  color: #fff
121 121
   background: linear-gradient(
122 122
     109deg,
123 123
     rgba(0, 0, 0, 0.5) 0%,
124 124
     rgba(0, 0, 0, 0) 100%
125
-  );
126
-  border-radius: 9px;
127
-  padding: 5px;
128
-}
129
-.swipe__icons__container {
130
-  display: flex;
131
-  justify-content: center;
132
-}
133
-.swipe__icons {
134
-  position: fixed;
135
-  bottom: 5vh;
136
-  display: flex;
137
-  width: 250px;
138
-  justify-content: space-evenly;
139
-}
125
+  )
126
+  border-radius: 9px
127
+  padding: 5px
128
+
129
+.swipe__icons__container
130
+  display: flex
131
+  justify-content: center
132
+
133
+.swipe__icons
134
+  position: fixed
135
+  bottom: 5vh
136
+  display: flex
137
+  width: 250px
138
+  justify-content: space-evenly
139
+
140 140
 .swipe__icon__close:hover,
141 141
 .swipe__icon__star:hover,
142
-.swipe__icon__heart:hover {
143
-  transform: scale(1.06);
144
-  transition: all 0.2s ease-in-out;
145
-}
146
-.swipe__icons .material-design-icon__svg {
147
-  background-color: white;
148
-  box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.2) !important;
149
-  border-radius: 30px;
150
-  padding: 10px;
151
-}
152
-@media only screen and (min-width: 768px) {
153
-  .swipe__icon__power {
154
-    display: none;
155
-  }
156
-}
142
+.swipe__icon__heart:hover
143
+  transform: scale(1.06)
144
+  transition: all 0.2s ease-in-out
145
+
146
+.swipe__icons .material-design-icon__svg
147
+  background-color: white
148
+  box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.2) !important
149
+  border-radius: 30px
150
+  padding: 10px
151
+
152
+@media only screen and (min-width: 768px)
153
+  .swipe__icon__power
154
+    display: none
157 155
 </style>

+ 16
- 12
frontend/src/shared/MainHeader.vue Просмотреть файл

@@ -1,15 +1,15 @@
1 1
 <template>
2 2
   <div id="main-header">
3 3
     <router-link class="header__icon mobile--only" to="/friends">
4
-      <p> friends
4
+      <p>friends</p>
5 5
     </router-link>
6 6
     
7 7
     <router-link class="header__icon" to="/">
8
-      <p> home
8
+      <p>home</p>
9 9
     </router-link>
10 10
 
11 11
     <router-link class="header__icon mobile--only" to="/profile">
12
-      <p> profile
12
+      <p>profile</p>
13 13
     </router-link>
14 14
   </div>
15 15
 </template>
@@ -20,13 +20,17 @@ export default {
20 20
 }
21 21
 </script>
22 22
 
23
-<style scoped>
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
-}
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
32 36
 </style>

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

@@ -2,7 +2,8 @@
2 2
   <div id="home">
3 3
     <div class="content-wrapper">
4 4
       <div class="content">
5
-        <p>cards and header</p>
5
+        <main-header />
6
+        <profile-cards :uid="uid" :users="swipables" />
6 7
       </div>
7 8
     </div>
8 9
     <sidebar />
@@ -10,10 +11,12 @@
10 11
 </template>
11 12
 
12 13
 <script>
14
+import mainHeader from '../shared/MainHeader.vue'
13 15
 import sidebar from '../shared/Sidebar.vue'
16
+import profileCards from '../components/TinderCard.vue'
14 17
 export default {
15 18
   name: "home",
16
-  components: {sidebar},
19
+  components: { mainHeader, profileCards, sidebar },
17 20
   data() {
18 21
     return {
19 22
       swipables: [],

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