2023-12-09 15:47:03 +01:00
|
|
|
<template>
|
|
|
|
|
<div class="mx-auto mb-12 max-w-7xl px-6 lg:px-8">
|
|
|
|
|
<div class="mx-auto max-w-2xl text-center">
|
2024-04-15 19:39:03 +02:00
|
|
|
<h2 class="text-lg font-semibold leading-8 tracking-tight text-blue-500">
|
2023-12-09 15:47:03 +01:00
|
|
|
Single or multi-page forms
|
|
|
|
|
</h2>
|
2024-04-15 19:39:03 +02:00
|
|
|
<p
|
|
|
|
|
class="mt-2 text-3xl font-semibold tracking-tight text-gray-900 sm:text-4xl"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Discover our beautiful templates
|
|
|
|
|
</p>
|
2024-04-15 19:39:03 +02:00
|
|
|
<p class="mt-3 px-8 text-center text-lg text-gray-400">
|
2023-12-09 15:47:03 +01:00
|
|
|
If you need inspiration, checkout our templates.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="my-3 flex justify-center">
|
2024-04-15 19:39:03 +02:00
|
|
|
<NuxtLink :to="{ name: 'templates' }">
|
2023-12-09 15:47:03 +01:00
|
|
|
See all templates
|
2024-04-15 19:39:03 +02:00
|
|
|
<svg
|
|
|
|
|
class="h-4 w-4 inline"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
viewBox="0 0 20 20"
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
fill-rule="evenodd"
|
|
|
|
|
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
|
|
|
|
|
clip-rule="evenodd"
|
2023-12-09 15:47:03 +01:00
|
|
|
/>
|
|
|
|
|
</svg>
|
2023-12-22 10:24:51 +01:00
|
|
|
</NuxtLink>
|
2023-12-09 15:47:03 +01:00
|
|
|
</div>
|
|
|
|
|
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
|
|
|
|
v-if="sliderTemplates.length > 0"
|
|
|
|
|
class="w-full inline-flex flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_128px,_black_calc(100%-128px),transparent_100%)]"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
2024-04-15 19:39:03 +02:00
|
|
|
<ul
|
|
|
|
|
ref="templates-slider"
|
|
|
|
|
class="flex justify-center md:justify-start animate-infinite-scroll"
|
|
|
|
|
>
|
|
|
|
|
<li
|
|
|
|
|
v-for="(template) in sliderTemplates"
|
|
|
|
|
:key="template.id"
|
|
|
|
|
class="mx-4 w-72 h-auto"
|
|
|
|
|
>
|
2023-12-19 18:57:31 +01:00
|
|
|
<single-template :template="template" />
|
2023-12-09 15:47:03 +01:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-04-15 19:39:03 +02:00
|
|
|
import { computed } from "vue"
|
|
|
|
|
import SingleTemplate from "../templates/SingleTemplate.vue"
|
2023-12-09 15:47:03 +01:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: { SingleTemplate },
|
2024-04-15 19:39:03 +02:00
|
|
|
setup() {
|
2023-12-09 15:47:03 +01:00
|
|
|
const templatesStore = useTemplatesStore()
|
2023-12-19 18:57:31 +01:00
|
|
|
templatesStore.initTypesAndIndustries()
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
if (templatesStore.getAll.length < 10) {
|
2024-04-15 19:39:03 +02:00
|
|
|
opnFetch("templates", { query: { limit: 10 } }).then((data) => {
|
2023-12-19 18:57:31 +01:00
|
|
|
templatesStore.set(data)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2023-12-09 15:47:03 +01:00
|
|
|
return {
|
|
|
|
|
templatesStore,
|
2023-12-19 18:57:31 +01:00
|
|
|
allLoaded: computed(() => templatesStore.allLoaded),
|
2024-04-15 19:39:03 +02:00
|
|
|
sliderTemplates: computed(() => templatesStore.getAll.slice(0, 10)),
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
watch: {
|
2023-12-19 18:57:31 +01:00
|
|
|
sliderTemplates: {
|
2023-12-09 15:47:03 +01:00
|
|
|
deep: true,
|
2024-04-15 19:39:03 +02:00
|
|
|
handler() {
|
2023-12-09 15:47:03 +01:00
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.setInfinite()
|
|
|
|
|
})
|
2024-04-15 19:39:03 +02:00
|
|
|
},
|
|
|
|
|
},
|
2023-12-09 15:47:03 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2024-04-15 19:39:03 +02:00
|
|
|
setInfinite() {
|
|
|
|
|
const ul = this.$refs["templates-slider"]
|
2023-12-09 15:47:03 +01:00
|
|
|
if (ul) {
|
2024-04-15 19:39:03 +02:00
|
|
|
ul.insertAdjacentHTML("afterend", ul.outerHTML)
|
|
|
|
|
ul.nextSibling.setAttribute("aria-hidden", "true")
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
2024-04-15 19:39:03 +02:00
|
|
|
},
|
|
|
|
|
},
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
</script>
|