Переглянути джерело

:art: forcing image crop | altering hero to 2.1:1 aspect ratio (between 21:9 and 16:9)

tags/0.9.0
J 4 роки тому
джерело
коміт
5afdad7465

+ 0
- 32
vue-theme/src/app.vue Переглянути файл

41
             /* :--headings, a */
41
             /* :--headings, a */
42
             a
42
             a
43
                 color: $cia_red
43
                 color: $cia_red
44
-                &:hover
45
-                    /* leave obvious for testing */
46
-                    color: green
47
 
44
 
48
             img
45
             img
49
                 transition: $transition ease-in
46
                 transition: $transition ease-in
52
                     cursor: pointer
49
                     cursor: pointer
53
 
50
 
54
             > [class^="page--"]
51
             > [class^="page--"]
55
-                /* background-color: lightblue */
56
                 max-width: $max-width
52
                 max-width: $max-width
57
                 margin: 0 auto
53
                 margin: 0 auto
58
                 padding: $ms-0 0
54
                 padding: $ms-0 0
59
                 align-items: flex-start
55
                 align-items: flex-start
60
-                
61
                 /* Block Shadow Thing */
56
                 /* Block Shadow Thing */
62
                 .shadow
57
                 .shadow
63
                     box-shadow: rgba(0 0 0 / 15%) 0.3px 0.5px 1.5px 0.5px
58
                     box-shadow: rgba(0 0 0 / 15%) 0.3px 0.5px 1.5px 0.5px
64
-
65
-                /* Content Pieces excluding index*/
66
-                .post
67
-                    /* bg for list pages */
68
-                    background-color: white
69
-                    margin: 0 0 $ms-0
70
-                    &--title
71
-                        color: yellow
72
-                        padding: 0 0 $ms-0
73
-                    &--content
74
-                        color: orange
75
-                        &--block > p
76
-                            color: grey
77
-                        .wp-block-image
78
-                            margin: 0
79
-                            img
80
-                                width: 100%
81
-                    > ul
82
-                        list-style: none
83
-                
84
-                /* Single & List Pages*/
85
-                /* > article */
86
-                article
87
-                    /* background-color: lightpink */
88
-                
89
-        nav, footer
90
-            &.main /* background-color: pink */
91
 </style>
59
 </style>

+ 12
- 5
vue-theme/src/components/card.vue Переглянути файл

16
             p(v-if="content.end && type == 'event'" class="datetime") {{ dateFrom(content.start, type=='event') }} &ndash; {{ dateFrom(content.end, type=='event').split(',')[1] }}
16
             p(v-if="content.end && type == 'event'" class="datetime") {{ dateFrom(content.start, type=='event') }} &ndash; {{ dateFrom(content.end, type=='event').split(',')[1] }}
17
             p(v-else-if="content.end" class="datetime") {{ dateFrom(content.start, type=='event') }} &ndash; {{ dateFrom(content.end, type=='event') }}
17
             p(v-else-if="content.end" class="datetime") {{ dateFrom(content.start, type=='event') }} &ndash; {{ dateFrom(content.end, type=='event') }}
18
             p.excerpt {{ content.excerpt }}
18
             p.excerpt {{ content.excerpt }}
19
-            router-link(:to="`/${type}/${content.slug}`") read more
19
+            router-link(:to="`/${type}/${content.slug}`")
20
+                p.read-more read more
20
 </template>
21
 </template>
21
 
22
 
22
 <script>
23
 <script>
46
         justify-content: center
47
         justify-content: center
47
         > a
48
         > a
48
             line-height: 0
49
             line-height: 0
50
+            /* Force crop images */
51
+            .featured-or-hero-image img
52
+                object-fit: cover
53
+                object-position: 0% 30%
54
+                max-height: 160px
55
+                overflow-y: clip
49
     header a
56
     header a
50
         font-size: $ms--2
57
         font-size: $ms--2
51
         text-decoration: none
58
         text-decoration: none
65
     p
72
     p
66
         &.datetime
73
         &.datetime
67
             font-size: $ms--1
74
             font-size: $ms--1
68
-            margin: 0 0 calc($ms-0/2) 0
69
-            line-height: calc($ms-0/2)
75
+            margin: 0
70
         &.excerpt
76
         &.excerpt
71
             overflow: hidden
77
             overflow: hidden
72
-            margin: 0 0 $ms--2 0
73
-
78
+            margin: 0
79
+        &.read-more
80
+            font-size: $ms--1
74
     
81
     
75
 /* for widths larger than 768px */
82
 /* for widths larger than 768px */
76
 @media (min-width: $medium)
83
 @media (min-width: $medium)

+ 15
- 4
vue-theme/src/components/hero.vue Переглянути файл

55
     },
55
     },
56
     methods: {
56
     methods: {
57
         onResize() {
57
         onResize() {
58
-            this.heroHeight = this.$el.offsetWidth / 1.8
58
+            this.heroHeight = this.$el.offsetWidth / 2.1
59
         },
59
         },
60
         getThumbnailFromYt(url) {
60
         getThumbnailFromYt(url) {
61
             return ytThumbnail(url, 'max')
61
             return ytThumbnail(url, 'max')
62
         },
62
         },
63
     },
63
     },
64
     mounted() {
64
     mounted() {
65
-        this.heroHeight = this.$el.offsetWidth / 1.8
65
+        this.heroHeight = this.$el.offsetWidth / 2.1
66
         this.$nextTick(() => {
66
         this.$nextTick(() => {
67
             window.addEventListener('resize', this.onResize)
67
             window.addEventListener('resize', this.onResize)
68
         })
68
         })
105
         z-index: 0
105
         z-index: 0
106
 
106
 
107
     &--image
107
     &--image
108
+        min-width: 360px
109
+        max-height: 50vh
110
+        img
111
+            position: relative
112
+            min-width: 100vw
113
+            height: auto
114
+            z-index: -1
115
+            top: -30%
108
         &--overlay
116
         &--overlay
109
-            /* color: $cia_white */
110
             position: absolute
117
             position: absolute
111
-            margin: 19% 0
118
+            height: 100%
119
+            width: 100vw
120
+            right: 0
121
+            left: 0
122
+            overflow: clip
112
             h2
123
             h2
113
                 /* need better responsive solution for heading size  */
124
                 /* need better responsive solution for heading size  */
114
                 font-size: 3vw
125
                 font-size: 3vw

+ 5
- 0
vue-theme/src/pages/index.vue Переглянути файл

132
             li
132
             li
133
                 margin: 0
133
                 margin: 0
134
                 min-height: 10em
134
                 min-height: 10em
135
+                /* Big boxes */
136
+                &:nth-of-type(1), &:nth-of-type(3)
137
+                    /* Force crop images */
138
+                    .featured-or-hero-image img
139
+                        max-height: 300px
135
                 /* n1 episode */
140
                 /* n1 episode */
136
                 &:nth-of-type(1)
141
                 &:nth-of-type(1)
137
                     grid-column-start: 1
142
                     grid-column-start: 1

Завантаження…
Відмінити
Зберегти