c9911cc262
New standalone apps/website (Nuxt 4) serving the public marketing site at dezky.local / www.dezky.local. The customer portal moves off the root domain to app.dezky.local only. Landing page ported from the Dezky design handoff: light theme, Danish default, hero variant A, with a working da/en toggle. Self-contained colour system threaded through components (utils/landingTokens.ts), full bilingual copy (utils/landingCopy.ts), and shared state (composables/useLanding.ts). Sections live under components/landing/* with the Node logo under components/brand/*. Wired into docker-compose (website service, volume, Traefik labels, network aliases) and bootstrap.sh (hosts list + service URLs).
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import { computed } from 'vue'
|
|
import { COPY, type Lang } from '~/utils/landingCopy'
|
|
import { makeTheme } from '~/utils/landingTokens'
|
|
|
|
// Shared landing state. `lang` is a real production toggle (da/en, both fully
|
|
// translated). `dark` is kept as machinery from the design's Tweaks panel but
|
|
// defaults to light — the primary theme the user landed on — and no toggle is
|
|
// surfaced. Flip the default (or add a control) to enable dark later.
|
|
export const useLang = () => useState<Lang>('dz-lang', () => 'da')
|
|
export const useDark = () => useState<boolean>('dz-dark', () => false)
|
|
|
|
export const useTheme = () => {
|
|
const dark = useDark()
|
|
return computed(() => makeTheme(dark.value))
|
|
}
|
|
|
|
export const useCopy = () => {
|
|
const lang = useLang()
|
|
return computed(() => COPY[lang.value === 'en' ? 'en' : 'da'])
|
|
}
|
|
|
|
export function toggleLang() {
|
|
const lang = useLang()
|
|
lang.value = lang.value === 'da' ? 'en' : 'da'
|
|
}
|
|
|
|
// Smooth-scroll to an in-page anchor, accounting for the sticky 72px nav.
|
|
// Non-anchor / placeholder links (#) are ignored.
|
|
export function scrollToAnchor(hash: string) {
|
|
if (!hash || hash === '#' || !hash.startsWith('#')) return
|
|
const el = document.getElementById(hash.slice(1))
|
|
if (!el) return
|
|
const top = el.getBoundingClientRect().top + window.scrollY - 72
|
|
window.scrollTo({ top, behavior: 'smooth' })
|
|
history.replaceState(null, '', hash)
|
|
}
|