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

:recycle: address #81 | fix prop pass to youTube thumb | pass standard size feature-image for card | pass max size for hero

tags/0.9.0
j 4 лет назад
Родитель
Сommit
501f6b6142

+ 4
- 4
vue-theme/src/app.vue Просмотреть файл

@@ -15,11 +15,12 @@ import ciaFooter from '@/components/footer'
15 15
 import '@/sss'
16 16
 
17 17
 export default {
18
-    components: { ciaNav, ciaHero, 'cia-footer':ciaFooter }
18
+    components: { ciaNav, ciaHero, 'cia-footer': ciaFooter },
19 19
 }
20 20
 </script>
21 21
 
22 22
 <style lang="postcss">
23
+// prettier-ignore
23 24
 @import './sss/variables.sss'
24 25
 @import './sss/theme.sss'
25 26
 
@@ -90,6 +91,5 @@ html
90 91
                     /* background-color: lightpink */
91 92
                 
92 93
         nav, footer
93
-            &.main
94
-                /* background-color: pink */
95
-</style>
94
+            &.main /* background-color: pink */
95
+</style>

+ 4
- 3
vue-theme/src/components/breadcrumb.vue Просмотреть файл

@@ -14,15 +14,16 @@
14 14
 export default {
15 15
     props: {
16 16
         type: { type: String },
17
-        post: { type: Object }
18
-    }
17
+        post: { type: Object },
18
+    },
19 19
 }
20 20
 </script>
21 21
 
22 22
 <style lang="postcss">
23
+// prettier-ignore
23 24
 @import '../sss/variables.sss'
24 25
 @import '../sss/theme.sss'
25 26
 .breadcrumb
26 27
     h5
27 28
         font-size: $ms--1
28
-</style>
29
+</style>

+ 3
- 4
vue-theme/src/components/card.vue Просмотреть файл

@@ -6,7 +6,7 @@
6 6
     article.card--info(:class="{ 'wide': wide }")
7 7
         router-link(:to="`/${type}/${content.slug}`")
8 8
             //- set image to thumbnail setting
9
-            featured-image(:post="content")
9
+            featured-image(:post="content", thumbsize="'standard'")
10 10
         .f-col.w-max
11 11
             router-link(:to="`/${type}/${content.slug}`")
12 12
                 h1.t-up.t-cntr.t-b {{ content.title }}
@@ -17,11 +17,12 @@
17 17
 import featuredImage from '@/components/featured-image'
18 18
 export default {
19 19
     components: { featuredImage },
20
-    props: ['type', 'content', 'wide', 'hide-type']
20
+    props: ['type', 'content', 'wide', 'hide-type'],
21 21
 }
22 22
 </script>
23 23
 
24 24
 <style lang="postcss">
25
+// prettier-ignore
25 26
 @import '../sss/variables.sss'
26 27
 @import '../sss/theme.sss'
27 28
 .card
@@ -58,6 +59,4 @@ export default {
58 59
             display: flex
59 60
             padding: 0
60 61
             grid-gap: $ms-0
61
-
62
-            
63 62
 </style>

+ 1
- 1
vue-theme/src/components/featured-image.vue Просмотреть файл

@@ -35,7 +35,7 @@ export default {
35 35
     methods: {
36 36
         getThumbnailFromYt(url) {
37 37
             let size = this.thumbsize ? this.thumbsize : 'max'
38
-            return ytThumbnail(url, 'max')
38
+            return ytThumbnail(url, size)
39 39
         },
40 40
     },
41 41
 }

+ 4
- 3
vue-theme/src/components/footer.vue Просмотреть файл

@@ -73,17 +73,18 @@
73 73
 </template>
74 74
 
75 75
 <script>
76
-export default { 
76
+export default {
77 77
     computed: {
78 78
         today() {
79 79
             const today = new Date()
80 80
             return today.getFullYear()
81
-        }
81
+        },
82 82
     },
83 83
 }
84 84
 </script>
85 85
 
86 86
 <style lang="postcss">
87
+// prettier-ignore
87 88
 @import '../sss/variables.sss'
88 89
 @import '../sss/theme.sss'
89 90
 
@@ -190,4 +191,4 @@ export default {
190 191
             > ul
191 192
                 /* background-color: teal */
192 193
                 background-color: $cia_red
193
-</style>
194
+</style>

+ 13
- 8
vue-theme/src/components/gallery.vue Просмотреть файл

@@ -19,19 +19,23 @@
19 19
 export default {
20 20
     props: {
21 21
         activeImageIndex: { type: Number, required: true, default: 0 },
22
-        images: { type: Object, required: true }
22
+        images: { type: Object, required: true },
23 23
     },
24 24
     data() {
25 25
         return {
26
-            selected: 0
26
+            selected: 0,
27 27
         }
28 28
     },
29 29
     methods: {
30 30
         prev() {
31
-            this.selected > 0 ? this.selected-- : this.selected = Object.keys(this.images).length - 1
31
+            this.selected > 0
32
+                ? this.selected--
33
+                : (this.selected = Object.keys(this.images).length - 1)
32 34
         },
33 35
         next() {
34
-            this.selected < Object.keys(this.images).length - 1 ? this.selected++ : this.selected = 0
36
+            this.selected < Object.keys(this.images).length - 1
37
+                ? this.selected++
38
+                : (this.selected = 0)
35 39
         },
36 40
         hideGallery() {
37 41
             this.$emit('close')
@@ -48,12 +52,12 @@ export default {
48 52
                     this.hideGallery()
49 53
                     break
50 54
             }
51
-        }
55
+        },
52 56
     },
53 57
     watch: {
54 58
         activeImageIndex(newVal, oldVal) {
55 59
             this.selected = newVal
56
-        }
60
+        },
57 61
     },
58 62
     async mounted() {
59 63
         // Set the first selection
@@ -62,11 +66,12 @@ export default {
62 66
     },
63 67
     unmounted() {
64 68
         window.removeEventListener('keydown', this.interpretKeypress)
65
-    }
69
+    },
66 70
 }
67 71
 </script>
68 72
 
69 73
 <style lang="postcss">
74
+// prettier-ignore
70 75
 @import '../sss/variables.sss'
71 76
 @import '../sss/theme.sss'
72 77
 
@@ -115,4 +120,4 @@ export default {
115 120
                 background-color: rgba(255, 255, 255, 0.1)
116 121
                 height: 100vh
117 122
                 padding: 1.0em
118
-</style>
123
+</style>

+ 12
- 12
vue-theme/src/components/hero.vue Просмотреть файл

@@ -34,7 +34,7 @@ export default {
34 34
     data() {
35 35
         return {
36 36
             heroHeight: 0,
37
-            isPlaying: false
37
+            isPlaying: false,
38 38
         }
39 39
     },
40 40
     computed: {
@@ -47,20 +47,21 @@ export default {
47 47
         heroIdFromUrl() {
48 48
             const url = this.showHero.split('/')
49 49
             return url.pop()
50
-        }
50
+        },
51 51
     },
52 52
     methods: {
53 53
         onResize() {
54 54
             this.heroHeight = this.$el.offsetWidth / 1.8
55 55
         },
56 56
         getThumbnailFromYt(url) {
57
-            return ytThumbnail(url, 'large')
58
-        }
57
+            return ytThumbnail(url, 'max')
58
+        },
59 59
     },
60 60
     mounted() {
61 61
         this.heroHeight = this.$el.offsetWidth / 1.8
62
-        this.$nextTick(() => { 
63
-            window.addEventListener('resize', this.onResize) })
62
+        this.$nextTick(() => {
63
+            window.addEventListener('resize', this.onResize)
64
+        })
64 65
     },
65 66
     watch: {
66 67
         $route() {
@@ -70,18 +71,18 @@ export default {
70 71
             this.$store.commit('CLEAR_HERO')
71 72
         },
72 73
         heroHeight() {
73
-            if(!this.showHero) return
74
-            Object.assign(this.$el.style, {height: this.heroHeight + 'px'})
75
-        }
74
+            if (!this.showHero) return
75
+            Object.assign(this.$el.style, { height: this.heroHeight + 'px' })
76
+        },
76 77
     },
77 78
     beforeUnmount() {
78 79
         window.removeEventListener('resize', this.onResize)
79 80
     },
80
-    
81 81
 }
82 82
 </script>
83 83
 
84 84
 <style lang="postcss">
85
+// prettier-ignore
85 86
 @import './../sss/theme.sss'
86 87
 @import './../sss/variables.sss'
87 88
 
@@ -151,5 +152,4 @@ export default {
151 152
                     top: 18%
152 153
                     left: 30%
153 154
                     border-width: 1.5em 0 1.5em 2.5em
154
-            
155
-</style>
155
+</style>

+ 5
- 6
vue-theme/src/components/navigation/navigation.vue Просмотреть файл

@@ -59,16 +59,17 @@ export default {
59 59
                 // 'posts',
60 60
             ]
61 61
             const filtered = postTypes.filter(val => !ignored.includes(val))
62
-            return [ ...filtered, ...extras ]
62
+            return [...filtered, ...extras]
63 63
         })
64 64
         return {
65
-            menuItems
65
+            menuItems,
66 66
         }
67
-    }
67
+    },
68 68
 }
69 69
 </script>
70 70
 
71 71
 <style lang="postcss">
72
+// prettier-ignore
72 73
 @import '../../sss/variables.sss'
73 74
 @import '../../sss/theme.sss'
74 75
 
@@ -167,6 +168,4 @@ nav.main
167 168
     @media (min-width:  $extra-large)
168 169
         .menu > ul
169 170
             max-width: $max-width
170
-
171
-
172
-</style>
171
+</style>

+ 12
- 13
vue-theme/src/components/sidebars/sidebar.vue Просмотреть файл

@@ -63,7 +63,7 @@ aside.sidebar
63 63
 </template>
64 64
 
65 65
 <script>
66
-// related sidebar list 
66
+// related sidebar list
67 67
 import relatedSidebar from './related'
68 68
 import exhibitionsSidebar from './exhibitions'
69 69
 import eventsSidebar from './events'
@@ -78,32 +78,31 @@ import { sortTypes } from '@/utils/helpers'
78 78
 export default {
79 79
     props: {
80 80
         type: {
81
-            type: String
81
+            type: String,
82 82
         },
83 83
         layout: {
84
-            type: String
84
+            type: String,
85 85
         },
86 86
         related: {
87
-            type: Object
88
-        }
87
+            type: Object,
88
+        },
89 89
     },
90 90
     components: {
91 91
         exhibitionsSidebar,
92 92
         eventsSidebar,
93
-        relatedSidebar
93
+        relatedSidebar,
94 94
     },
95 95
     data() {
96 96
         return {
97 97
             sortTypes: {
98
-                'alphabetized': `${sortTypes.alpha}`,
98
+                alphabetized: `${sortTypes.alpha}`,
99 99
                 'by material': `${sortTypes.material}`,
100 100
                 'by artist': `${sortTypes.artist}`,
101 101
                 'by episode': `${sortTypes.episode}`,
102 102
                 'by artist type': `${sortTypes.artisttypes}`,
103 103
                 // 'by event type': `${sortTypes.eventtypes}`,
104 104
                 // 'by exhibition type': `${sortTypes.exhibitiontypes}`,
105
-
106
-            }
105
+            },
107 106
         }
108 107
     },
109 108
     computed: {
@@ -115,7 +114,6 @@ export default {
115 114
                         Object.keys(this.sortTypes)[0],
116 115
                         Object.keys(this.sortTypes)[1],
117 116
                         Object.keys(this.sortTypes)[4],
118
-
119 117
                     ]
120 118
                     break
121 119
                 case 'shorts':
@@ -132,12 +130,13 @@ export default {
132 130
                     break
133 131
             }
134 132
             return opts
135
-        }
136
-    }
133
+        },
134
+    },
137 135
 }
138 136
 </script>
139 137
 
140 138
 <style lang="postcss">
139
+// prettier-ignore
141 140
 @import '../../sss/variables.sss'
142 141
 @import '../../sss/theme.sss'
143 142
 aside.sidebar
@@ -168,4 +167,4 @@ aside.sidebar
168 167
     aside.sidebar
169 168
         min-width: 25%
170 169
         width: 25%
171
-</style>
170
+</style>

+ 21
- 11
vue-theme/src/pages/index.vue Просмотреть файл

@@ -40,11 +40,11 @@ import { convertTitleCase, postTypes, sortTypes } from '@/utils/helpers'
40 40
 export default {
41 41
     mixins: [postTypeGetters, scrollTop],
42 42
     components: { card },
43
-    data() { 
43
+    data() {
44 44
         return {
45 45
             firstRow: ['episodes', 'exhibitions', 'events', 'artists', 'posts'],
46 46
             secondRow: 'artists', // This is only ONE post
47
-            thirdRow: ['episodes', 'exhibitions', 'events', 'artists', 'posts']
47
+            thirdRow: ['episodes', 'exhibitions', 'events', 'artists', 'posts'],
48 48
         }
49 49
     },
50 50
     created() {
@@ -55,23 +55,30 @@ export default {
55 55
             // We try and fetch EVERYTHING except
56 56
             // for EVENTS and EXHIBITIONS we only grab
57 57
             // the current or upcoming on load
58
-            if(!['events', 'exhibitions'].includes(type)) {
58
+            if (!['events', 'exhibitions'].includes(type)) {
59 59
                 this.$store.dispatch(`getAll${capitalizedType}`)
60 60
             } else {
61
-                this.$store.dispatch(`getAll${capitalizedType}`, sortTypes.currentAndUpcoming)
61
+                this.$store.dispatch(
62
+                    `getAll${capitalizedType}`,
63
+                    sortTypes.currentAndUpcoming,
64
+                )
62 65
             }
63 66
         })
64 67
         this.checkAndSetHero('welcome')
65 68
     },
66 69
     methods: {
67 70
         async checkAndSetHero(type) {
68
-            if(!this['allPagesLoaded']) {
69
-                await this.$store.dispatch('getAllPages')    
71
+            if (!this['allPagesLoaded']) {
72
+                await this.$store.dispatch('getAllPages')
70 73
             }
71 74
             const page = this.allPages[type]
72
-            if(!page) return
75
+            if (!page) return
73 76
             let json = { url: page.featured, heroType: 'image' }
74
-            if(page.hero && JSON.parse(page.hero) && JSON.parse(page.hero).url) {
77
+            if (
78
+                page.hero &&
79
+                JSON.parse(page.hero) &&
80
+                JSON.parse(page.hero).url
81
+            ) {
75 82
                 json = JSON.parse(page.hero)
76 83
                 json.heroType = 'video'
77 84
             }
@@ -81,16 +88,19 @@ export default {
81 88
             return Object.values(this[`all${convertTitleCase(type)}`])[0]
82 89
         },
83 90
         randomPostOfType(type) {
84
-            const postsOfType = Object.values(this[`all${convertTitleCase(type)}`])
91
+            const postsOfType = Object.values(
92
+                this[`all${convertTitleCase(type)}`],
93
+            )
85 94
             const max = postsOfType.length
86 95
             const rand = Math.floor(Math.random() * max)
87 96
             return postsOfType[rand]
88
-        }
89
-    }
97
+        },
98
+    },
90 99
 }
91 100
 </script>
92 101
 
93 102
 <style lang="postcss">
103
+// prettier-ignore
94 104
 @import '../sss/variables.sss'
95 105
 @import '../sss/theme.sss'
96 106
 .page--index 

+ 39
- 10
vue-theme/src/pages/list.vue Просмотреть файл

@@ -141,14 +141,43 @@ export default {
141 141
 </script>
142 142
 
143 143
 <style lang="postcss">
144
-@import '../sss/variables.sss' @import '../sss/theme.sss' .page--list
145
-    /* background-color: white */ article > header /* padding: 1em 0 1em 0 */
146
-    padding: 1em > h1 margin: 0 > .content padding: 0 width: 100%
147
-    /* posts not grid list */ ul img max-width: 50% .is-grid display: flex
148
-    flex-direction: row flex-wrap: wrap justify-content: space-between
149
-    /* extra padding required? */ /* padding: $ms-0 */
150
-    /* background-color: white */ section width: 32.5%
151
-    /* 4 column grid see how dense this becomes */ /* width: 24% */ ul flex-wrap:
152
-    wrap list-style: none img max-width: 100% @media (min-width: $medium)
153
-    .page--list.f-col flex-direction: row;
144
+// prettier-ignore
145
+@import '../sss/variables.sss'
146
+@import '../sss/theme.sss'
147
+.page--list
148
+    /* background-color: white */
149
+    article
150
+        > header
151
+            /* padding: 1em 0 1em 0 */
152
+            padding: 1em
153
+            > h1
154
+                margin: 0
155
+            > .content
156
+                padding: 0
157
+                width: 100%
158
+        /* posts not grid list */
159
+        ul
160
+            img
161
+                max-width: 50%
162
+
163
+        .is-grid
164
+            display: flex
165
+            flex-direction: row
166
+            flex-wrap: wrap
167
+            justify-content: space-between
168
+            /* extra padding required? */
169
+            /* padding: $ms-0 */
170
+            /* background-color: white */
171
+            section
172
+                width: 32.5%
173
+                /* 4 column grid see how dense this becomes */
174
+                /* width: 24% */
175
+            ul
176
+                flex-wrap: wrap
177
+                list-style: none
178
+                img
179
+                    max-width: 100%
180
+@media (min-width: $medium)
181
+    .page--list.f-col
182
+        flex-direction: row
154 183
 </style>

+ 79
- 17
vue-theme/src/pages/single.vue Просмотреть файл

@@ -253,21 +253,83 @@ export default {
253 253
 </script>
254 254
 
255 255
 <style lang="postcss">
256
-@import '../sss/variables.sss' @import '../sss/theme.sss' .page--single
257
-    /* background-color: $cia_white2 */ article background-color: white padding:
258
-    $ms-0 h1 color: $cia_black /* font-weight: 800 */ /* padding: $ms--3 0 */ >
259
-    ul /* grid-gap: $ms-0 */ list-style: none
260
-    /* change to a 1/3 width of the article*/ img.feature width: 20em li
261
-    /* iframe container 16:9 */ .iframe-container position: relative width: 100%
262
-    padding-bottom: 56.25% /* iframe container portrait */ .iframe-container-v
263
-    position: relative width: 100% height: 100% padding-bottom: 125% iframe
264
-    position: absolute top: 0px left: 0px width: 100% height: 100%
265
-    .wp-block-embed .is-type-video position: relative width: 100% padding-bottom:
266
-    56.25% * hr border: $ms--3 margin: $ms-2 auto outline-style: auto
267
-    &.is-style-default height: 1px width: 15vw &.is-style-wide height: 1px width:
268
-    50vw &.is-style-dots outline-style: none font-weight: bolder breadcrumb h5
269
-    /* color: yellow */ color: $cia_red /* font-weight: 400 */
270
-    /* padding: $ms--6 0 */ //- end of article icon
271
-    footer padding: $ms-6 0 img height: $ms-3 width: $ms-3 @media
272
-    (min-width: $medium) .page--single.f-col flex-direction: row;
256
+// prettier-ignore
257
+@import '../sss/variables.sss'
258
+@import '../sss/theme.sss'
259
+.page--single
260
+    /* background-color: $cia_white2 */
261
+    article
262
+        background-color: white
263
+        padding: $ms-0
264
+        h1
265
+            color: $cia_black
266
+            /* font-weight: 800 */
267
+            /* padding: $ms--3 0 */
268
+        > ul
269
+            /* grid-gap: $ms-0 */
270
+            list-style: none
271
+            /* change to a 1/3 width of the article*/
272
+            img.feature
273
+                width: 20em 
274
+            li
275
+        /* iframe container 16:9 */
276
+        .iframe-container 
277
+            position: relative
278
+            width: 100% 
279
+            padding-bottom: 56.25% 
280
+
281
+        /* iframe container portrait */
282
+        .iframe-container-v
283
+            position: relative
284
+            width: 100%
285
+            height: 100%
286
+            padding-bottom: 125%
287
+            
288
+        iframe 
289
+            position: absolute 
290
+            top: 0px 
291
+            left: 0px 
292
+            width: 100% 
293
+            height: 100%
294
+        
295
+        .wp-block-embed .is-type-video
296
+            position: relative
297
+            width: 100% 
298
+            padding-bottom: 56.25% 
299
+
300
+        * hr
301
+            border: $ms--3
302
+            margin: $ms-2 auto
303
+            outline-style: auto
304
+
305
+            &.is-style-default
306
+                height: 1px
307
+                width: 15vw
308
+
309
+            &.is-style-wide
310
+                height: 1px
311
+                width: 50vw
312
+        
313
+            &.is-style-dots
314
+                outline-style: none
315
+                font-weight: bolder
316
+
317
+        breadcrumb
318
+            h5
319
+                /* color: yellow */
320
+                color: $cia_red
321
+                /* font-weight: 400 */
322
+                /* padding: $ms--6 0 */
323
+        
324
+        //- end of article icon
325
+        footer
326
+            padding: $ms-6 0
327
+            img
328
+                height: $ms-3
329
+                width: $ms-3
330
+
331
+        
332
+@media (min-width: $medium)
333
+    .page--single.f-col
334
+        flex-direction: row
273 335
 </style>

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