Explorar el Código

:art: checking conditional classes for list

tags/0.9.0
J hace 4 años
padre
commit
c26e82b1e7

+ 17
- 9
vue-theme/src/components/card.vue Ver fichero

@@ -6,7 +6,7 @@
6 6
         router-link(v-else-if="!hideType" :to="`/${type}`")
7 7
             p.t-up {{type}}
8 8
 
9
-    article.card--info.f-col(:class="{ 'wide': wide }")
9
+    article.card--info(:class="{ 'wide': wide }")
10 10
         router-link(:to="`/${type}/${content.slug}`")
11 11
             //- set image to thumbnail setting
12 12
             featured-image(:post="content", thumbsize="'standard'")
@@ -43,15 +43,17 @@ export default {
43 43
     padding: $ms--1
44 44
     overflow: hidden
45 45
     text-overflow: clip
46
-    &--info
46
+    &--info 
47
+        display: flex
48
+        flex-direction: column
47 49
         > a
48 50
             line-height: 0
49
-            /* Force crop images */
50
-            .featured-or-hero-image img
51
-                object-fit: cover
52
-                object-position: 0% 30%
53
-                max-height: calc($max-card-img-height / 2)
54
-                overflow-y: clip
51
+        /* Force crop images */
52
+        .featured-or-hero-image img
53
+            object-fit: cover
54
+            object-position: 0% 30%
55
+            max-height: calc($max-card-img-height / 2)
56
+            overflow-y: clip
55 57
     header a
56 58
         font-size: $ms--2
57 59
         text-decoration: none
@@ -89,9 +91,15 @@ export default {
89 91
 @media (min-width: $medium)
90 92
     .card
91 93
         .wide
92
-            display: flex
93 94
             padding: 0
95
+            flex-direction: row
94 96
             grid-gap: $ms-0
95 97
             a
96 98
                 width: 100%
99
+                /* Force crop images */
100
+                .featured-or-hero-image img
101
+                    object-fit: cover
102
+                    object-position: 0% 30%
103
+                    max-height: $max-card-img-height
104
+                    overflow-y: clip
97 105
 </style>

+ 1
- 1
vue-theme/src/pages/index.vue Ver fichero

@@ -83,7 +83,7 @@ export default {
83 83
             await this.$store.dispatch('getAllPages', { sortType: null, params: null })
84 84
         }
85 85
         await this.$store.dispatch('getRandomPosts', ['episode', 'exhibition', 'event', 'artist', 'post'])
86
-    },
86
+        },
87 87
     methods: {
88 88
         firstPostOfType(type) {
89 89
             return Object.values(this[`all${convertTitleCase(type)}s`])[0]

+ 18
- 20
vue-theme/src/pages/list.vue Ver fichero

@@ -14,9 +14,9 @@
14 14
                 v-html="allPages[type].content"
15 15
             )
16 16
 
17
-        ul.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
18
-            li(v-for="(post, i) in posts" :key="post.slug").post
19
-                card(:content="post" :type="type" :wide="type == 'exhibition' && i > 1 || type == 'event' && i > 1 ")
17
+        ul.posts.f-col(v-if="posts && loaded" :class="{ 'is-grid': grid }")
18
+            li(v-for="(post, i) in posts" :key="post.slug").post.w-max
19
+                card(:content="post" :type="type" :wide="isWide")
20 20
         
21 21
         //- Important: Do NOT remove this! Required for intersection observer
22 22
         footer
@@ -73,6 +73,9 @@ export default {
73 73
             if (!this.pType) return
74 74
             return this[`all${this.pType}`]
75 75
         },
76
+        isWide() {
77
+            return this.type == 'exhibition' && i > 1 || this.type == 'event' && i > 1 
78
+        }
76 79
     },
77 80
     methods: {
78 81
         clearAllPosts() {
@@ -227,10 +230,8 @@ export default {
227 230
 @import '../sss/variables.sss'
228 231
 @import '../sss/theme.sss'
229 232
 .page--list
230
-    /* background-color: white */
231 233
     article
232 234
         > header
233
-            /* padding: 1em 0 1em 0 */
234 235
             padding: 1em
235 236
             > h1
236 237
                 margin: 0
@@ -238,24 +239,21 @@ export default {
238 239
                 padding: 0
239 240
                 width: 100%
240 241
         > footer
241
-            background-color: white
242 242
             padding: $ms-0
243 243
         /* posts not grid list */
244
-        ul img
245
-            max-width: 50%
246
-
247
-        .is-grid
248
-            display: flex
249
-            flex-direction: row
250
-            flex-wrap: wrap
251
-            justify-content: space-between
252
-            section
253
-                width: 32.5%
254
-            ul
244
+        .posts
245
+            list-style: none
246
+            grid-gap: $ms-0
247
+            &.is-grid
248
+                flex-direction: row
255 249
                 flex-wrap: wrap
256
-                list-style: none
257
-                img
258
-                    max-width: 100%
250
+                justify-content: space-between
251
+                section
252
+                    width: 32.5%
253
+                ul
254
+                    flex-wrap: wrap
255
+                    img
256
+                        max-width: 100%
259 257
 
260 258
 @media (min-width: $medium)
261 259
     .page--list.f-col

+ 1
- 1
vue-theme/src/sss/variables.sss Ver fichero

@@ -12,7 +12,7 @@ $path: 4px
12 12
 /* Proportion */
13 13
 $base: 0.95em
14 14
 
15
-$max-card-img-height: 260px
15
+$max-card-img-height: 320px
16 16
 $card-line-clamp: 3
17 17
 
18 18
 $ratio: $minor-third

Loading…
Cancelar
Guardar