Explorar el Código

:recycle: cleaned up sticky layout

tags/0.9.0
j hace 4 años
padre
commit
974344389f
Se han modificado 1 ficheros con 103 adiciones y 43 borrados
  1. 103
    43
      vue-theme/src/pages/index.vue

+ 103
- 43
vue-theme/src/pages/index.vue Ver fichero

@@ -2,6 +2,21 @@
2 2
 <template lang="pug">
3 3
 .page--index.f-row.between
4 4
     article.w-max
5
+        section(v-if="allSticky && Object.keys(allSticky).length").stickies
6
+            ul.flipped(:class="[`sticky-${Object.keys(allSticky).length}`]")
7
+                //- if sticky
8
+                li.shadow(v-for="sticky in allSticky")
9
+                    .card(v-if="sticky")
10
+                        router-link(:to="`/${sticky.type}`")
11
+                            p.t-up {{sticky.type}}
12
+                        .card--info
13
+                            router-link(:to="`/${sticky.type}/${sticky.slug}`")
14
+                                img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
15
+                            .f-col.w-max
16
+                                router-link(:to="`/${sticky.type}/${sticky.slug}`")
17
+                                    h1.t-up.t-cntr {{ sticky.title }}
18
+                                p episode excerpt, Lorem ipsum dolor sit amet, consectetu
19
+
5 20
         section
6 21
             ul
7 22
                 li.shadow(v-for="type in ['episodes', 'exhibitions', 'events', 'artists', 'posts']")
@@ -13,18 +28,19 @@
13 28
                             h1.t-up.t-cntr {{ firstPostOfType(type).title }}
14 29
                         p episode excerpt, Lorem ipsum dolor sit amet, consectetu
15 30
 
16
-        section
17
-            ul.max.w-max
31
+        section.max
32
+            ul.w-max
18 33
                 li.shadow(v-for="post in [randomPostOfType('artists')]")
19 34
                     .card(v-if="post")
20 35
                         router-link(:to="`/${'artists'}/${post.slug}`")
21 36
                             p.t-up {{'artists'}}
22
-                        .f-row(style="justify-content: flex-start;")
23
-                            img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
24
-                            .card--info.f-col.w-max
37
+                        .card--info.f-row
38
+                            router-link(:to="`/artists/${post.slug}`")
39
+                                img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
40
+                            .f-col.w-max
25 41
                                 router-link(:to="`/artists/${post.slug}`")
26 42
                                     h1.t-up.t-cntr {{ post.title }}
27
-                                    p episode excerpt, Lorem ipsum dolor sit amet, consectetu
43
+                                p episode excerpt, Lorem ipsum dolor sit amet, consectetu
28 44
 
29 45
         section
30 46
             ul.flipped
@@ -38,18 +54,7 @@
38 54
                                 h1.t-up.t-cntr {{ post.title }}
39 55
                             p episode excerpt, Lorem ipsum dolor sit amet, consectetu
40 56
                                 
41
-        //- if sticky
42
-        //- li.f-row.wrap.w-max
43
-        //-     h3(v-if="!allStickyLoaded") loading...
44
-        //-     section(v-else-if="allStickyLoaded").shadow
45
-        //-         h4.t-cap sticky
46
-        //-         ul
47
-        //-             li(v-for="sticky in allSticky")
48
-        //-                 p {{ sticky.type }}: {{ sticky.title }}
49
-        //- loading
50
-        //- li.f-row.wrap.w-max
51
-        //-     h3(v-if="!allPagesLoaded") loading...
52
-        //-     .content(v-else-if="allPages['welcome']" v-html="allPages['welcome'].content")
57
+
53 58
 </template>
54 59
 
55 60
 <script>
@@ -106,14 +111,41 @@ export default {
106 111
         section
107 112
             ul
108 113
                 list-style: none
114
+                .card
115
+                    padding: $ms--3 $ms--1
116
+                    overflow: hidden
117
+                    text-overflow: clip
118
+                    &--info
119
+                        justify-content: center
120
+                    img
121
+                        width: 100%
122
+                        height: auto
123
+                    h1, h2, h3, p
124
+                        padding: 0
125
+                        margin: 0
126
+                    h1
127
+                        font-size: $ms-1
128
+            &.max 
129
+                margin: 0
130
+                > ul
131
+                    grid-template-columns: 
132
+                        auto
133
+                    grid-template-rows: 
134
+                        auto
135
+                    > li > .card > img
136
+                        width: 100%
109 137
 @media (min-width: $medium)
110 138
     .page--index > article > section
111
-        &:nth-of-type(2)
112
-            margin: 3% 0 2% 0
139
+        &.stickies
140
+            margin: 0 0 2% 0
141
+        &.max 
142
+            margin: 3.5% 0 3% 0
143
+            > li .card--info > a:first-of-type
144
+                width: 100%
113 145
         ul
114 146
             display: grid
115 147
             grid-template-columns: 
116
-                50% 24% 24%
148
+                49.5% 24.25% 24.25%
117 149
             grid-template-rows: 
118 150
                 48% 48%
119 151
             gap: 4% 1%
@@ -148,26 +180,54 @@ export default {
148 180
                         margin: 0
149 181
                     h1
150 182
                         font-size: $ms-1
151
-            &.max
152
-                grid-template-columns: 
153
-                    auto
154
-                grid-template-rows: 
155
-                    auto
156
-                > li > .card > img
157
-                    max-width: 50%
158
-            &.flipped
159
-                grid-template-columns: 
160
-                    24% 24% 50%
161
-                li
162
-                    &:nth-of-type(1)
163
-                        grid-column-start: 1
164
-                        grid-row-start: 1
165
-                        grid-row-end: 2
166
-                    &:nth-of-type(3)
167
-                        grid-column-start: 1
168
-                        grid-row-start: 2
169
-                    &:nth-of-type(5)
170
-                        grid-row-start: 1
171
-                        grid-row-end: 3
172
-
183
+        &.stickies
184
+            ul
185
+                &.flipped
186
+                    grid-template-columns: 
187
+                        24.25% 24.25% 49.5% 
188
+                    li
189
+                        &:nth-of-type(1)
190
+                            grid-row-end: 2
191
+                        &:nth-of-type(3)
192
+                            grid-column-start: 1
193
+                            grid-row-start: 2
194
+                        &:nth-of-type(5)
195
+                            grid-row-start: 1
196
+                            grid-row-end: 3
197
+                &.sticky-1
198
+                    display: flex
199
+                    > li .card--info 
200
+                        display: flex
201
+                        > a:first-of-type
202
+                            width: 100%
203
+                &.sticky-2
204
+                    display: flex
205
+                &.sticky-3
206
+                    display: flex
207
+                &.sticky-4
208
+                    display: flex
209
+                &.sticky-5
210
+                    grid-template-columns: 
211
+                        24.25% 24.25% 49.5%
212
+                    grid-template-rows: 
213
+                        48% 48%
214
+                    gap: 4% 1%
215
+                    > li
216
+                        &:nth-of-type(1)
217
+                            grid-row-end: 2
218
+                        &:nth-of-type(2)
219
+                            grid-column-start: 2
220
+                            grid-row-start: 1
221
+                            grid-row-end: 2
222
+                        &:nth-of-type(3)
223
+                            grid-column-start: 1
224
+                            grid-row-start: 2
225
+                            margin: 0 0 8% 0
226
+                        &:nth-of-type(4)
227
+                            grid-column-start: 2
228
+                            grid-row-start: 2
229
+                            margin: 0 0 8% 0
230
+                        &:nth-of-type(5)
231
+                            grid-column-start: 3
232
+                            margin: 0 0 4% 0
173 233
 </style>

Loading…
Cancelar
Guardar