Browse Source

:recycle: rough re-layout of home page

tags/0.9.0
j 4 years ago
parent
commit
9a474ad6ba
2 changed files with 67 additions and 79 deletions
  1. 1
    0
      vue-theme/src/app.vue
  2. 66
    79
      vue-theme/src/pages/index.vue

+ 1
- 0
vue-theme/src/app.vue View File

34
         main 
34
         main 
35
             background-color: green
35
             background-color: green
36
             width: 100%
36
             width: 100%
37
+            margin: 0 0 3vh 0
37
             
38
             
38
             :--headings
39
             :--headings
39
                 color: yellow
40
                 color: yellow

+ 66
- 79
vue-theme/src/pages/index.vue View File

4
     article.w-max
4
     article.w-max
5
         section
5
         section
6
             ul
6
             ul
7
-                li.wide
8
-                    p 1 - 1
9
-                li
10
-                    p 1 - 2
11
-                li
12
-                    p 1 - 3
13
-                li
14
-                    p 1 - 4
15
-                li
16
-                    p 1 - 5
7
+                li.shadow(v-for="type in ['episodes', 'exhibitions', 'events', 'artists', 'posts']")
8
+                    .card(v-if="firstPostOfType(type)")
9
+                        router-link(:to="`/${type}`")
10
+                            p.t-up {{type}}
11
+                        router-link(:to="`/${type}/${firstPostOfType(type).slug}`")
12
+                            img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
13
+                            h1.t-up.t-cntr {{ firstPostOfType(type).title }}
14
+                        p episode excerpt, Lorem ipsum dolor sit amet, consectetu
17
 
15
 
18
         section
16
         section
19
-            ul.max
20
-                li
21
-                    p 2 - 1
17
+            ul.max.w-max
18
+                li.shadow(v-for="post in [randomPostOfType('artists')]")
19
+                    .card(v-if="post")
20
+                        router-link(:to="`/${'artists'}/${post.slug}`")
21
+                            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
25
+                                router-link(:to="`/artists/${post.slug}`")
26
+                                    h1.t-up.t-cntr {{ post.title }}
27
+                                    p episode excerpt, Lorem ipsum dolor sit amet, consectetu
22
 
28
 
23
         section
29
         section
24
             ul.flipped
30
             ul.flipped
25
-                li
26
-                    p 3 - 1
27
-                li
28
-                    p 3 - 2
29
-                li
30
-                    p 3 - 3
31
-                li
32
-                    p 3 - 4
33
-                li.wide
34
-                    p 3 - 5
35
-        
31
+                li.shadow(v-for="type in ['episodes', 'exhibitions', 'events', 'artists', 'artists']")
32
+                    .random--wrapper(v-for="post in [randomPostOfType(type)]")
33
+                        .card(v-if="post")
34
+                            router-link(:to="`/${type}`")
35
+                                p.t-up {{type}}
36
+                            router-link(:to="`/${type}/${post.slug}`")
37
+                                img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
38
+                                h1.t-up.t-cntr {{ post.title }}
39
+                            p episode excerpt, Lorem ipsum dolor sit amet, consectetu
40
+                                
36
         //- if sticky
41
         //- if sticky
37
         //- li.f-row.wrap.w-max
42
         //- li.f-row.wrap.w-max
38
         //-     h3(v-if="!allStickyLoaded") loading...
43
         //-     h3(v-if="!allStickyLoaded") loading...
45
         //- li.f-row.wrap.w-max
50
         //- li.f-row.wrap.w-max
46
         //-     h3(v-if="!allPagesLoaded") loading...
51
         //-     h3(v-if="!allPagesLoaded") loading...
47
         //-     .content(v-else-if="allPages['welcome']" v-html="allPages['welcome'].content")
52
         //-     .content(v-else-if="allPages['welcome']" v-html="allPages['welcome'].content")
48
-
49
-        //- top section
50
-        //- section(v-if="allEpisodesLoaded").shadow
51
-        //-     router-link(:to="`/episodes`")
52
-        //-         h3.t-up episodes
53
-        //-     router-link(:to="`/episodes/${Object.values(allEpisodes)[0]}`")
54
-        //-         img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
55
-        //-         h2.t-up.t-cntr {{ Object.values(allEpisodes)[0] }}
56
-        //-     p episode excerpt, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nisl ligula, ullamcorper nec dapibus a, ullamcorper a elit. Integer mattis interdum mauris, sit amet feugiat dui consequat et. Curabitur cursus justo quis nunc euismod, nec ornare sem ornare. Mauris eget purus finibus, tempus tellus sed, maximus nisi. Fusce cursus placerat sodales...[…]
57
-
58
-        //- section(v-if="allExhibitionsLoaded").shadow
59
-        //-     router-link(:to="`/exhibitions`")
60
-        //-         h3.t-up exhibitions
61
-        //-     router-link(:to="`/exhibitions/${Object.values(allExhibitions)[0]}`")
62
-        //-         img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
63
-        //-         h2.t-up.t-cntr {{ Object.values(allExhibitions)[0] }}
64
-        //-     p episode excerpt, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nisl ligula, ullamcorper nec dapibus a, ullamcorper a elit. Integer mattis interdum mauris, sit amet feugiat dui consequat et. Curabitur cursus justo quis nunc euismod, nec ornare sem ornare. Mauris eget purus finibus, tempus tellus sed, maximus nisi. Fusce cursus placerat sodales...[…]
65
-
66
-        //- section(v-if="allEventsLoaded").shadow
67
-        //-     router-link(:to="`/events`")
68
-        //-         h3.t-up events
69
-        //-     router-link(:to="`/events/${Object.values(allEvents)[0]}`")
70
-        //-         img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
71
-        //-         h2.t-up.t-cntr {{ Object.values(allEvents)[0] }}
72
-        //-     p episode excerpt, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nisl ligula, ullamcorper nec dapibus a, ullamcorper a elit. Integer mattis interdum mauris, sit amet feugiat dui consequat et. Curabitur cursus justo quis nunc euismod, nec ornare sem ornare. Mauris eget purus finibus, tempus tellus sed, maximus nisi. Fusce cursus placerat sodales...[…]
73
-
74
-        //- section(v-if="allPostsLoaded").shadow
75
-        //-     router-link(:to="`/posts`")
76
-        //-         h3.t-up shorts PLACEHOLDER
77
-        //-     router-link(:to="`/posts/${Object.values(allPosts)[0]}`")
78
-        //-         img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
79
-        //-         h2.t-up.t-cntr {{ Object.values(allPosts)[0] }}
80
-        //-     p episode excerpt, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nisl ligula, ullamcorper nec dapibus a, ullamcorper a elit. Integer mattis interdum mauris, sit amet feugiat dui consequat et. Curabitur cursus justo quis nunc euismod, nec ornare sem ornare. Mauris eget purus finibus, tempus tellus sed, maximus nisi. Fusce cursus placerat sodales...[…]
81
-
82
-        //- //- middle row
83
-        //- section(v-if="allArtistsLoaded").shadow
84
-        //-     router-link(:to="`/artists`")
85
-        //-         h3.t-up artists
86
-        //-     router-link(:to="`/artists/${Object.values(allArtists)[0]}`")
87
-        //-         img.index(src="https://i1.wp.com/www.craftinamerica.org/wp-content/uploads/2020/09/20200210_133120-e1599254267307.jpg")
88
-        //-         h2.t-up.t-cntr {{ Object.values(allArtists)[0] }}
89
-        //-     p episode excerpt, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nisl ligula, ullamcorper nec dapibus a, ullamcorper a elit. Integer mattis interdum mauris, sit amet feugiat dui consequat et. Curabitur cursus justo quis nunc euismod, nec ornare sem ornare. Mauris eget purus finibus, tempus tellus sed, maximus nisi. Fusce cursus placerat sodales...[…]
90
 </template>
53
 </template>
91
 
54
 
92
 <script>
55
 <script>
118
             }
81
             }
119
             this.$store.commit('SET_HERO', json)
82
             this.$store.commit('SET_HERO', json)
120
         },
83
         },
84
+        firstPostOfType(type) {
85
+            return Object.values(this[`all${convertTitleCase(type)}`])[0]
86
+        },
87
+        randomPostOfType(type) {
88
+            const postsOfType = Object.values(this[`all${convertTitleCase(type)}`])
89
+            const max = postsOfType.length
90
+            const rand = Math.floor(Math.random() * max)
91
+            return postsOfType[rand]
92
+        }
121
     }
93
     }
122
 }
94
 }
123
 </script>
95
 </script>
132
         flex-direction: column
104
         flex-direction: column
133
         align-items: stretch
105
         align-items: stretch
134
         section
106
         section
135
-            border: 1px yellow solid
136
             ul
107
             ul
137
                 list-style: none
108
                 list-style: none
138
 @media (min-width: $medium)
109
 @media (min-width: $medium)
139
     .page--index > article > section
110
     .page--index > article > section
140
         &:nth-of-type(2)
111
         &:nth-of-type(2)
141
-            margin: 1em auto
112
+            margin: 3% 0 2% 0
142
         ul
113
         ul
143
             display: grid
114
             display: grid
144
             grid-template-columns: 
115
             grid-template-columns: 
145
                 50% 24% 24%
116
                 50% 24% 24%
146
             grid-template-rows: 
117
             grid-template-rows: 
147
-                47% 47%
118
+                48% 48%
148
             gap: 4% 1%
119
             gap: 4% 1%
149
-            justify-items: strech
150
-            align-items: stretch
151
-            height: auto
152
             li
120
             li
153
-                min-height: 20em
121
+                min-height: 10em
154
                 background-color: purple
122
                 background-color: purple
155
-                &.wide:nth-of-type(1)
123
+                &:nth-of-type(1)
156
                     grid-column-start: 1
124
                     grid-column-start: 1
157
                     grid-row-start: 1
125
                     grid-row-start: 1
158
-                    grid-row-end: end
126
+                    grid-row-end: 3
159
                 &:nth-of-type(2), &:nth-of-type(3)
127
                 &:nth-of-type(2), &:nth-of-type(3)
160
-                    grid-row-start: 1
161
                     grid-column-start: 2
128
                     grid-column-start: 2
129
+                    grid-row-start: 1
162
                 &:nth-of-type(3)
130
                 &:nth-of-type(3)
163
                     grid-column-start: 3
131
                     grid-column-start: 3
164
                 &:nth-of-type(4), &:nth-of-type(5)
132
                 &:nth-of-type(4), &:nth-of-type(5)
166
                     grid-row-start: 2
134
                     grid-row-start: 2
167
                 &:nth-of-type(5)
135
                 &:nth-of-type(5)
168
                     grid-column-start: 3
136
                     grid-column-start: 3
137
+                .card
138
+                    padding: $ms--3 $ms--1
139
+                    overflow: hidden
140
+                    text-overflow: clip
141
+                    &--info
142
+                        justify-content: center
143
+                    img
144
+                        width: 100%
145
+                        height: auto
146
+                    h1, h2, h3, p
147
+                        padding: 0
148
+                        margin: 0
149
+                    h1
150
+                        font-size: $ms-1
169
             &.max
151
             &.max
170
                 grid-template-columns: 
152
                 grid-template-columns: 
171
                     auto
153
                     auto
172
                 grid-template-rows: 
154
                 grid-template-rows: 
173
                     auto
155
                     auto
156
+                > li > .card > img
157
+                    max-width: 50%
174
             &.flipped
158
             &.flipped
175
                 grid-template-columns: 
159
                 grid-template-columns: 
176
                     24% 24% 50%
160
                     24% 24% 50%
177
                 li
161
                 li
162
+                    &:nth-of-type(1)
163
+                        grid-column-start: 1
164
+                        grid-row-start: 1
165
+                        grid-row-end: 2
178
                     &:nth-of-type(3)
166
                     &:nth-of-type(3)
179
                         grid-column-start: 1
167
                         grid-column-start: 1
180
                         grid-row-start: 2
168
                         grid-row-start: 2
181
-                    &.wide:nth-of-type(5)
182
-                        grid-column-start: 3
169
+                    &:nth-of-type(5)
183
                         grid-row-start: 1
170
                         grid-row-start: 1
184
-                        grid-row-end: end
171
+                        grid-row-end: 3
185
 
172
 
186
 </style>
173
 </style>

Loading…
Cancel
Save