ff-webpage/layouts/landing.vue

42 lines
1.4 KiB
Vue
Raw Normal View History

2024-10-30 14:02:47 +00:00
<template>
<div v-if="!hide_backdrop" class="relative h-[calc(100svh-6rem)] max-h-[calc(100svh-6rem)] w-full overflow-hidden">
<NuxtPicture
loading="lazy"
class="w-full h-full object-cover object-center"
:src="baseUrl + backdrop.url"
:imgAttrs="{ class: 'w-full h-full object-cover object-center' }"
/>
2024-11-10 07:29:08 +00:00
<img class="absolute p-4 max-sm:w-full sm:h-40 bottom-5" :src="baseUrl + navbar.logo.url" />
<img
class="absolute h-5 w-5 left-1/2 -translate-y-1/2 bottom-5 text-gray-400 cursor-pointer"
src="/chevrons-down.svg"
@click="scroll()"
/>
2024-11-01 13:15:09 +00:00
</div>
2024-10-30 14:02:47 +00:00
<Header />
<slot />
<Footer />
</template>
2024-11-01 13:15:09 +00:00
<script setup lang="ts">
import type Global from "../types/single/global";
import type Homepage from "../types/single/homepage";
const {
params: { slug: params },
} = useRoute();
2024-11-05 17:31:12 +00:00
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
2024-11-01 13:15:09 +00:00
const { findOne } = useStrapi();
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
const { navbar } = global.value?.data as unknown as Global;
const { data: homepage } = await useAsyncData("homepage", () => findOne<Homepage>("homepage"));
const { backdrop, hide_backdrop } = homepage.value?.data as unknown as Homepage;
function scroll() {
window.scrollTo({ top: window.innerHeight - 96, behavior: "smooth" });
}
2024-11-01 13:15:09 +00:00
</script>