feat(landing): add landing page layout and content
This commit is contained in:
@@ -340,7 +340,7 @@ async function deleteImage() {
|
|||||||
:src="currentPicture.url"
|
:src="currentPicture.url"
|
||||||
alt="Quest picture"
|
alt="Quest picture"
|
||||||
class="h-24 w-32 rounded object-cover"
|
class="h-24 w-32 rounded object-cover"
|
||||||
/>
|
>
|
||||||
<VaButton
|
<VaButton
|
||||||
color="danger"
|
color="danger"
|
||||||
preset="secondary"
|
preset="secondary"
|
||||||
|
|||||||
@@ -151,6 +151,22 @@
|
|||||||
"head": "PicHunt Impressum",
|
"head": "PicHunt Impressum",
|
||||||
"title": "Impressum"
|
"title": "Impressum"
|
||||||
},
|
},
|
||||||
|
"landing": {
|
||||||
|
"get_started": "Jetzt loslegen",
|
||||||
|
"hero_subtitle": "Die Foto-Schnitzeljagd für deine Gruppe. Tritt einer Hunt bei, verbünde dich mit Freunden, löse Quests mit deiner Kamera und kämpfe um den ersten Platz!",
|
||||||
|
"hero_title": "Verwandle deine Stadt in einen Spielplatz",
|
||||||
|
"how_it_works": "So funktioniert es",
|
||||||
|
"login_to_see_hunts": "Melde dich an, um deine beigetretenen Hunts zu sehen und neuen beizutreten!",
|
||||||
|
"step_number": "Schritt {n}",
|
||||||
|
"step_register_text": "Erstelle in Sekunden ein kostenloses Konto und erhalte Zugang zu allen Hunts.",
|
||||||
|
"step_register_title": "Registrieren",
|
||||||
|
"step_team_text": "Gründe ein Team mit Freunden oder tritt einem bestehenden Team mit einem Einladungscode bei.",
|
||||||
|
"step_team_title": "Team gründen",
|
||||||
|
"step_quests_text": "Erkunde die Quests, mache kreative Fotos und reiche deine Antworten ein.",
|
||||||
|
"step_quests_title": "Quests erfüllen",
|
||||||
|
"step_win_text": "Sammle Punkte, klettere die Rangliste hinauf und feiere in der Showcase.",
|
||||||
|
"step_win_title": "Punkte gewinnen"
|
||||||
|
},
|
||||||
"pictures": {
|
"pictures": {
|
||||||
"filter_quest": "Filtere Bilder nach Quests",
|
"filter_quest": "Filtere Bilder nach Quests",
|
||||||
"filter_team": "Filtere Bilder nach Teams",
|
"filter_team": "Filtere Bilder nach Teams",
|
||||||
|
|||||||
@@ -151,6 +151,22 @@
|
|||||||
"head": "PicHunt Imprint",
|
"head": "PicHunt Imprint",
|
||||||
"title": "Imprint"
|
"title": "Imprint"
|
||||||
},
|
},
|
||||||
|
"landing": {
|
||||||
|
"get_started": "Get started",
|
||||||
|
"hero_subtitle": "The photo scavenger hunt for your group. Join a hunt, team up with friends, solve quests with your camera and compete for the top spot!",
|
||||||
|
"hero_title": "Turn your city into a playground",
|
||||||
|
"how_it_works": "How it works",
|
||||||
|
"login_to_see_hunts": "Login to see your joined hunts and join new ones!",
|
||||||
|
"step_number": "Step {n}",
|
||||||
|
"step_register_text": "Create a free account in seconds and get access to all hunts.",
|
||||||
|
"step_register_title": "Register",
|
||||||
|
"step_team_text": "Team up with friends or join an existing team with an invite code.",
|
||||||
|
"step_team_title": "Form a team",
|
||||||
|
"step_quests_text": "Explore the quests, take creative photos and submit your answers.",
|
||||||
|
"step_quests_title": "Complete quests",
|
||||||
|
"step_win_text": "Collect points, climb the leaderboard and celebrate in the showcase.",
|
||||||
|
"step_win_title": "Win points"
|
||||||
|
},
|
||||||
"pictures": {
|
"pictures": {
|
||||||
"filter_quest": "Filter pictures by quests",
|
"filter_quest": "Filter pictures by quests",
|
||||||
"filter_team": "Filter pictures by teams",
|
"filter_team": "Filter pictures by teams",
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const { loggedIn, clear } = useUserSession();
|
||||||
|
const { t, locale } = useI18n();
|
||||||
|
const localePath = useLocalePath();
|
||||||
|
const route = useRoute();
|
||||||
|
const switchLocalePath = useSwitchLocalePath();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VaLayout :top="{ fixed: true, order: 2 }">
|
||||||
|
<template #top>
|
||||||
|
<VaNavbar shadowed>
|
||||||
|
<template #left>
|
||||||
|
<NuxtLink :to="localePath('/')" class="flex items-center gap-2">
|
||||||
|
<VaIcon name="photo_camera" color="primary" size="28px" />
|
||||||
|
<span class="text-xl font-bold">PicHunt</span>
|
||||||
|
</NuxtLink>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<template v-if="loggedIn">
|
||||||
|
<VaButtonGroup preset="secondary" border-color="primary" round>
|
||||||
|
<VaButton
|
||||||
|
color="info"
|
||||||
|
:to="localePath('/profile')"
|
||||||
|
icon="account_circle"
|
||||||
|
/>
|
||||||
|
<VaButton icon="logout" @click="clear" />
|
||||||
|
</VaButtonGroup>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<VaButton
|
||||||
|
preset="secondary"
|
||||||
|
:to="localePath(`/login?to=${route.path}`)"
|
||||||
|
>
|
||||||
|
{{ t('auth.login') }}
|
||||||
|
</VaButton>
|
||||||
|
<VaButton :to="localePath('/register')">
|
||||||
|
{{ t('auth.register') }}
|
||||||
|
</VaButton>
|
||||||
|
</template>
|
||||||
|
<VaButton
|
||||||
|
color="primary"
|
||||||
|
:to="switchLocalePath(locale === 'en' ? 'de' : 'en')"
|
||||||
|
icon="language"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VaNavbar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #content>
|
||||||
|
<main>
|
||||||
|
<Suspense>
|
||||||
|
<slot />
|
||||||
|
</Suspense>
|
||||||
|
</main>
|
||||||
|
</template>
|
||||||
|
</VaLayout>
|
||||||
|
</template>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+108
-18
@@ -2,24 +2,101 @@
|
|||||||
import { useI18nKey } from '~/composables/useI18nKey';
|
import { useI18nKey } from '~/composables/useI18nKey';
|
||||||
import { fullDate } from '~~/server/utils/date';
|
import { fullDate } from '~~/server/utils/date';
|
||||||
|
|
||||||
|
definePageMeta({
|
||||||
|
layout: 'landing'
|
||||||
|
});
|
||||||
|
|
||||||
const { loggedIn } = useUserSession();
|
const { loggedIn } = useUserSession();
|
||||||
const { data, pending, refresh } = await useFetch('/api/home');
|
const { data, pending, refresh } = await useFetch('/api/home');
|
||||||
const { t, d } = useI18n();
|
const { t, d } = useI18n();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
const { tKey, tSluggy } = useI18nKey();
|
const { tKey, tSluggy } = useI18nKey();
|
||||||
watch(loggedIn, () => refresh());
|
watch(loggedIn, () => refresh());
|
||||||
|
|
||||||
|
const steps = [
|
||||||
|
{ icon: 'login', key: 'step_register' },
|
||||||
|
{ icon: 'groups', key: 'step_team' },
|
||||||
|
{ icon: 'photo_camera', key: 'step_quests' },
|
||||||
|
{ icon: 'emoji_events', key: 'step_win' }
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-primary mb-3 text-3xl">{{ t('hello') }}</h1>
|
<section
|
||||||
<VaButton icon="refresh" :disabled="pending" @click="refresh">{{
|
class="from-primary to-info flex flex-col items-center gap-6 bg-gradient-to-br px-4 py-16 text-center text-white"
|
||||||
t('layouts.refresh')
|
>
|
||||||
}}</VaButton>
|
<VaIcon name="photo_camera" size="64px" />
|
||||||
|
<h1 class="max-w-3xl text-4xl font-bold md:text-5xl">
|
||||||
|
{{ t('page.landing.hero_title') }}
|
||||||
|
</h1>
|
||||||
|
<p class="max-w-2xl text-lg opacity-90">
|
||||||
|
{{ t('page.landing.hero_subtitle') }}
|
||||||
|
</p>
|
||||||
|
<div class="flex flex-wrap justify-center gap-4">
|
||||||
|
<VaButton
|
||||||
|
v-if="!loggedIn"
|
||||||
|
size="large"
|
||||||
|
color="success"
|
||||||
|
:to="localePath('/register')"
|
||||||
|
>
|
||||||
|
{{ t('page.landing.get_started') }}
|
||||||
|
</VaButton>
|
||||||
|
<VaButton
|
||||||
|
size="large"
|
||||||
|
preset="secondary"
|
||||||
|
border-color="#ffffff"
|
||||||
|
color="backgroundElement"
|
||||||
|
href="#how-it-works"
|
||||||
|
>
|
||||||
|
{{ t('page.landing.how_it_works') }}
|
||||||
|
</VaButton>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id="how-it-works" class="mx-auto max-w-5xl px-4 py-16">
|
||||||
|
<h2 class="mb-12 text-center text-3xl font-bold">
|
||||||
|
{{ t('page.landing.how_it_works') }}
|
||||||
|
</h2>
|
||||||
|
<div class="grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4">
|
||||||
|
<div
|
||||||
|
v-for="(step, index) in steps"
|
||||||
|
:key="step.key"
|
||||||
|
class="flex flex-col items-center gap-4 text-center"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="bg-primary flex h-16 w-16 items-center justify-center rounded-full text-white"
|
||||||
|
>
|
||||||
|
<VaIcon :name="step.icon" size="32px" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p class="text-primary mb-1 text-sm font-bold">
|
||||||
|
{{ t('page.landing.step_number', index + 1) }}
|
||||||
|
</p>
|
||||||
|
<h3 class="mb-2 text-lg font-bold">
|
||||||
|
{{ t(`page.landing.${step.key}_title`) }}
|
||||||
|
</h3>
|
||||||
|
<p class="text-secondary text-sm">
|
||||||
|
{{ t(`page.landing.${step.key}_text`) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="bg-background-element px-4 py-16">
|
||||||
|
<div class="mx-auto max-w-6xl">
|
||||||
|
<VaButton
|
||||||
|
icon="refresh"
|
||||||
|
:disabled="pending"
|
||||||
|
class="mb-6"
|
||||||
|
@click="refresh"
|
||||||
|
>{{ t('layouts.refresh') }}</VaButton
|
||||||
|
>
|
||||||
|
|
||||||
<div v-if="data">
|
<div v-if="data">
|
||||||
<div v-if="data.own !== null">
|
<div v-if="data.own !== null">
|
||||||
<h2 class="my-4 text-2xl font-bold">
|
<h2 class="mb-6 text-2xl font-bold">
|
||||||
{{ t('page.home.joined_hunts') }}
|
{{ t('page.home.joined_hunts') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||||
@@ -56,7 +133,9 @@ watch(loggedIn, () => refresh());
|
|||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
|
<p>
|
||||||
|
{{ t('page.home.n_teams_joined', hunt._count.teams) }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
@@ -68,18 +147,17 @@ watch(loggedIn, () => refresh());
|
|||||||
</VaCard>
|
</VaCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else class="text-center">
|
||||||
<VaButton
|
<p class="text-secondary mb-4">
|
||||||
class="mt-6"
|
{{ t('page.landing.login_to_see_hunts') }}
|
||||||
color="info"
|
</p>
|
||||||
icon="login"
|
<VaButton color="info" icon="login" :to="localePath(`/login`)">{{
|
||||||
:to="localePath(`/login`)"
|
t('page.home.login_first')
|
||||||
>{{ t('page.home.login_first') }}</VaButton
|
}}</VaButton>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-8">
|
<div class="mt-12">
|
||||||
<VaDivider />
|
<VaDivider />
|
||||||
<h2 class="my-4 text-2xl font-bold">
|
<h2 class="mb-6 mt-8 text-2xl font-bold">
|
||||||
{{ t('page.home.open_to_join') }}
|
{{ t('page.home.open_to_join') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||||
@@ -114,18 +192,30 @@ watch(loggedIn, () => refresh());
|
|||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p>{{ t('page.home.n_teams_joined', hunt._count.teams) }}</p>
|
<p>
|
||||||
|
{{ t('page.home.n_teams_joined', hunt._count.teams) }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</VaCardContent>
|
</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
<VaCard v-if="data.others.length <= 0">
|
<VaCard v-if="data.others.length <= 0">
|
||||||
<VaCardTitle>{{ t('page.home.no_hunt_created') }}</VaCardTitle>
|
<VaCardTitle>{{ t('page.home.no_hunt_created') }}</VaCardTitle>
|
||||||
<VaCardContent>{{ t('page.home.new_hunts_soon') }}</VaCardContent>
|
<VaCardContent>{{
|
||||||
|
t('page.home.new_hunts_soon')
|
||||||
|
}}</VaCardContent>
|
||||||
</VaCard>
|
</VaCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<footer class="px-4 py-8 text-center">
|
||||||
|
<NuxtLink :to="localePath('/impressum')" class="text-secondary">
|
||||||
|
{{ t('page.imprint.title') }}
|
||||||
|
</NuxtLink>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user