loading icon

This commit is contained in:
2023-04-22 22:34:35 +10:00
parent beb91553ef
commit 89880016ea

View File

@@ -1,5 +1,7 @@
<template> <template>
<section class="hero"> <section class="hero">
<SMLoading v-if="!loaded" large />
<template v-else>
<div class="hero-background" :style="heroStyles"></div> <div class="hero-background" :style="heroStyles"></div>
<SMContainer class="align-items-start"> <SMContainer class="align-items-start">
<div class="hero-content"> <div class="hero-content">
@@ -9,7 +11,10 @@
<SMButton <SMButton
v-if="loaded" v-if="loaded"
type="primary" type="primary"
:to="{ name: 'article', params: { slug: heroSlug } }" :to="{
name: 'article',
params: { slug: heroSlug },
}"
label="Read More" /> label="Read More" />
</div> </div>
</div> </div>
@@ -21,6 +26,7 @@
>{{ heroImageTitle }}</router-link >{{ heroImageTitle }}</router-link
> >
</div> </div>
</template>
</section> </section>
</template> </template>
@@ -31,6 +37,7 @@ import { PostCollection } from "../helpers/api.types";
import { mediaGetVariantUrl } from "../helpers/media"; import { mediaGetVariantUrl } from "../helpers/media";
import { excerpt } from "../helpers/string"; import { excerpt } from "../helpers/string";
import SMButton from "./SMButton.vue"; import SMButton from "./SMButton.vue";
import SMLoading from "./SMLoading.vue";
const loaded = ref(false); const loaded = ref(false);
let heroTitle = ref(""); let heroTitle = ref("");
@@ -101,6 +108,7 @@ handleLoad();
<style lang="scss"> <style lang="scss">
.hero { .hero {
display: flex;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
min-height: 700px; min-height: 700px;