feat: guest landing page: a band with the name, one line and the way in over the village full width (the core larger on phones), what sets Kronland apart in eight points with the building each is about, how a day plays, a closing call to register
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7384566f7f
commit
9bf158fff4
|
|
@ -1,53 +1,119 @@
|
|||
<script setup lang="ts">
|
||||
// The public face: the game's own village as the picture, what it is about, and the way in.
|
||||
import type { BuildingType } from '~/types/game'
|
||||
import type { SceneInset } from '~/diorama/scene'
|
||||
|
||||
// The public face for visitors: what Kronland is, the game's own village as the picture,
|
||||
// what sets it apart, how a day plays, and the way in. Logged-in players never land here:
|
||||
// auth.global sends them on to their worlds.
|
||||
const { t } = useI18n()
|
||||
const demo = demoVillage()
|
||||
const FEATURES = [
|
||||
{ key: 'space', icon: 'headquarters' },
|
||||
{ key: 'raids', icon: 'wall' },
|
||||
{ key: 'tribes', icon: 'rally_point' },
|
||||
{ key: 'crowns', icon: 'academy' },
|
||||
] as const
|
||||
|
||||
/** What sets the game apart, each shown by the building it is about. */
|
||||
const POINTS: { key: string; type: BuildingType; level: number }[] = [
|
||||
{ key: 'space', type: 'headquarters', level: 15 },
|
||||
{ key: 'roles', type: 'timber_camp', level: 15 },
|
||||
{ key: 'workers', type: 'farm', level: 15 },
|
||||
{ key: 'raiders', type: 'watchtower', level: 15 },
|
||||
{ key: 'volley', type: 'workshop', level: 15 },
|
||||
{ key: 'seasons', type: 'academy', level: 15 },
|
||||
{ key: 'tribes', type: 'rally_point', level: 1 },
|
||||
{ key: 'market', type: 'market', level: 15 },
|
||||
]
|
||||
const DAY_STEPS = 4
|
||||
|
||||
// The hero: a band with the name and the way in over the village, full width. A phone
|
||||
// is too narrow for the whole village at a readable size, so there the picture runs past
|
||||
// the sides (a negative inset) and the village core shows larger.
|
||||
const hero = ref<HTMLElement | null>(null)
|
||||
const band = ref<HTMLElement | null>(null)
|
||||
const inset = ref<SceneInset>({ top: 0, right: 0, bottom: 0, left: 0 })
|
||||
const PHONE_BLEED = 0.15
|
||||
function measure() {
|
||||
const el = band.value
|
||||
const h = hero.value
|
||||
if (!el || !h) return
|
||||
// The band lays out as a row from @3xl on and stacks only on phones.
|
||||
const bleed = getComputedStyle(el).display === 'flex' ? 0 : -Math.round(h.clientWidth * PHONE_BLEED)
|
||||
// A new inset rebuilds the scene, so only a real change sets one.
|
||||
if (inset.value.left !== bleed) inset.value = { top: 0, right: bleed, bottom: 0, left: bleed }
|
||||
}
|
||||
let observer: ResizeObserver | undefined
|
||||
onMounted(() => {
|
||||
measure()
|
||||
observer = new ResizeObserver(measure)
|
||||
if (hero.value) observer.observe(hero.value)
|
||||
})
|
||||
onBeforeUnmount(() => observer?.disconnect())
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<section class="relative h-[min(38rem,72dvh)] overflow-hidden border-b-2 border-wood-900 bg-[#74864a]">
|
||||
<div class="pointer-events-none absolute inset-0" aria-hidden="true">
|
||||
<VillageDiorama :village="demo" :seconds-until="() => 0" fill still />
|
||||
<div class="@container">
|
||||
<section ref="hero" class="border-b-2 border-wood-900">
|
||||
<div class="bg-parchment-100">
|
||||
<div ref="band" class="mx-auto max-w-[1100px] px-4 pt-5 pb-4 @3xl:flex @3xl:items-end @3xl:justify-between @3xl:gap-8 @3xl:py-6">
|
||||
<div class="min-w-0 @3xl:max-w-[38rem]">
|
||||
<h1 class="font-display text-5xl leading-none font-semibold text-wood-900 @5xl:text-6xl" style="font-variant: small-caps">{{ t('app.title') }}</h1>
|
||||
<p class="mt-3 text-lg leading-snug text-ink-900">{{ t('landing.hero.line') }}</p>
|
||||
</div>
|
||||
<div class="float absolute top-1/2 left-4 w-[min(30rem,calc(100%-2rem))] -translate-y-1/2 border-2 border-wood-900 bg-parchment-100 p-5 sm:left-10">
|
||||
<h1 class="font-display text-5xl font-semibold text-wood-900" style="font-variant: small-caps">{{ $t('app.title') }}</h1>
|
||||
<p class="mt-2 text-lg font-semibold text-blood-700">{{ $t('auth.tagline') }}</p>
|
||||
<p class="mt-3 text-sm text-ink-700">{{ $t('landing.pitch') }}</p>
|
||||
<div class="mt-5 flex flex-wrap gap-2">
|
||||
<NuxtLink to="/register" class="btn btn-primary px-5 py-2 text-base">{{ $t('landing.play') }}</NuxtLink>
|
||||
<NuxtLink to="/login" class="btn btn-outline px-5 py-2 text-base">{{ $t('landing.login') }}</NuxtLink>
|
||||
<div class="shrink-0">
|
||||
<div class="mt-5 flex flex-wrap gap-2 @3xl:mt-0">
|
||||
<NuxtLink to="/register" class="btn btn-primary px-5 py-2 text-base">{{ t('landing.cta.register') }}</NuxtLink>
|
||||
<NuxtLink to="/login" class="btn btn-outline px-5 py-2 text-base">{{ t('landing.cta.login') }}</NuxtLink>
|
||||
</div>
|
||||
<p class="mt-3 text-sm text-ink-500">{{ t('landing.hero.free') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="h-[clamp(16rem,50cqw,26rem)] border-t-2 border-wood-900 bg-[#6a7049] @3xl:h-[clamp(24rem,calc(100dvh-17rem),36rem)]"
|
||||
role="img"
|
||||
:aria-label="t('landing.hero.picture')"
|
||||
>
|
||||
<div class="h-full" inert>
|
||||
<VillageDiorama :village="demo" :seconds-until="() => 0" fill still :inset="inset" />
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-ink-500">{{ $t('landing.free') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="mx-auto grid max-w-[1100px] gap-3 px-4 py-8 sm:grid-cols-2 lg:grid-cols-4">
|
||||
<article v-for="f in FEATURES" :key="f.key" class="panel">
|
||||
<div class="panel-head justify-start gap-2">
|
||||
<IconBuildingTile :type="f.icon" class="size-7" />
|
||||
<h2 class="panel-title">{{ $t(`landing.features.${f.key}.title`) }}</h2>
|
||||
<div class="mx-auto flex max-w-[1100px] flex-col gap-4 px-3 py-6 @3xl:gap-6 @3xl:px-4 @3xl:py-8">
|
||||
<section class="panel" aria-labelledby="landing-different">
|
||||
<div class="panel-head">
|
||||
<h2 id="landing-different" class="panel-title">{{ t('landing.different.title') }}</h2>
|
||||
</div>
|
||||
<p class="panel-body text-sm">{{ $t(`landing.features.${f.key}.text`) }}</p>
|
||||
</article>
|
||||
<ul class="grid gap-px bg-parchment-300 @3xl:grid-cols-2">
|
||||
<li v-for="p in POINTS" :key="p.key" class="flex gap-3 bg-parchment-50 p-3">
|
||||
<VillagePortraitTile :type="p.type" :level="p.level" class="size-14 @3xl:size-16" />
|
||||
<div class="min-w-0">
|
||||
<h3 class="font-semibold text-wood-900">{{ t(`landing.different.${p.key}.title`) }}</h3>
|
||||
<p class="mt-0.5 text-sm text-ink-700">{{ t(`landing.different.${p.key}.text`) }}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="mx-auto max-w-[1100px] px-4 pb-10">
|
||||
<div class="panel">
|
||||
<div class="panel-head"><h2 class="panel-title">{{ $t('landing.how.title') }}</h2></div>
|
||||
<ol class="grid gap-x-6 gap-y-3 p-4 text-sm sm:grid-cols-2 lg:grid-cols-4">
|
||||
<li v-for="n in 4" :key="n" class="flex gap-3">
|
||||
<span class="grid size-8 shrink-0 place-items-center border-2 border-wood-900 bg-wood-800 font-display text-lg text-gold-400">{{ n }}</span>
|
||||
<span>{{ $t(`landing.how.step${n}`) }}</span>
|
||||
<section class="panel" aria-labelledby="landing-day">
|
||||
<div class="panel-head">
|
||||
<h2 id="landing-day" class="panel-title">{{ t('landing.day.title') }}</h2>
|
||||
</div>
|
||||
<ol class="grid gap-x-6 gap-y-3 p-3 text-sm @3xl:grid-cols-2 @3xl:p-4 @5xl:grid-cols-4">
|
||||
<li v-for="n in DAY_STEPS" :key="n" class="flex gap-3">
|
||||
<span class="grid size-8 shrink-0 place-items-center border-2 border-wood-900 bg-wood-800 font-display text-lg text-gold-400" aria-hidden="true">{{ n }}</span>
|
||||
<span>{{ t(`landing.day.step${n}`) }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section class="frame float flex flex-col gap-4 p-4 @3xl:flex-row @3xl:items-center @3xl:justify-between @3xl:p-5" aria-labelledby="landing-start">
|
||||
<div class="min-w-0">
|
||||
<h2 id="landing-start" class="font-display text-2xl font-semibold text-wood-900" style="font-variant: small-caps">{{ t('landing.start.title') }}</h2>
|
||||
<p class="mt-1 max-w-[40rem] text-sm text-ink-700">{{ t('landing.start.text') }}</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 flex-wrap gap-2">
|
||||
<NuxtLink to="/register" class="btn btn-primary px-5 py-2 text-base">{{ t('landing.cta.register') }}</NuxtLink>
|
||||
<NuxtLink to="/login" class="btn btn-outline px-5 py-2 text-base">{{ t('landing.cta.login') }}</NuxtLink>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<GameFooter />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,22 +3,60 @@ import type { TranslationFile } from '@blax-software/i18n'
|
|||
export default {
|
||||
en: {
|
||||
landing: {
|
||||
pitch: 'A browser strategy game of villages and tribes. Your village has room for only so much: decide what it becomes, hold off the raiders, make pacts or enemies, and fight for the crown forts that decide each world.',
|
||||
play: 'Play for free',
|
||||
login: 'Log in',
|
||||
free: 'Free to play in the browser. No download, no ads.',
|
||||
features: {
|
||||
space: { title: 'Room for choices', text: 'No fixed building list: a village has building space and you fill it. Ten farms or three barracks? Many camps, or one big one? Every village becomes what you make of it.' },
|
||||
raids: { title: 'Raiders at the gate', text: 'Barbarian camps gather bands against you, announced hours ahead. Build a wall and an army, or strike the camp first and take its stock.' },
|
||||
tribes: { title: 'Tribes and pacts', text: 'Found a tribe, talk in its chat, seal alliances and non-aggression pacts with others. A pact only ends after a notice period, so betrayal takes planning.' },
|
||||
crowns: { title: 'Seasons and crowns', text: 'Every world is a season. When the crown forts rise around its centre, whoever holds most of them long enough wins the world.' },
|
||||
hero: {
|
||||
line: 'A browser strategy game in the tradition of Die\u00a0Stämme (Tribal\u00a0Wars): build villages, raise armies, take land.',
|
||||
free: 'Free to play in the browser. Nothing to download.',
|
||||
picture: 'A grown village in Kronland: the headquarters on its plaza inside the wall, camps, pits and farms outside.',
|
||||
},
|
||||
how: {
|
||||
title: 'How a world plays',
|
||||
step1: 'Pick a world and where on its edge you start. Beginner protection keeps you safe for the first days.',
|
||||
step2: 'Grow your village: resources, workers, building space. The quest book shows the way.',
|
||||
step3: 'Raise an army, scout and raid barbarians, hold off their raiders, join or found a tribe.',
|
||||
step4: 'Mint coins, train noblemen, take villages, and fight for the crowns until the season ends.',
|
||||
cta: {
|
||||
register: 'Register to play',
|
||||
login: 'Log in',
|
||||
},
|
||||
different: {
|
||||
title: 'What makes Kronland different',
|
||||
space: {
|
||||
title: 'Building space, not a building list',
|
||||
text: 'A village has a fixed amount of building space, and every headquarters level adds more. You choose what fills it, and most buildings can stand more than once: a second one costs double and works at half.',
|
||||
},
|
||||
roles: {
|
||||
title: 'A farming or a military village',
|
||||
text: 'Fill the space mostly with timber camps, clay pits and iron mines, and their output rises by 20%. Mostly barracks, stables and workshops make a military village that trains 20% faster and defends with 10% more.',
|
||||
},
|
||||
workers: {
|
||||
title: 'Workers who staff and eat',
|
||||
text: 'Villagers work your buildings, and the farms feed them and your soldiers. Every soldier you train was a worker, and an army too big for its farms goes hungry and deserts.',
|
||||
},
|
||||
raiders: {
|
||||
title: 'Raiders from the barbarian camps',
|
||||
text: 'Camps nearby gather bands against your village, and you see each band hours before it marches. Beat it at the wall and it leaves resources behind, or beat the camp down first and its band scatters.',
|
||||
},
|
||||
volley: {
|
||||
title: 'Arrows before the melee',
|
||||
text: 'Archers and catapults shoot before the armies meet, the defenders from behind their wall. An attack shot to pieces has lost before the fighting starts.',
|
||||
},
|
||||
seasons: {
|
||||
title: 'Seasons with a winner',
|
||||
text: 'Every world is a season. After a month five crown forts rise round the centre of the map; whoever takes three with noblemen and holds them for a week wins, and a new world opens.',
|
||||
},
|
||||
tribes: {
|
||||
title: 'Tribes and diplomacy',
|
||||
text: "Found or join a tribe of up to 25 players with its own chat. Alliances and non-aggression pacts end only after a day's notice, so nobody is betrayed in the same breath.",
|
||||
},
|
||||
market: {
|
||||
title: 'Merchants and trade routes',
|
||||
text: 'Merchants carry wood, clay and iron between villages. Trade with other players through offers, or set a route that repeats a shipment on its own, from every ten minutes to once a week.',
|
||||
},
|
||||
},
|
||||
day: {
|
||||
title: 'How a day plays',
|
||||
step1: 'Look in for a few minutes. Buildings, recruits and marches went on while you were away, and the reports say what happened.',
|
||||
step2: 'Queue the next levels, choose which buildings get their workers first, and recruit with what is left.',
|
||||
step3: 'Scout the barbarian camp nearby, then raid it for its stock before its band comes for you.',
|
||||
step4: 'Read the tribe chat, send support to a tribe mate under attack, and start the merchants before you log off.',
|
||||
},
|
||||
start: {
|
||||
title: 'Take your first village',
|
||||
text: 'Register, pick a world and the side of the map you start on. For the first days no player can attack you, and the raiders wait too.',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue