2023-09-08 11:00:28 +00: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">
|
2023-10-24 09:00:54 +00:00
|
|
|
<h2 class="text-lg font-semibold leading-8 tracking-tight text-blue-500 ">
|
|
|
|
Single or multi-page forms
|
|
|
|
</h2>
|
|
|
|
<p class="mt-2 text-3xl font-semibold tracking-tight text-gray-900 sm:text-4xl">
|
|
|
|
Discover our beautiful templates
|
|
|
|
</p>
|
|
|
|
<p class="mt-3 px-8 text-center text-lg text-gray-400 ">
|
|
|
|
If you need inspiration, checkout our templates.
|
|
|
|
</p>
|
2023-09-08 11:00:28 +00:00
|
|
|
</div>
|
|
|
|
<div class="my-3 flex justify-center">
|
|
|
|
<router-link :to="{name:'templates'}">
|
|
|
|
See all templates
|
|
|
|
<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"
|
|
|
|
/>
|
|
|
|
</svg>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="templates.length > 0"
|
2023-10-24 09:00:54 +00:00
|
|
|
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-09-08 11:00:28 +00:00
|
|
|
>
|
|
|
|
<ul ref="templates-slider" class="flex justify-center md:justify-start animate-infinite-scroll">
|
2023-11-15 09:08:53 +00:00
|
|
|
<li v-for="(template, i) in sliderTemplates" :key="template.id" class="mx-4 w-72 h-auto">
|
2023-09-08 11:00:28 +00:00
|
|
|
<single-template :slug="template.slug" />
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-12-01 17:57:14 +00:00
|
|
|
import { computed } from 'vue'
|
|
|
|
import { useTemplatesStore } from '../../../stores/templates'
|
2023-09-08 11:00:28 +00:00
|
|
|
import SingleTemplate from '../templates/SingleTemplate.vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: { SingleTemplate },
|
|
|
|
props: { },
|
2023-12-01 17:57:14 +00:00
|
|
|
setup () {
|
|
|
|
const templatesStore = useTemplatesStore()
|
|
|
|
return {
|
|
|
|
templatesStore,
|
|
|
|
templates : computed(() => templatesStore.content)
|
|
|
|
}
|
|
|
|
},
|
2023-09-08 11:00:28 +00:00
|
|
|
data: () => ({}),
|
|
|
|
|
|
|
|
computed: {
|
2023-11-15 09:08:53 +00:00
|
|
|
sliderTemplates () {
|
|
|
|
return this.templates.slice(0, 20)
|
|
|
|
}
|
2023-09-08 11:00:28 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
2023-10-24 09:00:54 +00:00
|
|
|
templates: {
|
|
|
|
deep: true,
|
|
|
|
handler () {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.setInfinite()
|
|
|
|
})
|
|
|
|
}
|
2023-09-08 11:00:28 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2023-12-01 17:57:14 +00:00
|
|
|
this.templatesStore.loadAll({ limit: 20 })
|
2023-09-08 11:00:28 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-10-24 09:00:54 +00:00
|
|
|
setInfinite () {
|
|
|
|
const ul = this.$refs['templates-slider']
|
|
|
|
if (ul) {
|
2023-09-08 11:00:28 +00:00
|
|
|
ul.insertAdjacentHTML('afterend', ul.outerHTML)
|
|
|
|
ul.nextSibling.setAttribute('aria-hidden', 'true')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|