Quellcode durchsuchen

:recycle: adjusting hero loading | always showing hero temporarily

tags/0.9.0
j vor 4 Jahren
Ursprung
Commit
416bd68b17

+ 1
- 0
vue-theme/src/components/card.vue Datei anzeigen

10
         .f-col.w-max
10
         .f-col.w-max
11
             router-link(:to="`/${type}/${content.slug}`")
11
             router-link(:to="`/${type}/${content.slug}`")
12
                 h1.t-up.t-cntr.t-b {{ content.title }}
12
                 h1.t-up.t-cntr.t-b {{ content.title }}
13
+            p(v-if="content.end") {{ content.start }} – {{ content.end }}
13
             p {{ content.excerpt }}
14
             p {{ content.excerpt }}
14
 </template>
15
 </template>
15
 
16
 

+ 5
- 5
vue-theme/src/components/hero.vue Datei anzeigen

1
 <template lang="pug">
1
 <template lang="pug">
2
-.hero.w-max.f-col(v-if="showHero")
3
-    //- .tint.z-top.w-max
2
+.hero.w-max.f-col(v-if="showHero && !loading")
4
     .tint.w-max
3
     .tint.w-max
5
     .hero--video.w-max(v-if="heroType === 'video'")
4
     .hero--video.w-max(v-if="heroType === 'video'")
6
         iframe(
5
         iframe(
23
     .hero--image(v-else)
22
     .hero--image(v-else)
24
         .hero--image--overlay.w-max.f-col
23
         .hero--image--overlay.w-max.f-col
25
             div(v-html="heroText")
24
             div(v-html="heroText")
26
-    //- if not hero image then heading overlay to show only in main article
27
-
25
+.hero.w-max.f-col(v-else-if="loading" style="justify-content: center !important;")
26
+    .tint.w-max
27
+    p loading...
28
 </template>
28
 </template>
29
 
29
 
30
 <script>
30
 <script>
42
         ...mapState({
42
         ...mapState({
43
             showHero: state => state.hero.url,
43
             showHero: state => state.hero.url,
44
             heroText: state => state.hero.text,
44
             heroText: state => state.hero.text,
45
+            loading: state => state.loading,
45
             heroType: state => state.hero.type,
46
             heroType: state => state.hero.type,
46
             showPlaybutton: state => state.hero.playbutton,
47
             showPlaybutton: state => state.hero.playbutton,
47
         }),
48
         }),
158
         min-height: 50vh
159
         min-height: 50vh
159
         .embedded
160
         .embedded
160
             min-height: 50vh
161
             min-height: 50vh
161
-    
162
 </style>
162
 </style>

+ 7
- 1
vue-theme/src/store/index.js Datei anzeigen

20
 // Current page state
20
 // Current page state
21
 const state = {
21
 const state = {
22
     title: wp.site_name,
22
     title: wp.site_name,
23
+    loading: true,
23
     hero: {
24
     hero: {
24
         url: null,
25
         url: null,
25
         type: null,
26
         type: null,
32
 
33
 
33
 const mutations = {
34
 const mutations = {
34
     SET_HERO(state, hero) {
35
     SET_HERO(state, hero) {
35
-        if (!hero) return
36
+        if (!hero) {
37
+            state.loading = false
38
+            return
39
+        }
36
 
40
 
37
         if (hero.url) {
41
         if (hero.url) {
38
             state.hero.text = hero.text
42
             state.hero.text = hero.text
47
             state.hero.text = ''
51
             state.hero.text = ''
48
             state.hero.playbutton = false
52
             state.hero.playbutton = false
49
         }
53
         }
54
+        state.loading = false
50
     },
55
     },
51
     CLEAR_HERO(state) {
56
     CLEAR_HERO(state) {
57
+        state.loading = true
52
         state.hero = {
58
         state.hero = {
53
             url: null,
59
             url: null,
54
             type: null,
60
             type: null,

Laden…
Abbrechen
Speichern