mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 04:46:59 +01:00
feat(evig): remove the /projects section — those are Revamp-IT's projects, not evig's
evig is a distinct org; the projects showcase (freiecomputer, ltsp, upcycling & its many subpages, hardware, compirat, linuxola, kivitendo) described Revamp-IT's work. Remove the entire marketing section: - Delete the whole /projects route tree + project-only components + data (58 files). - Remove the top-level "Projekte" nav entry + dropdown, the sitemap entry, the chatbot /projects quick-links, and a page-context that linked there. - Delete the orphaned projects.* message namespace across all 8 locales. Kept intentionally: the admin/API project-contributions backend (a generic feature, not the marketing pages) and one shared upcycling-status helper. Typecheck 0; i18n parity green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
93f4c55ec5
commit
d45f6a41da
71 files changed
+8
-27590
No files matched your search
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
-2529
File diff suppressed because it is too large.
Load diff
@@ -1,100 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { ArrowRight, CheckCircle2, Calendar } from 'lucide-react'
|
||||
import { useTranslations } from 'next-intl'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
import { DESIGN_TOKENS } from '@/lib/design/tokens'
|
||||
import type { ProjectView } from './data'
|
||||
|
||||
export function ProjectCard({ project, index = 0 }: { project: ProjectView; index?: number }) {
|
||||
const t = useTranslations('projects')
|
||||
const Icon = project.icon
|
||||
const iconBadge = DESIGN_TOKENS.iconBadges.projects
|
||||
|
||||
// Structural facts (slug/category/status/year/icon) come from the config
|
||||
// SSOT; title/description/features are the project's translatable strings.
|
||||
const { description, features } = project
|
||||
// A branded product's name is a proper noun (config SSOT), not a translated
|
||||
// string — prefer it over the locale title.
|
||||
const title = project.brandName ?? project.title
|
||||
|
||||
const cardClass = cn(
|
||||
designPrimitive.surface.card,
|
||||
'group flex flex-col animate-fade-in-up',
|
||||
'hover:border-strong transition-colors duration-200',
|
||||
'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 rounded-2xl'
|
||||
)
|
||||
const cardStyle = { animationDelay: `${index * 60}ms` }
|
||||
const aria = `${title} — ${t('learnMore')}`
|
||||
|
||||
const inner = (
|
||||
<div className="p-6 flex flex-col h-full">
|
||||
{/* Card header */}
|
||||
<div className="flex items-start gap-4 mb-4">
|
||||
<div className={cn(
|
||||
'flex h-10 w-10 shrink-0 items-center justify-center rounded-lg',
|
||||
iconBadge.bg
|
||||
)}>
|
||||
<Icon className={cn('h-5 w-5', iconBadge.text)} />
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-2 mb-1">
|
||||
<h3 className="text-base font-semibold text-text-primary truncate">
|
||||
{title}
|
||||
</h3>
|
||||
<span className={cn(
|
||||
designPrimitive.badgeBase,
|
||||
designPrimitive.badge.success
|
||||
)}>
|
||||
{t(`status.${project.status}`)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5 text-xs text-text-muted">
|
||||
<Calendar className="h-3.5 w-3.5" />
|
||||
<span>{t('since', { year: project.year })}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Description */}
|
||||
<p className="text-sm text-text-secondary mb-4 grow leading-relaxed">
|
||||
{description}
|
||||
</p>
|
||||
|
||||
{/* Features */}
|
||||
{features.length > 0 && (
|
||||
<ul className="space-y-2 mb-5">
|
||||
{features.map((feat, i) => (
|
||||
<li key={i} className="flex items-start gap-2 text-sm text-text-tertiary">
|
||||
<CheckCircle2 className="h-4 w-4 shrink-0 mt-0.5 text-action" />
|
||||
<span>{feat}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{/* Footer */}
|
||||
<div className="mt-auto pt-4 border-t border-subtle flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase tracking-wider text-text-muted">
|
||||
{t(`categories.${project.category}`)}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1.5 text-sm font-medium text-action transition-colors">
|
||||
{t('learnMore')}
|
||||
<ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-0.5" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
return project.externalHref ? (
|
||||
<a href={project.externalHref} aria-label={aria} className={cardClass} style={cardStyle}>
|
||||
{inner}
|
||||
</a>
|
||||
) : (
|
||||
<Link href={`/projects/${project.slug}`} aria-label={aria} className={cardClass} style={cardStyle}>
|
||||
{inner}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { PageHero } from '@/components/layout/PageHero'
|
||||
import { Filter, Rocket } from 'lucide-react'
|
||||
import { useTranslations } from 'next-intl'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ProjectCard } from './ProjectCard'
|
||||
import { PROJECTS, PROJECT_CATEGORIES, type ProjectCategory, type ProjectStrings } from './data'
|
||||
|
||||
export default function ProjectsPage() {
|
||||
const t = useTranslations('projects')
|
||||
|
||||
const [selectedCategory, setSelectedCategory] = useState<ProjectCategory | null>(null)
|
||||
|
||||
// Pair each project's structural config (SSOT) with its translated strings by
|
||||
// canonical index — translations carry no structural fields to corrupt.
|
||||
const strings = t.raw('items') as ProjectStrings[]
|
||||
const projects = PROJECTS.map((p, i) => ({ ...p, ...strings[i] }))
|
||||
|
||||
const filteredItems = selectedCategory
|
||||
? projects.filter(p => p.category === selectedCategory)
|
||||
: projects
|
||||
|
||||
const handleToggle = (key: ProjectCategory) => {
|
||||
setSelectedCategory(prev => (prev === key ? null : key))
|
||||
}
|
||||
|
||||
return (
|
||||
<main>
|
||||
<PageHero
|
||||
theme="projects"
|
||||
icon={Rocket}
|
||||
title={t('hero.title')}
|
||||
subtitle={t('hero.subtitle')}
|
||||
/>
|
||||
|
||||
<section className="py-12 sm:py-16 md:py-20">
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
|
||||
{/* Filter row */}
|
||||
<div className="flex flex-wrap justify-center items-center gap-2 sm:gap-3 mb-10 sm:mb-12">
|
||||
<span className="flex items-center gap-1.5 text-xs font-medium text-text-muted uppercase tracking-wider">
|
||||
<Filter className="h-3.5 w-3.5" />
|
||||
{t('filter.label')}
|
||||
</span>
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => setSelectedCategory(null)}
|
||||
className={cn(
|
||||
'px-4 py-1.5 rounded-full text-sm font-medium transition-colors',
|
||||
selectedCategory === null
|
||||
? 'bg-action text-white'
|
||||
: 'bg-surface-base text-text-secondary border border-default hover:border-strong'
|
||||
)}
|
||||
>
|
||||
{t('filter.all')}
|
||||
</Button>
|
||||
{PROJECT_CATEGORIES.map((key) => (
|
||||
<Button
|
||||
key={key}
|
||||
variant="ghost"
|
||||
onClick={() => handleToggle(key)}
|
||||
className={cn(
|
||||
'px-4 py-1.5 rounded-full text-sm font-medium transition-colors',
|
||||
selectedCategory === key
|
||||
? 'bg-action text-white'
|
||||
: 'bg-surface-base text-text-secondary border hover:border-strong dark:hover:border-white/16'
|
||||
)}
|
||||
>
|
||||
{t(`categories.${key}`)}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Projects grid */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 sm:gap-6">
|
||||
{filteredItems.map((project, index) => (
|
||||
<ProjectCard key={project.slug} project={project} index={index} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Result count */}
|
||||
<p className="text-center mt-8 text-xs text-text-muted">
|
||||
{selectedCategory === null
|
||||
? t('results', { count: filteredItems.length, total: PROJECTS.length })
|
||||
: t('resultsFiltered', {
|
||||
count: filteredItems.length,
|
||||
total: PROJECTS.length,
|
||||
category: t(`categories.${selectedCategory}`),
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Users } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string; cta1: string; cta2: string }
|
||||
about: { title: string; description: string; cards: RawCard[] }
|
||||
program: { title: string; cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('compirat') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function CompiratPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('compirat') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Users,
|
||||
ctas: [
|
||||
{ text: p.hero.cta1, href: '/get-involved/volunteer', variant: 'primary' },
|
||||
{ text: p.hero.cta2, href: '/contact', variant: 'outline' },
|
||||
],
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
title: p.about.title,
|
||||
description: p.about.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-3',
|
||||
cards: p.about.cards.map(c => ({ title: c.title, description: c.description ?? '' })),
|
||||
},
|
||||
{
|
||||
title: p.program.title,
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-2',
|
||||
cards: p.program.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: '/get-involved/volunteer', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: 'https://www.compirat.ch', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
import { Code, Globe, Layers, Users, Wrench, Server, Lightbulb, Scale } from 'lucide-react'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
|
||||
/**
|
||||
* Public projects showcase — SSOT for the language-independent structure of
|
||||
* each project.
|
||||
*
|
||||
* Only translatable strings (title / description / features) live in the
|
||||
* message files, keyed by slug under `projects.items.{slug}`. The structural
|
||||
* facts below (slug, category, status, year, icon) are NOT translatable and
|
||||
* must never be duplicated into the locale files — doing so previously let
|
||||
* translators corrupt slugs/categories (breaking /projects/{slug} links and the
|
||||
* category filter) in several locales. The page maps over this array (canonical
|
||||
* order + structure) and pulls only the translatable strings by slug.
|
||||
*/
|
||||
|
||||
export type ProjectCategory = 'software' | 'hardware' | 'community'
|
||||
export type ProjectStatus = 'active' | 'ongoing'
|
||||
|
||||
export interface ProjectConfig {
|
||||
slug: string
|
||||
category: ProjectCategory
|
||||
status: ProjectStatus
|
||||
year: string
|
||||
icon: LucideIcon
|
||||
/** For products with their own landing (e.g. Saldo): the card links here
|
||||
* instead of the /projects/{slug} detail page. Non-localized absolute path. */
|
||||
externalHref?: string
|
||||
/** A product's brand name (a proper noun — same in every language). When set,
|
||||
* it is the card title, so the name lives HERE, not scattered across the
|
||||
* locale files. Rebrand in one place. */
|
||||
brandName?: string
|
||||
}
|
||||
|
||||
/** Translatable strings for a project — `projects.items[]` (canonical order). */
|
||||
export interface ProjectStrings {
|
||||
title: string
|
||||
description: string
|
||||
features: string[]
|
||||
}
|
||||
|
||||
/** A project's config merged with its translated strings, ready to render. */
|
||||
export type ProjectView = ProjectConfig & ProjectStrings
|
||||
|
||||
/** Filter categories in display order. */
|
||||
export const PROJECT_CATEGORIES: ProjectCategory[] = ['software', 'hardware', 'community']
|
||||
|
||||
export const PROJECTS: ProjectConfig[] = [
|
||||
{ slug: 'kivitendo', category: 'software', status: 'active', year: '2015', icon: Code },
|
||||
{ slug: 'linuxola', category: 'community', status: 'active', year: '2005', icon: Globe },
|
||||
{ slug: 'freiecomputer', category: 'community', status: 'active', year: '2010', icon: Layers },
|
||||
{ slug: 'compirat', category: 'community', status: 'active', year: '2018', icon: Users },
|
||||
{ slug: 'hardware', category: 'hardware', status: 'ongoing', year: '2020', icon: Wrench },
|
||||
{ slug: 'ltsp', category: 'software', status: 'active', year: '2016', icon: Server },
|
||||
{ slug: 'upcycling', category: 'hardware', status: 'ongoing', year: '2025', icon: Lightbulb },
|
||||
{ slug: 'saldo', category: 'software', status: 'active', year: '2026', icon: Scale, externalHref: '/saldo', brandName: 'Saldo' },
|
||||
]
|
||||
@@ -1,72 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Monitor } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string; cta1: string; cta2: string }
|
||||
about: { title: string; description: string; cards: RawCard[] }
|
||||
mission: { title: string; cards: RawCard[] }
|
||||
history: { title: string; cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('freiecomputer') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function FreieComputerPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('freiecomputer') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Monitor,
|
||||
ctas: [
|
||||
{ text: p.hero.cta1, href: '/get-involved/volunteer', variant: 'primary' },
|
||||
{ text: p.hero.cta2, href: '/contact', variant: 'outline' },
|
||||
],
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
title: p.about.title,
|
||||
description: p.about.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-3',
|
||||
cards: p.about.cards.map(c => ({ title: c.title, description: c.description ?? '' })),
|
||||
},
|
||||
{
|
||||
title: p.mission.title,
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-2',
|
||||
cards: p.mission.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
title: p.history.title,
|
||||
backgroundColor: 'white',
|
||||
layout: 'single',
|
||||
cards: p.history.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: '/get-involved/volunteer', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: 'https://www.freiecomputer.ch', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Cpu } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string; cta1: string; cta2: string }
|
||||
overview: { title: string; description: string; cards: RawCard[] }
|
||||
projects: { title: string; cards: RawCard[] }
|
||||
scsi: { title: string; cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('hardware') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function HardwarePage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('hardware') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Cpu,
|
||||
ctas: [
|
||||
{ text: p.hero.cta1, href: '/get-involved/volunteer', variant: 'primary' },
|
||||
{ text: p.hero.cta2, href: '/contact', variant: 'outline' },
|
||||
],
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
title: p.overview.title,
|
||||
description: p.overview.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-3',
|
||||
cards: p.overview.cards.map(c => ({ title: c.title, description: c.description ?? '' })),
|
||||
},
|
||||
{
|
||||
title: p.projects.title,
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-2',
|
||||
cards: p.projects.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
title: p.scsi.title,
|
||||
backgroundColor: 'white',
|
||||
layout: 'single',
|
||||
cards: p.scsi.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: '/get-involved/volunteer', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: '/get-involved/donate', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Database } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string }
|
||||
why: { title: string; description: string; cards: RawCard[] }
|
||||
features: { title: string; description: string; cards: RawCard[] }
|
||||
partnership: { title: string; description: string; cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('kivitendo') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function KivitendoPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('kivitendo') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Database,
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
title: p.why.title,
|
||||
description: p.why.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-3',
|
||||
cards: p.why.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
title: p.features.title,
|
||||
description: p.features.description,
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-2',
|
||||
cards: p.features.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
title: p.partnership.title,
|
||||
description: p.partnership.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'single',
|
||||
cards: p.partnership.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: 'https://www.kivitendo.ch', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: 'https://forum.kivitendo.de/', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import type { Metadata } from 'next'
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { ORG } from '@/config/org'
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
}): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: 'projectsMeta' })
|
||||
return {
|
||||
title: {
|
||||
template: `%s | ${ORG.name} ${t('templateSuffix')}`,
|
||||
// Bare — the parent [locale] template (`%s | ORG`) appends the brand.
|
||||
// Including it here too rendered "… | Revamp-IT | Revamp-IT".
|
||||
default: t('layoutTitle'),
|
||||
},
|
||||
description: t('description'),
|
||||
}
|
||||
}
|
||||
|
||||
export default function ProjectsLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Globe } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string; cta1: string; cta2: string }
|
||||
about: { title: string; description: string }
|
||||
impact: { cards: RawCard[] }
|
||||
equipment: { title: string; cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('linuxola') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function LinuxolaPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('linuxola') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Globe,
|
||||
ctas: [
|
||||
{ text: p.hero.cta1, href: '/get-involved/donate', variant: 'primary' },
|
||||
{ text: p.hero.cta2, href: '/get-involved/volunteer', variant: 'outline' },
|
||||
],
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
title: p.about.title,
|
||||
description: p.about.description,
|
||||
backgroundColor: 'white',
|
||||
layout: 'single',
|
||||
},
|
||||
{
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-2',
|
||||
cards: p.impact.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
title: p.equipment.title,
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-3',
|
||||
cards: p.equipment.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: '/get-involved/donate', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: '/get-involved/volunteer', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { Server } from 'lucide-react'
|
||||
import { ProjectPage } from '@/components/projects'
|
||||
import type { ProjectPageConfig, RawCard, RawAction } from '@/components/projects'
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: { title: string; description: string }
|
||||
intro: { cards: RawCard[] }
|
||||
details: { cards: RawCard[] }
|
||||
start: { cards: RawCard[] }
|
||||
cta: { title: string; actions: RawAction[] }
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('ltsp') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
openGraph: { title: p.meta.title, description: p.meta.description, type: 'website' },
|
||||
}
|
||||
}
|
||||
|
||||
export default async function LTSPPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('ltsp') as PageMessages
|
||||
|
||||
const config: ProjectPageConfig = {
|
||||
hero: {
|
||||
title: p.hero.title,
|
||||
description: p.hero.description,
|
||||
icon: Server,
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-2',
|
||||
cards: p.intro.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
backgroundColor: 'gray',
|
||||
layout: 'grid-3',
|
||||
cards: p.details.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
{
|
||||
backgroundColor: 'white',
|
||||
layout: 'grid-2',
|
||||
cards: p.start.cards.map(c => ({ title: c.title, description: c.description ?? '', features: c.features })),
|
||||
},
|
||||
],
|
||||
cta: {
|
||||
title: p.cta.title,
|
||||
actions: [
|
||||
{ title: p.cta.actions[0].title, description: p.cta.actions[0].description, href: '/get-involved/volunteer', ctaText: p.cta.actions[0].cta },
|
||||
{ title: p.cta.actions[1].title, description: p.cta.actions[1].description, href: 'https://ltsp.org', ctaText: p.cta.actions[1].cta },
|
||||
{ title: p.cta.actions[2].title, description: p.cta.actions[2].description, href: '/contact', ctaText: p.cta.actions[2].cta },
|
||||
],
|
||||
},
|
||||
metadata: { title: p.meta.title, description: p.meta.description },
|
||||
}
|
||||
|
||||
return <ProjectPage config={config} />
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// force-dynamic: prevents static pre-rendering which crashes on next-auth v5 beta + webpack
|
||||
// due to React-null circular dep in SSR bundle during parallel static generation workers.
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
import ProjectsPageClient from './ProjectsPageClient'
|
||||
export default ProjectsPageClient
|
||||
@@ -1,828 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useId, useRef, useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import {
|
||||
AlertTriangle,
|
||||
Wrench,
|
||||
ArrowLeft,
|
||||
MessageSquare,
|
||||
Play,
|
||||
Pause,
|
||||
X as CloseIcon,
|
||||
ChevronRight,
|
||||
ChevronDown,
|
||||
} from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
import { MonitorLampPlaceholder } from './MonitorLampPlaceholder'
|
||||
|
||||
/**
|
||||
* Mobile-first guide renderer — shared by every model guide.
|
||||
*
|
||||
* Phone-on-bench scenario drives every interaction:
|
||||
* - photos zoom to fullscreen on tap (workbench detail unreadable otherwise)
|
||||
* - sticky progress chip with jump-to-step menu (4 screens of content)
|
||||
* - hero video is tap-to-play on small viewports (saves data)
|
||||
* - tap targets ≥44px everywhere
|
||||
* - multi-photo steps swipe horizontally on mobile (scroll-snap)
|
||||
*
|
||||
* Two inputs, separated on purpose:
|
||||
* - `data` → all human-language strings, loaded from i18n (per locale).
|
||||
* - `structure` → the language-INDEPENDENT shape (which steps sit under which
|
||||
* stage, where the schematic renders, the hero media). This
|
||||
* lives in the route's page.tsx, never in the message files —
|
||||
* structure belongs in config, not i18n (see .claude/CLAUDE.md).
|
||||
*
|
||||
* Server passes the i18n blob as `data`; rendering here is fully client-side so
|
||||
* IntersectionObserver / lightbox state work.
|
||||
*/
|
||||
|
||||
type StepImage = { src: string; alt: string }
|
||||
type Step = { n: number; title: string; body: string; images: StepImage[] }
|
||||
type Stage = { key: string; stageNumber: string; title: string; intro: string }
|
||||
|
||||
export type GuideData = {
|
||||
back: string
|
||||
eyebrow: string
|
||||
title: string
|
||||
subtitle: string
|
||||
metaLine: string
|
||||
credit: string
|
||||
safety: { title: string; body: string }
|
||||
tools: { title: string; items: string[] }
|
||||
stages: Stage[]
|
||||
steps: Step[]
|
||||
/** Omitted while a model's bridging schematic is still unverified. */
|
||||
schematic?: {
|
||||
title: string
|
||||
body: string
|
||||
labels: { v5: string; signal: string; gnd: string; resistor: string }
|
||||
}
|
||||
done: { title: string; body: string }
|
||||
feedback: { title: string; body: string; cta: string }
|
||||
ui: {
|
||||
openPhoto: string
|
||||
closePhoto: string
|
||||
playVideo: string
|
||||
pauseVideo: string
|
||||
stepProgressLabel: string
|
||||
stepProgressOf: string
|
||||
jumpToStep: string
|
||||
photoCountLabel: string
|
||||
photoCountOf: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Per-guide structure — the shape of a guide, independent of language.
|
||||
* Supplied by each route's page.tsx so one renderer serves every model.
|
||||
*/
|
||||
export type GuideStructure = {
|
||||
/** Stage `key` → ordered step numbers rendered under it. */
|
||||
stageSteps: Record<string, number[]>
|
||||
/**
|
||||
* Step number the bridging schematic attaches to, or `null` when the model
|
||||
* has no verified schematic yet (the block is simply not rendered).
|
||||
*/
|
||||
schematicAtStep: number | null
|
||||
hero: {
|
||||
/** Real poster photo. Omit → the generative placeholder is shown. */
|
||||
poster?: string
|
||||
/** Hero video. Omit → still image only (no autoplay, no play overlay). */
|
||||
video?: string
|
||||
}
|
||||
}
|
||||
|
||||
export function GuideBody({
|
||||
data,
|
||||
structure,
|
||||
}: {
|
||||
data: GuideData
|
||||
structure: GuideStructure
|
||||
}) {
|
||||
const stepsById = new Map(data.steps.map((s) => [s.n, s]))
|
||||
const totalSteps = data.steps.length
|
||||
|
||||
// Lightbox state shared across all photos
|
||||
const [lightbox, setLightbox] = useState<{
|
||||
images: StepImage[]
|
||||
activeIdx: number
|
||||
} | null>(null)
|
||||
|
||||
// Plain functions — React Compiler handles memoization, and explicit
|
||||
// useCallback here triggered "compilation skipped" lints. The deps
|
||||
// ([]) were already empty so identity is stable per render group.
|
||||
const openLightbox = (images: StepImage[], idx: number) => {
|
||||
setLightbox({ images, activeIdx: idx })
|
||||
}
|
||||
const closeLightbox = () => setLightbox(null)
|
||||
|
||||
// Sticky-progress active-step tracker via IntersectionObserver. Each
|
||||
// step `<li>` registers its ref; the one closest to the top-third of
|
||||
// the viewport wins.
|
||||
const stepRefs = useRef(new Map<number, HTMLElement>())
|
||||
const registerStep = (n: number, el: HTMLElement | null) => {
|
||||
if (el) stepRefs.current.set(n, el)
|
||||
else stepRefs.current.delete(n)
|
||||
}
|
||||
const [activeStep, setActiveStep] = useState<number>(0)
|
||||
const [progressVisible, setProgressVisible] = useState(false)
|
||||
const heroRef = useRef<HTMLElement>(null)
|
||||
const doneRef = useRef<HTMLElement>(null)
|
||||
|
||||
// Show the sticky chip only between hero and "Done!". A plain
|
||||
// scroll listener is more reliable than IntersectionObserver here
|
||||
// because we want a continuous visibility decision based on where the
|
||||
// hero's bottom edge and the "Done!" section's top edge sit relative
|
||||
// to a fixed offset from the viewport top, not just threshold crossings.
|
||||
useEffect(() => {
|
||||
const update = () => {
|
||||
const heroEl = heroRef.current
|
||||
const doneEl = doneRef.current
|
||||
if (!heroEl || !doneEl) return
|
||||
const heroBottom = heroEl.getBoundingClientRect().bottom
|
||||
const doneTop = doneEl.getBoundingClientRect().top
|
||||
// visible when hero has scrolled off-screen AND "Done!" hasn't entered the upper portion
|
||||
setProgressVisible(heroBottom < 60 && doneTop > 120)
|
||||
}
|
||||
update()
|
||||
window.addEventListener('scroll', update, { passive: true })
|
||||
window.addEventListener('resize', update, { passive: true })
|
||||
return () => {
|
||||
window.removeEventListener('scroll', update)
|
||||
window.removeEventListener('resize', update)
|
||||
}
|
||||
}, [])
|
||||
|
||||
// Track which step is the "current" one based on scroll position.
|
||||
// The observer is created ONCE on mount and observes every step
|
||||
// registered via the ref callback. Without []-deps the observer would
|
||||
// re-create on every re-render and the async callback would lose
|
||||
// races against its own cleanup, silently never updating activeStep.
|
||||
useEffect(() => {
|
||||
const obs = new IntersectionObserver(
|
||||
(entries) => {
|
||||
const visible = entries
|
||||
.filter((e) => e.isIntersecting)
|
||||
.sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)
|
||||
if (visible.length > 0) {
|
||||
const n = Number(visible[0].target.getAttribute('data-step'))
|
||||
if (!Number.isNaN(n)) setActiveStep(n)
|
||||
}
|
||||
},
|
||||
{ rootMargin: '-30% 0px -50% 0px' },
|
||||
)
|
||||
stepRefs.current.forEach((el) => obs.observe(el))
|
||||
return () => obs.disconnect()
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<article className="bg-canvas min-h-screen">
|
||||
{/* Sticky compact progress chip — only between hero and "Done!" */}
|
||||
<StepProgress
|
||||
visible={progressVisible}
|
||||
activeStep={activeStep}
|
||||
totalSteps={totalSteps}
|
||||
steps={data.steps}
|
||||
labels={data.ui}
|
||||
/>
|
||||
|
||||
{/* Hero — video FIRST on mobile (the wow element), text on top on desktop */}
|
||||
<header ref={heroRef} className="border-b border-subtle">
|
||||
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 pt-4 sm:pt-10 pb-10 sm:pb-16">
|
||||
{/* Back link with 44px tap target on phone */}
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.landing}
|
||||
className="inline-flex items-center gap-2 -ml-2 px-2 min-h-[44px] sm:min-h-[36px] py-2 text-xs font-mono uppercase tracking-[0.18em] text-text-tertiary hover:text-text-primary"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" aria-hidden="true" />
|
||||
{data.back}
|
||||
</Link>
|
||||
|
||||
{/* Mobile: video first, text below. Desktop: side-by-side, text left. */}
|
||||
<div className="mt-4 sm:mt-6 grid gap-6 sm:gap-8 md:grid-cols-[1.1fr_1fr] md:items-center">
|
||||
<GuideHero
|
||||
title={data.title}
|
||||
labels={data.ui}
|
||||
hero={structure.hero}
|
||||
className="md:order-2"
|
||||
/>
|
||||
<div className="md:order-1">
|
||||
<div className="ui-public-eyebrow">{data.eyebrow}</div>
|
||||
<h1 className="ui-public-display-md mt-3">{data.title}</h1>
|
||||
<p className="ui-public-section-lede mt-3">{data.subtitle}</p>
|
||||
<p className="ui-public-meta mt-4 font-mono tabular-nums">{data.metaLine}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="mx-auto max-w-3xl px-4 sm:px-6 lg:px-8 py-10 sm:py-16">
|
||||
{/* Safety callout */}
|
||||
<aside
|
||||
role="note"
|
||||
className="rounded-lg border border-warning-300 bg-warning-50 dark:bg-warning-950/40 p-5 flex gap-4"
|
||||
>
|
||||
<AlertTriangle
|
||||
className="w-5 h-5 shrink-0 text-warning-700 dark:text-warning-300 mt-0.5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-warning-900 dark:text-warning-100">
|
||||
{data.safety.title}
|
||||
</h2>
|
||||
<p className="text-sm text-warning-800 dark:text-warning-200 mt-1">
|
||||
{data.safety.body}
|
||||
</p>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
{/* Tools */}
|
||||
<section className="mt-10">
|
||||
<h2 className="ui-public-eyebrow">
|
||||
<Wrench className="w-3.5 h-3.5 inline-block mr-2" aria-hidden="true" />
|
||||
{data.tools.title}
|
||||
</h2>
|
||||
<ul className="mt-3 grid sm:grid-cols-2 gap-y-1.5 gap-x-6 text-sm text-text-secondary">
|
||||
{data.tools.items.map((tool, i) => (
|
||||
<li key={i} className="flex gap-2">
|
||||
<span className="font-mono text-text-tertiary">·</span>
|
||||
{tool}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
{/* Stages → steps */}
|
||||
{data.stages.map((stage) => {
|
||||
const stepNums = structure.stageSteps[stage.key] ?? []
|
||||
return (
|
||||
<section key={stage.key} className="mt-14">
|
||||
<header className="border-b border-subtle pb-4">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-action">
|
||||
{stage.stageNumber}
|
||||
</div>
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-text-primary mt-2">
|
||||
{stage.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-2">{stage.intro}</p>
|
||||
</header>
|
||||
|
||||
<ol className="mt-8 space-y-12">
|
||||
{stepNums.map((n) => {
|
||||
const step = stepsById.get(n)
|
||||
if (!step) return null
|
||||
return (
|
||||
<li
|
||||
key={step.n}
|
||||
id={`step-${step.n}`}
|
||||
data-step={step.n}
|
||||
ref={(el) => registerStep(step.n, el)}
|
||||
// min-w-0 + the inner min-w-0 below are REQUIRED so the
|
||||
// step's right column (which contains the photo carousel
|
||||
// with `w-[85vw]` items) can shrink. Without it, the
|
||||
// carousel's flex children force the grid wider than the
|
||||
// viewport on mobile.
|
||||
className="grid min-w-0 sm:grid-cols-[auto_1fr] gap-3 sm:gap-6 scroll-mt-20"
|
||||
>
|
||||
<span
|
||||
className="font-mono text-3xl sm:text-4xl font-light tabular-nums text-text-tertiary leading-none pt-0.5"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{String(step.n).padStart(2, '0')}
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<h3 className="text-lg sm:text-xl font-semibold text-text-primary">
|
||||
{step.title}
|
||||
</h3>
|
||||
<p className="text-sm sm:text-base text-text-secondary mt-2 leading-relaxed">
|
||||
{step.body}
|
||||
</p>
|
||||
|
||||
{step.images.length > 0 && (
|
||||
<StepPhotoGroup
|
||||
images={step.images}
|
||||
onOpen={openLightbox}
|
||||
labels={data.ui}
|
||||
/>
|
||||
)}
|
||||
|
||||
{structure.schematicAtStep === step.n && data.schematic && (
|
||||
<div className="mt-6 rounded-lg border border-subtle bg-surface-raised p-5">
|
||||
<h4 className="text-sm font-semibold text-text-primary">
|
||||
{data.schematic.title}
|
||||
</h4>
|
||||
<p className="text-sm text-text-secondary mt-2">
|
||||
{data.schematic.body}
|
||||
</p>
|
||||
<CircuitDiagram labels={data.schematic.labels} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
</section>
|
||||
)
|
||||
})}
|
||||
|
||||
{/* Done */}
|
||||
<section ref={doneRef} className="mt-16 border-t border-subtle pt-10">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-text-primary">
|
||||
{data.done.title}
|
||||
</h2>
|
||||
<p className="text-sm sm:text-base text-text-secondary mt-3 max-w-prose">
|
||||
{data.done.body}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
{/* Feedback */}
|
||||
<section className="mt-12 rounded-lg border border-subtle p-6">
|
||||
<div className="flex items-start gap-4">
|
||||
<MessageSquare
|
||||
className="w-5 h-5 shrink-0 text-action mt-0.5"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div className="flex-1">
|
||||
<h2 className="text-sm font-semibold text-text-primary">
|
||||
{data.feedback.title}
|
||||
</h2>
|
||||
<p className="text-sm text-text-secondary mt-1">{data.feedback.body}</p>
|
||||
<Link
|
||||
href="/contact"
|
||||
className="mt-4 inline-flex items-center justify-center gap-2 h-11 px-5 rounded-lg border border-default text-sm font-medium hover:bg-surface-raised transition-colors"
|
||||
>
|
||||
{data.feedback.cta}
|
||||
<ChevronRight className="w-4 h-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<p className="mt-10 text-xs font-mono text-text-tertiary">{data.credit}</p>
|
||||
</div>
|
||||
|
||||
{/* Fullscreen lightbox overlay */}
|
||||
{lightbox && (
|
||||
<Lightbox
|
||||
images={lightbox.images}
|
||||
activeIdx={lightbox.activeIdx}
|
||||
onClose={closeLightbox}
|
||||
onChangeIdx={(i) => setLightbox({ ...lightbox, activeIdx: i })}
|
||||
labels={data.ui}
|
||||
/>
|
||||
)}
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── GuideHero ──────────────────────────────────────────────────────
|
||||
* Three render modes, picked from `structure.hero`:
|
||||
* - video present → poster + tap-to-play on mobile, autoplay-muted-loop on
|
||||
* desktop (the published-guide experience).
|
||||
* - poster only → still image (a finished guide without footage yet).
|
||||
* - neither → generative MonitorLampPlaceholder (draft guides).
|
||||
* Always renders the poster server-side so first paint matches.
|
||||
*/
|
||||
function GuideHero({
|
||||
title,
|
||||
labels,
|
||||
hero,
|
||||
className = '',
|
||||
}: {
|
||||
title: string
|
||||
labels: GuideData['ui']
|
||||
hero: GuideStructure['hero']
|
||||
className?: string
|
||||
}) {
|
||||
const ref = useRef<HTMLVideoElement>(null)
|
||||
const [playing, setPlaying] = useState(false)
|
||||
const [isMobile, setIsMobile] = useState(false)
|
||||
// Tracks whether the user has ever started this video. Used to decide
|
||||
// whether the giant play-overlay shows again after a pause: yes on
|
||||
// mobile (poster-first), no on desktop once it's played at least once.
|
||||
const [hasPlayed, setHasPlayed] = useState(false)
|
||||
|
||||
const hasVideo = Boolean(hero.video)
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasVideo) return
|
||||
const mq = window.matchMedia('(max-width: 768px)')
|
||||
setIsMobile(mq.matches)
|
||||
const v = ref.current
|
||||
if (!v) return
|
||||
if (!mq.matches) {
|
||||
// Desktop: kick off autoplay after mount
|
||||
v.muted = true
|
||||
v.loop = true
|
||||
v.play()
|
||||
.then(() => {
|
||||
setPlaying(true)
|
||||
setHasPlayed(true)
|
||||
})
|
||||
.catch(() => setPlaying(false))
|
||||
}
|
||||
}, [hasVideo])
|
||||
|
||||
// No video yet: a still poster, or the generative placeholder for drafts
|
||||
// that have neither finished footage nor a poster photo.
|
||||
if (!hasVideo) {
|
||||
return (
|
||||
<div
|
||||
className={`relative aspect-[4/3] w-full overflow-hidden rounded-lg border border-subtle bg-surface-raised ${className}`}
|
||||
>
|
||||
{hero.poster ? (
|
||||
<Image
|
||||
src={hero.poster}
|
||||
alt={title}
|
||||
fill
|
||||
sizes="(min-width: 768px) 50vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
) : (
|
||||
<MonitorLampPlaceholder
|
||||
variant="warm"
|
||||
className="absolute inset-0 h-full w-full"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const toggle = () => {
|
||||
const v = ref.current
|
||||
if (!v) return
|
||||
if (v.paused) {
|
||||
v.play()
|
||||
.then(() => {
|
||||
setPlaying(true)
|
||||
setHasPlayed(true)
|
||||
})
|
||||
.catch(() => {})
|
||||
} else {
|
||||
v.pause()
|
||||
setPlaying(false)
|
||||
}
|
||||
}
|
||||
|
||||
const showOverlay = !playing && (isMobile || !hasPlayed)
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`relative aspect-[4/3] w-full overflow-hidden rounded-lg border border-subtle bg-surface-raised ${className}`}
|
||||
>
|
||||
<video
|
||||
ref={ref}
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
poster={hero.poster}
|
||||
src={hero.video}
|
||||
playsInline
|
||||
muted
|
||||
loop
|
||||
preload="none"
|
||||
aria-label={title}
|
||||
/>
|
||||
{showOverlay && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={toggle}
|
||||
className="absolute inset-0 flex h-auto w-full items-center justify-center rounded-none bg-black/20 backdrop-blur-[1px] transition-colors hover:bg-black/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white"
|
||||
aria-label={labels.playVideo}
|
||||
>
|
||||
<span className="flex items-center justify-center w-16 h-16 rounded-full bg-surface-base/90 text-text-primary shadow-xs">
|
||||
<Play className="w-7 h-7 ml-0.5 fill-current" aria-hidden="true" />
|
||||
</span>
|
||||
</Button>
|
||||
)}
|
||||
{playing && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={toggle}
|
||||
className="absolute bottom-2 right-2 flex h-11 w-11 items-center justify-center rounded-full bg-black/40 p-0 text-white opacity-0 hover:opacity-100 focus:opacity-100 transition-opacity"
|
||||
aria-label={labels.pauseVideo}
|
||||
>
|
||||
<Pause className="w-4 h-4 fill-current" aria-hidden="true" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── StepPhotoGroup ─────────────────────────────────────────────────
|
||||
* Multi-photo steps: horizontal scroll-snap carousel on mobile (one
|
||||
* photo at a time, 85vw wide so a sliver of the next photo peeks in),
|
||||
* grid on ≥sm. Each photo is a button that opens the lightbox.
|
||||
*/
|
||||
function StepPhotoGroup({
|
||||
images,
|
||||
onOpen,
|
||||
labels,
|
||||
}: {
|
||||
images: StepImage[]
|
||||
onOpen: (imgs: StepImage[], idx: number) => void
|
||||
labels: GuideData['ui']
|
||||
}) {
|
||||
const single = images.length === 1
|
||||
const isMulti = images.length > 1
|
||||
|
||||
return (
|
||||
<div className="mt-5">
|
||||
<div
|
||||
className={
|
||||
isMulti
|
||||
? // Mobile: snap-x scrollable. ≥sm: regular grid.
|
||||
`-mx-4 px-4 flex gap-3 overflow-x-auto snap-x snap-mandatory pb-2 ` +
|
||||
`sm:mx-0 sm:px-0 sm:overflow-visible sm:snap-none sm:grid sm:gap-3 ` +
|
||||
(images.length === 2 ? 'sm:grid-cols-2' : 'sm:grid-cols-2 lg:grid-cols-3')
|
||||
: 'grid grid-cols-1'
|
||||
}
|
||||
>
|
||||
{images.map((img, i) => (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
key={img.src}
|
||||
onClick={() => onOpen(images, i)}
|
||||
aria-label={
|
||||
isMulti
|
||||
? `${labels.openPhoto} — ${labels.photoCountLabel} ${i + 1} ${labels.photoCountOf} ${images.length}`
|
||||
: labels.openPhoto
|
||||
}
|
||||
className={
|
||||
(isMulti ? 'shrink-0 w-[85vw] snap-start sm:w-auto sm:shrink ' : '') +
|
||||
'relative block h-auto aspect-[16/10] overflow-hidden rounded-md border border-subtle bg-surface-raised p-0 hover:border-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action transition-colors'
|
||||
}
|
||||
>
|
||||
<Image
|
||||
src={img.src}
|
||||
alt={img.alt}
|
||||
fill
|
||||
sizes={
|
||||
single
|
||||
? '(min-width: 768px) 720px, 100vw'
|
||||
: '(min-width: 1024px) 240px, (min-width: 640px) 33vw, 85vw'
|
||||
}
|
||||
className="object-cover"
|
||||
/>
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
{isMulti && (
|
||||
<p className="sm:hidden mt-2 text-xs font-mono text-text-tertiary text-center">
|
||||
{images.length} {labels.photoCountOf === 'von' ? 'Fotos' : 'photos'} · ← →
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Lightbox ───────────────────────────────────────────────────────
|
||||
* Fullscreen overlay with the original image at native resolution.
|
||||
* Closes on ESC, tap outside, or close button. Arrow keys / swipe
|
||||
* change photos when the source step had multiple.
|
||||
*/
|
||||
function Lightbox({
|
||||
images,
|
||||
activeIdx,
|
||||
onClose,
|
||||
onChangeIdx,
|
||||
labels,
|
||||
}: {
|
||||
images: StepImage[]
|
||||
activeIdx: number
|
||||
onClose: () => void
|
||||
onChangeIdx: (i: number) => void
|
||||
labels: GuideData['ui']
|
||||
}) {
|
||||
const current = images[activeIdx]
|
||||
const hasMany = images.length > 1
|
||||
const dialogRef = useRef<HTMLDivElement>(null)
|
||||
const labelId = useId()
|
||||
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose()
|
||||
else if (hasMany && e.key === 'ArrowRight')
|
||||
onChangeIdx((activeIdx + 1) % images.length)
|
||||
else if (hasMany && e.key === 'ArrowLeft')
|
||||
onChangeIdx((activeIdx - 1 + images.length) % images.length)
|
||||
}
|
||||
document.addEventListener('keydown', onKey)
|
||||
// Lock body scroll while open
|
||||
const prevOverflow = document.body.style.overflow
|
||||
document.body.style.overflow = 'hidden'
|
||||
return () => {
|
||||
document.removeEventListener('keydown', onKey)
|
||||
document.body.style.overflow = prevOverflow
|
||||
}
|
||||
}, [activeIdx, hasMany, images.length, onChangeIdx, onClose])
|
||||
|
||||
// Swipe-to-change on touch devices
|
||||
const touchStartX = useRef<number | null>(null)
|
||||
const onTouchStart = (e: React.TouchEvent) => {
|
||||
touchStartX.current = e.touches[0].clientX
|
||||
}
|
||||
const onTouchEnd = (e: React.TouchEvent) => {
|
||||
if (touchStartX.current === null || !hasMany) return
|
||||
const dx = e.changedTouches[0].clientX - touchStartX.current
|
||||
if (Math.abs(dx) > 50) {
|
||||
if (dx < 0) onChangeIdx((activeIdx + 1) % images.length)
|
||||
else onChangeIdx((activeIdx - 1 + images.length) % images.length)
|
||||
}
|
||||
touchStartX.current = null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={dialogRef}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby={labelId}
|
||||
className="fixed inset-0 z-50 bg-black/95 flex flex-col"
|
||||
onClick={(e) => {
|
||||
if (e.target === dialogRef.current) onClose()
|
||||
}}
|
||||
onTouchStart={onTouchStart}
|
||||
onTouchEnd={onTouchEnd}
|
||||
>
|
||||
<header className="flex items-center justify-between px-4 py-3 text-white">
|
||||
<span id={labelId} className="text-sm font-medium">
|
||||
{hasMany ? `${labels.photoCountLabel} ${activeIdx + 1} ${labels.photoCountOf} ${images.length}` : ''}
|
||||
</span>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={onClose}
|
||||
aria-label={labels.closePhoto}
|
||||
className="flex h-11 w-11 items-center justify-center rounded-full bg-text-inverted/10 p-0 text-white hover:bg-text-inverted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-text-inverted"
|
||||
>
|
||||
<CloseIcon className="w-5 h-5" aria-hidden="true" />
|
||||
</Button>
|
||||
</header>
|
||||
|
||||
<div className="flex-1 flex items-center justify-center p-4 sm:p-8">
|
||||
<div className="relative w-full h-full max-w-5xl">
|
||||
{/* Use a plain <img> here — we want the full source resolution,
|
||||
not the Next/Image optimizer's downscale. */}
|
||||
{ }
|
||||
<img
|
||||
src={current.src}
|
||||
alt={current.alt}
|
||||
className="absolute inset-0 m-auto max-w-full max-h-full object-contain"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Dot indicator for multi-photo */}
|
||||
{hasMany && (
|
||||
<div className="flex items-center justify-center gap-2 py-4">
|
||||
{images.map((_, i) => (
|
||||
<Button
|
||||
key={i}
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={() => onChangeIdx(i)}
|
||||
className={`h-2 min-h-0 rounded-full p-0 transition-all ${
|
||||
i === activeIdx ? 'w-6 bg-text-inverted' : 'w-2 bg-text-inverted/40'
|
||||
}`}
|
||||
aria-label={`${labels.photoCountLabel} ${i + 1}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Alt text caption */}
|
||||
<p className="px-6 pb-6 text-center text-xs sm:text-sm text-white/70 max-w-2xl mx-auto">
|
||||
{current.alt}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── StepProgress (sticky chip) ─────────────────────────────────────
|
||||
* Small floating chip "Step N of M" while inside the steps zone. Tap
|
||||
* to open a jump menu listing all steps with anchors.
|
||||
*/
|
||||
function StepProgress({
|
||||
visible,
|
||||
activeStep,
|
||||
totalSteps,
|
||||
steps,
|
||||
labels,
|
||||
}: {
|
||||
visible: boolean
|
||||
activeStep: number
|
||||
totalSteps: number
|
||||
steps: Step[]
|
||||
labels: GuideData['ui']
|
||||
}) {
|
||||
const [open, setOpen] = useState(false)
|
||||
// Close menu when active step changes (user scrolled past it)
|
||||
useEffect(() => {
|
||||
setOpen(false)
|
||||
}, [activeStep])
|
||||
|
||||
if (!visible || activeStep === 0) return null
|
||||
|
||||
return (
|
||||
<div className="fixed top-3 left-1/2 -translate-x-1/2 z-40 sm:top-4">
|
||||
<div className="relative">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={() => setOpen((o) => !o)}
|
||||
className="flex h-11 items-center gap-2 rounded-full border border-default bg-surface-base px-4 text-sm font-medium text-text-primary shadow-xs backdrop-blur-sm hover:border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action"
|
||||
aria-expanded={open}
|
||||
aria-label={labels.jumpToStep}
|
||||
>
|
||||
<span className="font-mono tabular-nums text-text-tertiary text-xs">
|
||||
{labels.stepProgressLabel} {activeStep} {labels.stepProgressOf} {totalSteps}
|
||||
</span>
|
||||
<ChevronDown
|
||||
className={`w-4 h-4 text-text-tertiary transition-transform ${open ? 'rotate-180' : ''}`}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Button>
|
||||
|
||||
{open && (
|
||||
<div
|
||||
className="absolute top-full left-1/2 -translate-x-1/2 mt-2 w-72 rounded-lg bg-surface-base border border-default shadow-xs py-2"
|
||||
role="menu"
|
||||
>
|
||||
{steps.map((s) => (
|
||||
<a
|
||||
key={s.n}
|
||||
href={`#step-${s.n}`}
|
||||
onClick={() => setOpen(false)}
|
||||
className={`flex items-center gap-3 px-4 py-3 text-sm hover:bg-surface-raised ${
|
||||
s.n === activeStep ? 'text-action font-medium' : 'text-text-primary'
|
||||
}`}
|
||||
>
|
||||
<span className="font-mono tabular-nums text-text-tertiary text-xs w-6">
|
||||
{String(s.n).padStart(2, '0')}
|
||||
</span>
|
||||
<span className="truncate">{s.title}</span>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── CircuitDiagram ─────────────────────────────────────────────────
|
||||
* Voltage divider: 5V → 1kΩ → Backlight → 1kΩ → GND. Inline SVG so it
|
||||
* inherits the page color scheme and works in dark mode for free.
|
||||
*
|
||||
* NOTE: this draws the Lenovo L2251pwd two-resistor voltage divider. Other
|
||||
* models bridge different pins — when a new model's schematic is verified,
|
||||
* give it its own diagram rather than reusing this one.
|
||||
*/
|
||||
function CircuitDiagram({
|
||||
labels,
|
||||
}: {
|
||||
labels: { v5: string; signal: string; gnd: string; resistor: string }
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 320 140"
|
||||
className="mt-4 w-full max-w-md text-text-primary"
|
||||
role="img"
|
||||
aria-label={`${labels.v5} → ${labels.resistor} → ${labels.signal} → ${labels.resistor} → ${labels.gnd}`}
|
||||
>
|
||||
<g fill="none" stroke="currentColor" strokeWidth="1.5">
|
||||
<line
|
||||
x1="10" y1="35" x2="100" y2="35"
|
||||
className="text-error-600" stroke="currentColor" strokeWidth="2.5"
|
||||
/>
|
||||
<polyline points="100,35 108,25 120,45 132,25 144,45 156,25 168,35" stroke="currentColor" />
|
||||
<line x1="168" y1="35" x2="168" y2="70" />
|
||||
<line
|
||||
x1="168" y1="70" x2="240" y2="70"
|
||||
className="text-warning-600" stroke="currentColor" strokeWidth="2.5"
|
||||
/>
|
||||
<line x1="168" y1="70" x2="168" y2="105" />
|
||||
<polyline points="168,105 156,115 144,95 132,115 120,95 108,115 100,105" stroke="currentColor" />
|
||||
<line x1="10" y1="105" x2="100" y2="105" stroke="currentColor" strokeWidth="2.5" />
|
||||
</g>
|
||||
<g fontFamily="ui-monospace, monospace" fontSize="11" fill="currentColor">
|
||||
<text x="10" y="25">{labels.v5}</text>
|
||||
<text x="245" y="74">{labels.signal}</text>
|
||||
<text x="10" y="125">{labels.gnd}</text>
|
||||
<text x="100" y="22" fontSize="10">{labels.resistor}</text>
|
||||
<text x="100" y="125" fontSize="10">{labels.resistor}</text>
|
||||
</g>
|
||||
<g fill="currentColor">
|
||||
<circle cx="168" cy="35" r="3" />
|
||||
<circle cx="168" cy="105" r="3" />
|
||||
<circle cx="168" cy="70" r="3" />
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
/**
|
||||
* MonitorLampPlaceholder — generative SVG placeholder for the Monitor-Upcycling
|
||||
* mini-site, used until real product photography is available.
|
||||
*
|
||||
* Renders a stylised monitor-as-lamp: a flat-screen silhouette with a soft
|
||||
* radial glow at the panel area, mounted on a thin stand, on top of a
|
||||
* gradient background that varies by `variant`. The whole thing inherits
|
||||
* the page's color tokens so it works in both light and dark mode without
|
||||
* any media-query overrides.
|
||||
*
|
||||
* Variants encode the spectrum the project lives on:
|
||||
* functional — cool neutral grey, office/utility feel
|
||||
* warm — warm amber, home/café decor
|
||||
* cool — cool teal, gallery/installation
|
||||
* art — saturated magenta/violet, art object
|
||||
*
|
||||
* Each instance is stable for a given (variant, seed) pair: the dot
|
||||
* pattern offsets and glow radius are derived from `seed` so a grid of
|
||||
* placeholders looks varied rather than copy-pasted.
|
||||
*/
|
||||
|
||||
type Variant = 'functional' | 'warm' | 'cool' | 'art'
|
||||
import { MONITOR_LAMP_PLACEHOLDER_COLORS as COLORS } from '@/config/ui-colors'
|
||||
|
||||
interface MonitorLampPlaceholderProps {
|
||||
variant?: Variant
|
||||
/** Used to vary glow position/intensity across a grid. Same seed → same image. */
|
||||
seed?: number
|
||||
/** Caption rendered beneath the monitor — short context label. */
|
||||
caption?: string
|
||||
className?: string
|
||||
}
|
||||
|
||||
const PALETTE: Record<Variant, { from: string; to: string; glow: string }> = COLORS
|
||||
|
||||
export function MonitorLampPlaceholder({
|
||||
variant = 'functional',
|
||||
seed = 0,
|
||||
caption,
|
||||
className,
|
||||
}: MonitorLampPlaceholderProps) {
|
||||
const p = PALETTE[variant]
|
||||
// Deterministic pseudo-random per seed — keeps every card stable across SSR.
|
||||
const jitter = ((seed * 9301 + 49297) % 233280) / 233280
|
||||
const glowX = 50 + (jitter - 0.5) * 8
|
||||
const glowR = 18 + jitter * 6
|
||||
|
||||
const gradId = `lamp-bg-${variant}-${seed}`
|
||||
const glowId = `lamp-glow-${variant}-${seed}`
|
||||
const dotId = `lamp-dot-${variant}-${seed}`
|
||||
|
||||
return (
|
||||
<figure className={className}>
|
||||
<svg
|
||||
viewBox="0 0 400 300"
|
||||
className="block h-full w-full"
|
||||
role="img"
|
||||
aria-label={caption ?? 'Monitor-Leuchte Platzhalter'}
|
||||
preserveAspectRatio="xMidYMid slice"
|
||||
>
|
||||
<defs>
|
||||
<linearGradient id={gradId} x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stopColor={p.from} />
|
||||
<stop offset="100%" stopColor={p.to} />
|
||||
</linearGradient>
|
||||
<radialGradient id={glowId} cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0%" stopColor={p.glow} stopOpacity="0.95" />
|
||||
<stop offset="40%" stopColor={p.glow} stopOpacity="0.55" />
|
||||
<stop offset="100%" stopColor={p.glow} stopOpacity="0" />
|
||||
</radialGradient>
|
||||
<pattern
|
||||
id={dotId}
|
||||
x="0"
|
||||
y="0"
|
||||
width="14"
|
||||
height="14"
|
||||
patternUnits="userSpaceOnUse"
|
||||
>
|
||||
<circle cx="1" cy="1" r="0.5" fill={p.glow} fillOpacity="0.08" />
|
||||
</pattern>
|
||||
</defs>
|
||||
|
||||
<rect width="400" height="300" fill={`url(#${gradId})`} />
|
||||
<rect width="400" height="300" fill={`url(#${dotId})`} />
|
||||
|
||||
{/* Ambient glow behind monitor — sells the "this is a light" idea */}
|
||||
<circle
|
||||
cx={`${glowX}%`}
|
||||
cy="45%"
|
||||
r={`${glowR}%`}
|
||||
fill={`url(#${glowId})`}
|
||||
/>
|
||||
|
||||
{/* Monitor bezel */}
|
||||
<g transform="translate(110, 70)">
|
||||
<rect width="180" height="120" rx="4" fill={COLORS.bezel} />
|
||||
{/* Screen (the light surface) */}
|
||||
<rect x="6" y="6" width="168" height="108" rx="2" fill={p.glow} fillOpacity="0.85" />
|
||||
<rect x="6" y="6" width="168" height="108" rx="2" fill={`url(#${glowId})`} />
|
||||
{/* Subtle bezel highlight */}
|
||||
<rect width="180" height="120" rx="4" fill="none" stroke={COLORS.highlight} strokeOpacity="0.08" />
|
||||
</g>
|
||||
|
||||
{/* Stand */}
|
||||
<g transform="translate(180, 190)">
|
||||
<rect width="40" height="10" rx="1" fill={COLORS.stand} />
|
||||
<rect x="-30" y="10" width="100" height="6" rx="1" fill={COLORS.stand} />
|
||||
</g>
|
||||
|
||||
{/* Floor line — anchors the composition */}
|
||||
<line
|
||||
x1="0"
|
||||
y1="220"
|
||||
x2="400"
|
||||
y2="220"
|
||||
stroke={COLORS.highlight}
|
||||
strokeOpacity="0.06"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
{caption && (
|
||||
<figcaption className="mt-2 font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{caption}
|
||||
</figcaption>
|
||||
)}
|
||||
</figure>
|
||||
)
|
||||
}
|
||||
|
||||
export type { Variant as MonitorLampPlaceholderVariant }
|
||||
@@ -1,42 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { usePathname } from '@/i18n/navigation'
|
||||
import { UPCYCLING_INTEREST_SKIP_PATHS } from '@/config/upcycling-routes'
|
||||
import { UpcyclingInterestCTA } from './UpcyclingInterestCTA'
|
||||
|
||||
interface UpcyclingInterestBandProps {
|
||||
eyebrow: string
|
||||
heading: string
|
||||
body: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Compact interest signup on sub-pages — landing already has a full section.
|
||||
*/
|
||||
export function UpcyclingInterestBand({
|
||||
eyebrow,
|
||||
heading,
|
||||
body,
|
||||
}: UpcyclingInterestBandProps) {
|
||||
const pathname = usePathname()
|
||||
if (UPCYCLING_INTEREST_SKIP_PATHS.has(pathname)) return null
|
||||
|
||||
return (
|
||||
<aside
|
||||
aria-labelledby="upcycling-interest-band-title"
|
||||
className="border-t border-subtle bg-surface-raised"
|
||||
>
|
||||
<div className="mx-auto max-w-3xl px-4 py-10 text-center sm:px-6 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{eyebrow}</div>
|
||||
<p
|
||||
id="upcycling-interest-band-title"
|
||||
className="mt-3 text-lg font-semibold text-text-primary sm:text-xl"
|
||||
>
|
||||
{heading}
|
||||
</p>
|
||||
<p className="mt-2 text-sm text-text-secondary">{body}</p>
|
||||
<UpcyclingInterestCTA className="mt-6 max-w-md mx-auto" />
|
||||
</div>
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { useSession } from 'next-auth/react'
|
||||
import { useTranslations } from 'next-intl'
|
||||
import { CheckCircle2 } from 'lucide-react'
|
||||
import { apiFetch } from '@/lib/api/client'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
|
||||
/**
|
||||
* Auth-aware "follow the project" CTA for the Monitor-Upcycling mini-site.
|
||||
*
|
||||
* Two states keyed on session:
|
||||
* - Authenticated → one button. We already know their email, so it's
|
||||
* a single click to subscribe with source='upcycling-interest'.
|
||||
* A small caption echoes which address we'll use so
|
||||
* they aren't surprised.
|
||||
* - Anonymous → standard email input + submit. Same endpoint.
|
||||
*
|
||||
* Posts to /api/newsletter/subscribe (existing endpoint). source field
|
||||
* keeps the funnel attributable in analytics. No new persistence layer,
|
||||
* no new schema — KISS, DRY.
|
||||
*/
|
||||
export function UpcyclingInterestCTA({ className = '' }: { className?: string }) {
|
||||
// TS type cache flakes on the deep nested namespace; pull from `projects`
|
||||
// root and prefix every key. Same workaround used elsewhere in this repo.
|
||||
const tRoot = useTranslations('projects')
|
||||
const t = (
|
||||
key: string,
|
||||
args?: Record<string, string | number>,
|
||||
): string => tRoot(`upcycling.interestCta.${key}` as never, args as never)
|
||||
const { data: session, status: sessionStatus } = useSession()
|
||||
const sessionEmail = session?.user?.email ?? null
|
||||
const sessionName = session?.user?.name ?? null
|
||||
const isLoggedIn = sessionStatus === 'authenticated' && !!sessionEmail
|
||||
|
||||
const [email, setEmail] = useState('')
|
||||
const [state, setState] = useState<'idle' | 'loading' | 'success' | 'error'>('idle')
|
||||
const [errorMsg, setErrorMsg] = useState('')
|
||||
|
||||
async function subscribe(useEmail: string, useName?: string | null) {
|
||||
setState('loading')
|
||||
setErrorMsg('')
|
||||
const { error } = await apiFetch('/api/newsletter/subscribe', {
|
||||
method: 'POST',
|
||||
body: { email: useEmail, name: useName ?? undefined, source: 'upcycling-interest' },
|
||||
})
|
||||
if (error) {
|
||||
setErrorMsg(error)
|
||||
setState('error')
|
||||
} else {
|
||||
setState('success')
|
||||
}
|
||||
}
|
||||
|
||||
if (state === 'success') {
|
||||
return (
|
||||
<div className={`flex items-start gap-3 rounded-lg border border-subtle bg-action-muted/10 p-5 ${className}`}>
|
||||
<CheckCircle2 className="h-5 w-5 text-action shrink-0 mt-0.5" aria-hidden="true" />
|
||||
<div>
|
||||
<p className="text-sm font-semibold text-text-primary">{t('successTitle')}</p>
|
||||
<p className="text-sm text-text-secondary mt-1">{t('successBody')}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// While next-auth resolves the session we don't yet know which UI to
|
||||
// render. Show a low-fidelity placeholder of the email-input form so
|
||||
// the layout doesn't shift when the session lands.
|
||||
if (sessionStatus === 'loading') {
|
||||
return (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className={`flex flex-col sm:flex-row gap-2 opacity-50 ${className}`}
|
||||
>
|
||||
<Input type="email" disabled placeholder=" " className="sm:flex-1" />
|
||||
<Button type="button" variant="primary" disabled>{t('submitButton')}</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (isLoggedIn) {
|
||||
return (
|
||||
<div className={className}>
|
||||
<Button
|
||||
variant="primary"
|
||||
disabled={state === 'loading'}
|
||||
onClick={() => subscribe(sessionEmail!, sessionName)}
|
||||
>
|
||||
{state === 'loading' ? t('subscribing') : t('oneClickButton')}
|
||||
</Button>
|
||||
<p className="mt-2 font-mono text-xs uppercase tracking-[0.16em] text-text-tertiary">
|
||||
{t('oneClickHint', { email: sessionEmail! })}
|
||||
</p>
|
||||
{errorMsg && <p className="mt-2 text-sm text-error-700 dark:text-error-400">{errorMsg}</p>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<form
|
||||
className={className}
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
if (email) subscribe(email, null)
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col sm:flex-row gap-2">
|
||||
<Input
|
||||
type="email"
|
||||
required
|
||||
placeholder={t('emailPlaceholder')}
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
className="sm:flex-1"
|
||||
aria-label={t('emailPlaceholder')}
|
||||
/>
|
||||
<Button type="submit" variant="primary" disabled={state === 'loading'}>
|
||||
{state === 'loading' ? t('subscribing') : t('submitButton')}
|
||||
</Button>
|
||||
</div>
|
||||
{errorMsg && <p className="mt-2 text-sm text-error-700 dark:text-error-400">{errorMsg}</p>}
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
import Image from 'next/image'
|
||||
import { Lightbulb } from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
|
||||
interface UpcyclingLandingHeroProps {
|
||||
title: string
|
||||
description: string
|
||||
cta1: string
|
||||
cta2: string
|
||||
photoAlt: string
|
||||
}
|
||||
|
||||
/** Landing hero with real installation photography (curved light over the
|
||||
* zuerich.repair workbench, Juli-2026 shoot) — the strongest field photo
|
||||
* leads the minisite. */
|
||||
export function UpcyclingLandingHero({
|
||||
title,
|
||||
description,
|
||||
cta1,
|
||||
cta2,
|
||||
photoAlt,
|
||||
}: UpcyclingLandingHeroProps) {
|
||||
return (
|
||||
<section className="border-b border-subtle bg-surface-base">
|
||||
<div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 sm:py-16 lg:px-8">
|
||||
<div className="grid gap-10 lg:grid-cols-2 lg:items-center lg:gap-14">
|
||||
<div className="min-w-0 text-center lg:text-left">
|
||||
<div className="inline-flex items-center justify-center lg:justify-start gap-3">
|
||||
<span className="flex h-12 w-12 items-center justify-center rounded-xl bg-action-muted/15">
|
||||
<Lightbulb className="h-6 w-6 text-action" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
<h1 className="ui-public-hero-title mt-6">{title}</h1>
|
||||
<p className="ui-public-hero-lede mx-auto mt-6 max-w-2xl lg:mx-0">{description}</p>
|
||||
<div className="mt-8 flex flex-wrap justify-center gap-3 lg:justify-start">
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.applications}
|
||||
className={cn(
|
||||
designPrimitive.buttonBase,
|
||||
designPrimitive.buttonSize.lg,
|
||||
designPrimitive.button.primary,
|
||||
)}
|
||||
>
|
||||
{cta1}
|
||||
</Link>
|
||||
<Link
|
||||
href="/get-involved"
|
||||
className={cn(
|
||||
designPrimitive.buttonBase,
|
||||
designPrimitive.buttonSize.lg,
|
||||
designPrimitive.button.outline,
|
||||
)}
|
||||
>
|
||||
{cta2}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<figure className="relative aspect-[4/3] overflow-hidden rounded-2xl border border-subtle bg-surface-raised">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.werkbankCurved1}
|
||||
alt={photoAlt}
|
||||
fill
|
||||
priority
|
||||
sizes="(min-width: 1024px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import { ArrowRight } from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import {
|
||||
UPCYCLING_PAGE_FLOW,
|
||||
type UpcyclingFlowFromKey,
|
||||
} from '@/config/upcycling-routes'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
|
||||
type NextStepCopy = {
|
||||
eyebrow: string
|
||||
title: string
|
||||
body: string
|
||||
cta: string
|
||||
}
|
||||
|
||||
type NextStepMessages = Partial<Record<UpcyclingFlowFromKey, NextStepCopy>>
|
||||
|
||||
interface UpcyclingNextStepProps {
|
||||
from: UpcyclingFlowFromKey
|
||||
messages: NextStepMessages
|
||||
}
|
||||
|
||||
/**
|
||||
* Single outbound “continue reading” band — keeps each page focused while
|
||||
* guiding visitors through the mini-site without duplicating full sections.
|
||||
*/
|
||||
export function UpcyclingNextStep({ from, messages }: UpcyclingNextStepProps) {
|
||||
const toKey = UPCYCLING_PAGE_FLOW[from]
|
||||
const copy = messages[from]
|
||||
if (!toKey || !copy) return null
|
||||
|
||||
const href = UPCYCLING_ROUTES[toKey]
|
||||
|
||||
return (
|
||||
<section className="border-t border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-3xl px-4 py-12 sm:px-6 sm:py-16 lg:px-8">
|
||||
<Link
|
||||
href={href}
|
||||
className="group flex flex-col gap-3 rounded-lg border border-subtle bg-surface-base p-6 transition-colors hover:border-default sm:flex-row sm:items-center sm:gap-6"
|
||||
>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="ui-public-eyebrow">{copy.eyebrow}</div>
|
||||
<p className="mt-2 text-lg font-semibold text-text-primary">{copy.title}</p>
|
||||
<p className="mt-1 text-sm text-text-secondary">{copy.body}</p>
|
||||
</div>
|
||||
<span className="inline-flex items-center gap-1.5 text-sm font-medium text-action transition-all group-hover:gap-2 shrink-0">
|
||||
{copy.cta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { usePathname } from '@/i18n/navigation'
|
||||
import {
|
||||
UPCYCLING_FLOW_PATH_MAP,
|
||||
type UpcyclingFlowFromKey,
|
||||
} from '@/config/upcycling-routes'
|
||||
import { UpcyclingNextStep } from './UpcyclingNextStep'
|
||||
|
||||
type NextStepCopy = {
|
||||
eyebrow: string
|
||||
title: string
|
||||
body: string
|
||||
cta: string
|
||||
}
|
||||
|
||||
type NextStepMessages = Partial<Record<UpcyclingFlowFromKey, NextStepCopy>>
|
||||
|
||||
interface UpcyclingNextStepBandProps {
|
||||
messages: NextStepMessages
|
||||
}
|
||||
|
||||
/** Single “continue reading” band on flow pages (landing + status are terminal). */
|
||||
export function UpcyclingNextStepBand({ messages }: UpcyclingNextStepBandProps) {
|
||||
const pathname = usePathname()
|
||||
const from = UPCYCLING_FLOW_PATH_MAP[pathname]
|
||||
if (!from) return null
|
||||
return <UpcyclingNextStep from={from} messages={messages} />
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
interface UpcyclingPageHeaderProps {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
/** Default content width; business plan uses wider layout elsewhere. */
|
||||
width?: '5xl' | '7xl'
|
||||
className?: string
|
||||
/** Optional content below the lede (snapshot chip, deadline, etc.). */
|
||||
belowIntro?: React.ReactNode
|
||||
/** Optional right-column media (photo, video). Enables two-column layout. */
|
||||
media?: React.ReactNode
|
||||
}
|
||||
|
||||
/** Shared page hero for explore + evidence lanes — one visual rhythm across the mini-site. */
|
||||
export function UpcyclingPageHeader({
|
||||
eyebrow,
|
||||
title,
|
||||
intro,
|
||||
width = '5xl',
|
||||
className,
|
||||
belowIntro,
|
||||
media,
|
||||
}: UpcyclingPageHeaderProps) {
|
||||
const copy = (
|
||||
<div className="min-w-0">
|
||||
<div className="ui-public-eyebrow">{eyebrow}</div>
|
||||
<h1 className="ui-public-display-lg mt-3">{title}</h1>
|
||||
<p className={cn('ui-public-section-lede mt-4', media ? 'max-w-2xl' : 'max-w-3xl')}>{intro}</p>
|
||||
{belowIntro}
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<header className={cn('border-b border-subtle bg-surface-base', className)}>
|
||||
<div
|
||||
className={cn(
|
||||
'mx-auto px-4 pb-10 pt-12 sm:px-6 sm:pb-14 sm:pt-16 lg:px-8',
|
||||
width === '7xl' ? 'max-w-7xl' : 'max-w-5xl',
|
||||
)}
|
||||
>
|
||||
{media ? (
|
||||
<div className="grid gap-10 lg:grid-cols-[1.1fr_0.9fr] lg:items-center">
|
||||
{copy}
|
||||
{media}
|
||||
</div>
|
||||
) : (
|
||||
copy
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { Link, usePathname } from '@/i18n/navigation'
|
||||
import { isUpcyclingSubNavActive } from '@/lib/domain/upcycling-status-helpers'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* Sticky sub-nav for the Monitor-Upcycling mini-site.
|
||||
*
|
||||
* Lives below the main site nav, above every page in this section. Keeping
|
||||
* it as its own client component so the parent `layout.tsx` can stay a
|
||||
* server component (i18n message fetch).
|
||||
*
|
||||
* When this section eventually splits into its own domain, this component
|
||||
* becomes the primary top-nav of the standalone site — same structure,
|
||||
* different parent.
|
||||
*/
|
||||
|
||||
type Item = { href: string; label: string }
|
||||
|
||||
export function UpcyclingSubNav({ items, brand }: { items: Item[]; brand: string }) {
|
||||
const pathname = usePathname()
|
||||
|
||||
return (
|
||||
<nav
|
||||
aria-label={brand}
|
||||
className="ui-sticky-subnav border-b border-subtle bg-surface-base/85 backdrop-blur supports-[backdrop-filter]:bg-surface-base/70"
|
||||
>
|
||||
<div className="mx-auto flex max-w-7xl items-center gap-6 px-4 sm:px-6 lg:px-8">
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.landing}
|
||||
className="flex shrink-0 items-center gap-2 py-3 font-mono text-xs uppercase tracking-[0.18em] text-text-primary"
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="inline-block h-2 w-2 rounded-full bg-action"
|
||||
/>
|
||||
{brand}
|
||||
</Link>
|
||||
|
||||
<ul className="-mb-px flex flex-1 items-center gap-1 overflow-x-auto">
|
||||
{items.map((item) => {
|
||||
const isActive = isUpcyclingSubNavActive(pathname, item.href)
|
||||
return (
|
||||
<li key={item.href} className="shrink-0">
|
||||
<Link
|
||||
href={item.href}
|
||||
className={cn(
|
||||
'inline-flex items-center border-b-2 px-3 py-3 text-sm font-medium transition-colors',
|
||||
isActive
|
||||
? 'border-action text-text-primary'
|
||||
: 'border-transparent text-text-tertiary hover:text-text-primary',
|
||||
)}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
@@ -1,507 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import { ChevronDown } from 'lucide-react'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import { UPCYCLING_INSTALLATIONS } from '@/data/upcycling-installations'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* Cinematic Applications — the showcase surface of the Monitor-Upcycling
|
||||
* mini-site. Two acts: Functional → Decor. The page itself is the argument:
|
||||
* the same physical object can land in two completely different rooms.
|
||||
*
|
||||
* The third "Art" act was removed in June 2026 — it presented gallery-object
|
||||
* speculation as roadmap with no real evidence. Etappe-2 pilots target
|
||||
* stairwells, offices and schools (functional) plus living spaces (decor).
|
||||
*
|
||||
* SSOT discipline:
|
||||
* - Chrome (text, surface, border) flows through CSS-var semantic tokens.
|
||||
* - Scene visuals use local workshop photography where available.
|
||||
* - Typography flows through ui-public-* primitives where they fit.
|
||||
*
|
||||
* Client component because the sticky scene index needs IntersectionObserver
|
||||
* to know which act the visitor is currently inside.
|
||||
*/
|
||||
|
||||
export type RawApplication = {
|
||||
title: string
|
||||
description: string
|
||||
examples: string[]
|
||||
imageCaption: string
|
||||
}
|
||||
|
||||
export type InstallItemMessages = {
|
||||
title: string
|
||||
location: string
|
||||
story: string
|
||||
}
|
||||
|
||||
export type ApplicationsMessages = {
|
||||
meta: { title: string; description: string }
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
installs: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
photoBadge: string
|
||||
noPhotoBadge: string
|
||||
items: Record<string, InstallItemMessages>
|
||||
}
|
||||
szenarien: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
badge: string
|
||||
items: Record<string, string>
|
||||
}
|
||||
spectrum: { label: string; functional: string; decor: string }
|
||||
tiers: {
|
||||
functional: RawApplication
|
||||
decor: RawApplication
|
||||
}
|
||||
cta: { title: string; body: string; primary: string; secondary: string }
|
||||
}
|
||||
|
||||
type Act = {
|
||||
key: 'functional' | 'decor'
|
||||
variant: 'functional' | 'warm'
|
||||
/** Visual seeds reserved for future multi-photo rows. */
|
||||
seeds: [number, number, number]
|
||||
/** Right-tilt scenes alternate with left-tilt scenes for rhythm. */
|
||||
reverse: boolean
|
||||
}
|
||||
|
||||
const ACTS: Act[] = [
|
||||
{ key: 'functional', variant: 'functional', seeds: [11, 12, 13], reverse: false },
|
||||
{ key: 'decor', variant: 'warm', seeds: [21, 22, 23], reverse: true },
|
||||
]
|
||||
|
||||
const ACT_PHOTOS: Record<Act['key'], { src: string; alt: string }> = {
|
||||
functional: {
|
||||
// Real installation: the curved monitor light over the zuerich.repair
|
||||
// workbench (Juli 2026 shoot) — the functional tier in daily use.
|
||||
src: UPCYCLING_ASSETS.installs.werkbankCurved1,
|
||||
alt: 'Curved-Upcycling-Leuchte über der Werkbank im RepairHub von zuerich.repair',
|
||||
},
|
||||
decor: {
|
||||
src: UPCYCLING_ASSETS.gallery.lenovoPoster,
|
||||
alt: 'Finished monitor lamp (Lenovo L2251pwd) in warm ambient light',
|
||||
},
|
||||
}
|
||||
|
||||
/** Zero-padded 2-digit label for a 0-based index — "01", "02", "03", … */
|
||||
const actLabel = (idx: number) => String(idx + 1).padStart(2, '0')
|
||||
|
||||
/** Total formatted the same way — derived from ACTS so adding a 4th
|
||||
* scene cascades everywhere it's displayed. */
|
||||
const TOTAL_ACTS_LABEL = String(ACTS.length).padStart(2, '0')
|
||||
|
||||
export function ApplicationsExperience({ messages: m }: { messages: ApplicationsMessages }) {
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<CinematicHero
|
||||
eyebrow={m.eyebrow}
|
||||
title={m.title}
|
||||
intro={m.intro}
|
||||
spectrum={m.spectrum}
|
||||
tierLabels={{
|
||||
functional: m.tiers.functional.title,
|
||||
decor: m.tiers.decor.title,
|
||||
}}
|
||||
/>
|
||||
|
||||
<SceneIndex
|
||||
labels={{
|
||||
functional: m.tiers.functional.title,
|
||||
decor: m.tiers.decor.title,
|
||||
}}
|
||||
/>
|
||||
|
||||
{ACTS.map((act, idx) => (
|
||||
<Scene key={act.key} idx={idx} act={act} tier={m.tiers[act.key]} />
|
||||
))}
|
||||
|
||||
<InstallationsSection installs={m.installs} />
|
||||
|
||||
<SzenarienSection szenarien={m.szenarien} />
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── SzenarienSection ───────────────────────────────────────────────
|
||||
* "So könnte es aussehen" — Szenarien-Kompositionen. These are
|
||||
* VISUALISIERUNGEN, not photographs; every card carries an explicit
|
||||
* "Visualisierung" badge and the intro says so, keeping the honest
|
||||
* photographed-vs-imagined split the installs section established.
|
||||
* Structure (scene ids + order) lives here; captions come from messages
|
||||
* keyed by scene id (i18n SSOT: messages = strings only).
|
||||
*/
|
||||
const SZENARIEN_SCENES = [
|
||||
{ id: 'schaufenster', src: UPCYCLING_ASSETS.szenarien.schaufenster },
|
||||
{ id: 'garage', src: UPCYCLING_ASSETS.szenarien.garage },
|
||||
{ id: 'party', src: UPCYCLING_ASSETS.szenarien.party },
|
||||
{ id: 'treppenhaus', src: UPCYCLING_ASSETS.szenarien.treppenhaus },
|
||||
{ id: 'vorlesung', src: UPCYCLING_ASSETS.szenarien.vorlesung },
|
||||
{ id: 'buero', src: UPCYCLING_ASSETS.szenarien.buero },
|
||||
] as const
|
||||
|
||||
function SzenarienSection({ szenarien }: { szenarien: ApplicationsMessages['szenarien'] }) {
|
||||
return (
|
||||
<section className="border-t border-subtle bg-canvas py-20 sm:py-28">
|
||||
<div className="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
||||
<p className="ui-public-eyebrow">{szenarien.eyebrow}</p>
|
||||
<h2 className="ui-public-display-md mt-3">{szenarien.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{szenarien.intro}</p>
|
||||
|
||||
<div className="mt-12 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{SZENARIEN_SCENES.map((scene) => {
|
||||
const caption = szenarien.items[scene.id]
|
||||
if (!caption) return null
|
||||
return (
|
||||
<figure
|
||||
key={scene.id}
|
||||
className="overflow-hidden rounded-xl border border-subtle bg-surface-base"
|
||||
>
|
||||
<div className="relative aspect-[4/3] bg-surface-raised">
|
||||
<Image
|
||||
src={scene.src}
|
||||
alt={`${szenarien.badge} — ${caption}`}
|
||||
fill
|
||||
sizes="(min-width: 1024px) 30vw, (min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
<span className="absolute left-3 top-3 rounded-md bg-black/60 px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-white">
|
||||
{szenarien.badge}
|
||||
</span>
|
||||
</div>
|
||||
<figcaption className="px-4 py-3 font-mono text-[10px] uppercase tracking-[0.16em] text-text-muted">
|
||||
{caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── InstallationsSection ───────────────────────────────────────────
|
||||
* Real-world proof: photographed installations with their field stories
|
||||
* (Swico Abschlussbericht). Structure from UPCYCLING_INSTALLATIONS (data
|
||||
* SSOT); all strings from messages keyed by install id. Entries without
|
||||
* photography render honestly as text cards ("Foto folgt") — same
|
||||
* discipline as the gallery's documented-vs-queued split.
|
||||
*/
|
||||
function InstallationsSection({ installs }: { installs: ApplicationsMessages['installs'] }) {
|
||||
const photographed = UPCYCLING_INSTALLATIONS.filter((i) => !!i.image)
|
||||
const textOnly = UPCYCLING_INSTALLATIONS.filter((i) => !i.image)
|
||||
|
||||
return (
|
||||
<section className="border-t border-subtle bg-surface-raised py-20 sm:py-28">
|
||||
<div className="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
||||
<p className="ui-public-eyebrow">{installs.eyebrow}</p>
|
||||
<h2 className="ui-public-display-md mt-3">{installs.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{installs.intro}</p>
|
||||
|
||||
{/* Photographed installs — big photo cards */}
|
||||
<div className="mt-12 grid gap-6 md:grid-cols-2">
|
||||
{photographed.map((install) => {
|
||||
const msg = installs.items[install.id]
|
||||
if (!msg) return null
|
||||
return (
|
||||
<figure
|
||||
key={install.id}
|
||||
className="overflow-hidden rounded-xl border border-subtle bg-surface-base"
|
||||
>
|
||||
<div className="relative aspect-[4/3] bg-surface-raised">
|
||||
<Image
|
||||
src={install.image!}
|
||||
alt={`${msg.title} — ${msg.location}`}
|
||||
fill
|
||||
sizes="(min-width: 768px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
<span className="absolute left-3 top-3 rounded-md bg-black/60 px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em] text-white">
|
||||
{installs.photoBadge}
|
||||
</span>
|
||||
</div>
|
||||
{/* Secondary shots, small strip */}
|
||||
{install.extraImages && install.extraImages.length > 0 && (
|
||||
<div className="flex gap-1 border-t border-subtle">
|
||||
{install.extraImages.map((src) => (
|
||||
<div key={src} className="relative aspect-[4/3] min-w-0 flex-1">
|
||||
<Image
|
||||
src={src}
|
||||
alt={msg.title}
|
||||
fill
|
||||
sizes="25vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<figcaption className="p-5">
|
||||
<p className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-muted">
|
||||
{msg.location}
|
||||
</p>
|
||||
<h3 className="mt-1 text-lg font-semibold text-text-primary">{msg.title}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-text-secondary">{msg.story}</p>
|
||||
</figcaption>
|
||||
</figure>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Verified installs awaiting photography — honest text cards */}
|
||||
<div className="mt-6 grid gap-4 sm:grid-cols-3">
|
||||
{textOnly.map((install) => {
|
||||
const msg = installs.items[install.id]
|
||||
if (!msg) return null
|
||||
return (
|
||||
<div
|
||||
key={install.id}
|
||||
className="rounded-xl border border-subtle bg-surface-base p-5"
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-muted">
|
||||
{msg.location}
|
||||
</p>
|
||||
<span className="rounded-md border border-subtle px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.14em] text-text-muted">
|
||||
{installs.noPhotoBadge}
|
||||
</span>
|
||||
</div>
|
||||
<h3 className="mt-1 text-base font-semibold text-text-primary">{msg.title}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-text-secondary">{msg.story}</p>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── CinematicHero ──────────────────────────────────────────────────
|
||||
* Full-fold entrance: eyebrow → display title → lede → spectrum bar →
|
||||
* scroll hint. Behind it, a 3-lamp staggered composition (one per act)
|
||||
* blooms from the upper-right; an ambient action-muted halo anchors
|
||||
* the eye. All visuals derive from contained SSOTs (MonitorLamp palette
|
||||
* + semantic tokens).
|
||||
*/
|
||||
function CinematicHero({
|
||||
eyebrow,
|
||||
title,
|
||||
intro,
|
||||
spectrum,
|
||||
tierLabels,
|
||||
}: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
spectrum: ApplicationsMessages['spectrum']
|
||||
tierLabels: { functional: string; decor: string }
|
||||
}) {
|
||||
return (
|
||||
<section
|
||||
aria-label={title}
|
||||
className="relative isolate overflow-hidden border-b border-subtle bg-canvas"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 -z-10"
|
||||
style={{
|
||||
background:
|
||||
'radial-gradient(60% 60% at 78% 22%, var(--accent-action-muted) 0%, transparent 64%)',
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="mx-auto max-w-7xl px-4 pb-16 pt-10 sm:px-6 sm:pb-24 sm:pt-16 lg:flex lg:min-h-[calc(100svh-3.5rem)] lg:flex-col lg:px-8 lg:pb-28 lg:pt-20">
|
||||
<div className="flex flex-col gap-10 sm:gap-12 lg:grid lg:flex-1 lg:grid-cols-[1.05fr_1fr] lg:items-center lg:gap-16">
|
||||
<div className="min-w-0">
|
||||
<div className="ui-public-eyebrow">{eyebrow}</div>
|
||||
<h1 className="ui-public-hero-title mt-4 text-left sm:mt-6">{title}</h1>
|
||||
<p className="ui-public-hero-lede mx-0 mt-6 max-w-2xl text-left sm:mt-8">{intro}</p>
|
||||
|
||||
<div className="mt-8 flex items-center gap-3 font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary sm:mt-10">
|
||||
<span>{spectrum.functional}</span>
|
||||
<span aria-hidden="true" className="h-px flex-1 bg-border-default" />
|
||||
<span>{spectrum.decor}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SpectrumComposition tierLabels={tierLabels} />
|
||||
</div>
|
||||
|
||||
<div className="hidden justify-center pt-12 text-text-tertiary lg:flex">
|
||||
<span className="inline-flex items-center gap-2 font-mono text-xs uppercase tracking-[0.18em]">
|
||||
{spectrum.label}
|
||||
<ChevronDown className="h-4 w-4" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* Hero composition — real workshop photo (documented retrofit). */
|
||||
function SpectrumComposition({
|
||||
tierLabels,
|
||||
}: {
|
||||
tierLabels: { functional: string; decor: string }
|
||||
}) {
|
||||
return (
|
||||
<figure className="relative aspect-[5/4] w-full overflow-hidden rounded-2xl border border-subtle bg-surface-base">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.businessplan.heroPoster}
|
||||
alt=""
|
||||
fill
|
||||
sizes="(min-width: 1024px) 45vw, 50vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
<figcaption className="sr-only">
|
||||
{tierLabels.functional}, {tierLabels.decor}
|
||||
</figcaption>
|
||||
</figure>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── SceneIndex (sticky scene chip) ─────────────────────────────────
|
||||
* Compact floating progress chip while scrolling through the three acts.
|
||||
* Mirrors the StepProgress pattern from the Lenovo guide — same idiom,
|
||||
* shared visual vocabulary within the mini-site.
|
||||
*/
|
||||
function SceneIndex({
|
||||
labels,
|
||||
}: {
|
||||
labels: { functional: string; decor: string }
|
||||
}) {
|
||||
// -1 = above the first scene (hide the chip); 0..n = inside scene n.
|
||||
const [activeIdx, setActiveIdx] = useState<number>(-1)
|
||||
|
||||
useEffect(() => {
|
||||
const targets = ACTS.map((a) => document.getElementById(`act-${a.key}`)).filter(
|
||||
(el): el is HTMLElement => !!el,
|
||||
)
|
||||
if (!targets.length) return
|
||||
|
||||
const obs = new IntersectionObserver(
|
||||
(entries) => {
|
||||
const visible = entries
|
||||
.filter((e) => e.isIntersecting)
|
||||
.sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)
|
||||
if (visible.length > 0) {
|
||||
const idx = ACTS.findIndex((a) => `act-${a.key}` === visible[0].target.id)
|
||||
if (idx >= 0) setActiveIdx(idx)
|
||||
} else if (window.scrollY < window.innerHeight / 2) {
|
||||
setActiveIdx(-1)
|
||||
}
|
||||
},
|
||||
{ rootMargin: '-30% 0px -50% 0px' },
|
||||
)
|
||||
targets.forEach((t) => obs.observe(t))
|
||||
return () => obs.disconnect()
|
||||
}, [])
|
||||
|
||||
if (activeIdx < 0) return null
|
||||
|
||||
const act = ACTS[activeIdx]
|
||||
if (!act) return null
|
||||
|
||||
return (
|
||||
<div className="fixed left-1/2 top-3 z-40 -translate-x-1/2 sm:top-4">
|
||||
<div className="flex h-11 items-center gap-3 rounded-full border border-default bg-surface-base/95 px-4 text-sm font-medium text-text-primary backdrop-blur">
|
||||
<span className="font-mono tabular-nums text-xs text-text-tertiary">
|
||||
{actLabel(activeIdx)} / {TOTAL_ACTS_LABEL}
|
||||
</span>
|
||||
<span aria-hidden="true" className="h-3 w-px bg-border-default" />
|
||||
<span>{labels[act.key]}</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Scene ──────────────────────────────────────────────────────────
|
||||
* A single act. Large mono numeral anchors the eye; tier title in display
|
||||
* type; description as lede; examples in two-column rhythm; a row of three
|
||||
* variant-matched lamps. Scenes alternate text-left / text-right for visual
|
||||
* rhythm across the page.
|
||||
*/
|
||||
function Scene({ act, idx, tier }: { act: Act; idx: number; tier: RawApplication }) {
|
||||
return (
|
||||
<section
|
||||
id={`act-${act.key}`}
|
||||
className={cn(
|
||||
'border-b border-subtle',
|
||||
// Subtle alternating tint creates rhythm without breaking the token
|
||||
// discipline — both bg-canvas and bg-surface-raised are role-based.
|
||||
act.reverse ? 'bg-surface-raised' : 'bg-canvas',
|
||||
)}
|
||||
>
|
||||
<div className="mx-auto max-w-7xl px-4 py-20 sm:px-6 sm:py-28 lg:px-8 lg:py-32">
|
||||
{/* min-w-0 on grid children is REQUIRED so the lamp-row column
|
||||
(which contains a flex carousel with `w-[80vw]` figures) can
|
||||
shrink. Without it, the carousel pushes the grid wider than
|
||||
the viewport on mobile. */}
|
||||
<div
|
||||
className={cn(
|
||||
'grid gap-10 lg:grid-cols-2 lg:items-center lg:gap-16',
|
||||
act.reverse && 'lg:grid-flow-dense',
|
||||
)}
|
||||
>
|
||||
{/* Text column */}
|
||||
<div className={cn('min-w-0', act.reverse && 'lg:col-start-2')}>
|
||||
<div className="flex items-baseline gap-4">
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="font-mono text-7xl font-light leading-none tabular-nums text-text-tertiary sm:text-8xl"
|
||||
>
|
||||
{actLabel(idx)}
|
||||
</span>
|
||||
<span className="font-mono text-xs uppercase tracking-[0.22em] text-text-tertiary">
|
||||
/ {TOTAL_ACTS_LABEL}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h2 className="ui-public-display-md mt-6">{tier.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-xl">{tier.description}</p>
|
||||
|
||||
<ul className="mt-8 grid gap-y-2 gap-x-8 text-sm text-text-secondary sm:grid-cols-2">
|
||||
{tier.examples.map((ex, i) => (
|
||||
<li key={i} className="flex gap-2">
|
||||
<span className="font-mono text-text-tertiary">·</span>
|
||||
{ex}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Lamp visual column */}
|
||||
<div className={cn('relative min-w-0', act.reverse && 'lg:col-start-1 lg:row-start-1')}>
|
||||
<ScenePhoto actKey={act.key} caption={tier.imageCaption} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function ScenePhoto({ actKey, caption }: { actKey: Act['key']; caption: string }) {
|
||||
const photo = ACT_PHOTOS[actKey]
|
||||
return (
|
||||
<figure className="overflow-hidden rounded-2xl border border-subtle bg-surface-base">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<Image src={photo.src} alt={photo.alt} fill sizes="(min-width: 1024px) 45vw, 100vw" className="object-cover" />
|
||||
</div>
|
||||
<figcaption className="px-4 py-3 font-mono text-[10px] uppercase tracking-[0.22em] text-text-tertiary">
|
||||
{caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { ApplicationsExperience, type ApplicationsMessages } from './ApplicationsExperience'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/**
|
||||
* Applications — the cinematic spectrum surface of the Monitor-Upcycling
|
||||
* mini-site. Server component handles i18n + metadata only; the full
|
||||
* experience lives in <ApplicationsExperience> (client) so the sticky
|
||||
* scene index and intersection-tracked progress have the state they need.
|
||||
*/
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.applications') as ApplicationsMessages
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('applications', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingApplicationsPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.applications') as ApplicationsMessages
|
||||
return <ApplicationsExperience messages={m} />
|
||||
}
|
||||
@@ -1,387 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import Image from 'next/image'
|
||||
import { Github, ArrowRight, ExternalLink } from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import { UPCYCLING_ROUTES, UPCYCLING_WIKI_URL } from '@/config/upcycling-routes'
|
||||
import { orderPublishedGuides } from '@/data/upcycling-guides'
|
||||
import { UpcyclingPageHeader } from '../UpcyclingPageHeader'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/**
|
||||
* Build-Your-Own — the open-source-hardware hub.
|
||||
*
|
||||
* This is the page that pays off the project's MIT-licensed-hardware
|
||||
* pitch. It lists every model guide we've published, links to the
|
||||
* source repo, and explicitly invites people anywhere in the world to
|
||||
* fork the work. When the mini-site spins out to its own domain, this
|
||||
* page becomes the homepage for the "DIY" lane (vs. the future shop
|
||||
* lane for buying a finished unit).
|
||||
*/
|
||||
|
||||
type GuideItem = {
|
||||
slug: string
|
||||
model: string
|
||||
href: string
|
||||
summary: string
|
||||
difficulty: string
|
||||
duration: string
|
||||
author: string
|
||||
}
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
philosophy: {
|
||||
title: string
|
||||
body: string
|
||||
}
|
||||
guides: {
|
||||
title: string
|
||||
intro: string
|
||||
openCta: string
|
||||
items: GuideItem[]
|
||||
empty: string
|
||||
moreComing: { title: string; body: string; cta: string }
|
||||
}
|
||||
artifacts: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
standby: { alt: string; caption: string }
|
||||
mount: { alt: string; caption: string }
|
||||
}
|
||||
teaching: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
body: string
|
||||
workshop: { alt: string; caption: string }
|
||||
kreativ: { alt: string; caption: string }
|
||||
}
|
||||
source: {
|
||||
title: string
|
||||
body: string
|
||||
repoCta: string
|
||||
repoUrl: string
|
||||
licenseLabel: string
|
||||
wikiTitle: string
|
||||
wikiBody: string
|
||||
wikiCta: string
|
||||
}
|
||||
contribute: {
|
||||
title: string
|
||||
body: string
|
||||
items: string[]
|
||||
cta: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.buildYourOwn') as PageMessages
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('buildYourOwn', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingBuildYourOwnPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.buildYourOwn') as PageMessages
|
||||
const guides = orderPublishedGuides(m.guides.items)
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<UpcyclingPageHeader
|
||||
eyebrow={m.eyebrow}
|
||||
title={m.title}
|
||||
intro={m.intro}
|
||||
belowIntro={
|
||||
<div className="mt-8 flex flex-wrap gap-3">
|
||||
<a
|
||||
href={m.source.repoUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="ui-public-cta inline-flex items-center gap-2"
|
||||
>
|
||||
<Github className="h-4 w-4" aria-hidden="true" />
|
||||
{m.source.repoCta}
|
||||
</a>
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.gallery}
|
||||
className="ui-public-cta-ghost inline-flex items-center gap-2"
|
||||
>
|
||||
{m.guides.openCta}
|
||||
<ArrowRight className="h-4 w-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
media={
|
||||
<div className="relative aspect-[4/3] overflow-hidden rounded-lg border border-subtle">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.lenovoGuide.stepFrameRemoved}
|
||||
alt=""
|
||||
fill
|
||||
sizes="(min-width: 768px) 40vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Why open — the philosophical core in one paragraph. The audit
|
||||
flagged the previous treatment (pull-quote + 3 numbered pillars +
|
||||
icons) as manifesto-scale chrome for a project with 1 published
|
||||
guide. The body line still carries the stance, but the page no
|
||||
longer reads as a marketing landing: it reads as a hub that
|
||||
gets out of the way and lets the guides speak. */}
|
||||
<section className="border-t border-subtle bg-surface-raised">
|
||||
<div className="mx-auto max-w-3xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{m.philosophy.title}</div>
|
||||
<p className="mt-5 text-xl font-medium leading-snug tracking-tight text-text-primary sm:text-2xl">
|
||||
{m.philosophy.body}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="border-t border-subtle bg-surface-base">
|
||||
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20">
|
||||
<h2 className="ui-public-display-md">{m.guides.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{m.guides.intro}</p>
|
||||
|
||||
{guides.length === 0 ? (
|
||||
<p className="mt-10 text-sm text-text-tertiary">{m.guides.empty}</p>
|
||||
) : (
|
||||
<ul className="mt-10 grid gap-4 sm:grid-cols-2">
|
||||
{guides.map((g) => (
|
||||
<li key={g.slug}>
|
||||
<Link
|
||||
href={g.href}
|
||||
className="group flex h-full flex-col rounded-lg border border-subtle bg-surface-raised p-6 transition-colors hover:border-default"
|
||||
>
|
||||
<div className="flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary">
|
||||
<span>{g.duration}</span>
|
||||
<span aria-hidden="true">·</span>
|
||||
<span>{g.difficulty}</span>
|
||||
</div>
|
||||
<h3 className="mt-3 text-lg font-semibold text-text-primary">{g.model}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-text-secondary">{g.summary}</p>
|
||||
<div className="mt-auto pt-6 flex items-center justify-between">
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{g.author}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{m.guides.openCta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
{guides.length === 1 && m.guides.moreComing && (
|
||||
<li>
|
||||
<div className="flex h-full flex-col rounded-lg border border-dashed border-subtle bg-canvas p-6">
|
||||
<div className="font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{m.guides.moreComing.title}
|
||||
</div>
|
||||
<p className="mt-3 text-sm leading-relaxed text-text-secondary">{m.guides.moreComing.body}</p>
|
||||
<Link
|
||||
href="/contact"
|
||||
className="mt-auto pt-6 inline-flex items-center gap-1.5 text-sm font-medium text-action hover:gap-2 transition-all"
|
||||
>
|
||||
{m.guides.moreComing.cta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Engineering artifacts — the two open-hardware parts every retrofit
|
||||
needs, photographed/rendered from our own workshop (Juli 2026):
|
||||
the Spannungsteiler standby plug and the printable ceiling mount. */}
|
||||
<section className="border-t border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{m.artifacts.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{m.artifacts.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{m.artifacts.intro}</p>
|
||||
|
||||
<div className="mt-10 grid gap-4 sm:grid-cols-2">
|
||||
<figure className="overflow-hidden rounded-lg border border-subtle bg-surface-base">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.standbyDongle}
|
||||
alt={m.artifacts.standby.alt}
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<figcaption className="border-t border-subtle px-4 py-3 text-sm leading-relaxed text-text-secondary">
|
||||
{m.artifacts.standby.caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
<figure className="overflow-hidden rounded-lg border border-subtle bg-surface-base">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.deckenhalterungCad}
|
||||
alt={m.artifacts.mount.alt}
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-contain p-4"
|
||||
/>
|
||||
</div>
|
||||
<figcaption className="border-t border-subtle px-4 py-3 text-sm leading-relaxed text-text-secondary">
|
||||
{m.artifacts.mount.caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Teaching — the open guides in the classroom. HSLU Bachelor module
|
||||
«Local Loops — Circularity locally made»: 14 students designed and
|
||||
prototyped their own lamps from our retired monitors (Nextcloud:
|
||||
hslu.txt). Knowledge-sharing proof for the philosophy section above. */}
|
||||
<section className="border-t border-subtle bg-surface-base">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{m.teaching.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{m.teaching.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{m.teaching.body}</p>
|
||||
|
||||
<div className="mt-10 grid gap-4 sm:grid-cols-2">
|
||||
<figure className="overflow-hidden rounded-lg border border-subtle bg-surface-raised">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.hsluWorkshop1}
|
||||
alt={m.teaching.workshop.alt}
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<figcaption className="border-t border-subtle px-4 py-3 text-sm leading-relaxed text-text-secondary">
|
||||
{m.teaching.workshop.caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
<figure className="overflow-hidden rounded-lg border border-subtle bg-surface-raised">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.hsluKreativ1}
|
||||
alt={m.teaching.kreativ.alt}
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<figcaption className="border-t border-subtle px-4 py-3 text-sm leading-relaxed text-text-secondary">
|
||||
{m.teaching.kreativ.caption}
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Source — terminal frame around the canonical git URL.
|
||||
The fake-prompt block sells the "this is real code, take it" feel
|
||||
without inventing new tokens: surface-raised + mono + a green
|
||||
prompt that re-uses --action. */}
|
||||
<section className="border-t border-subtle bg-surface-raised">
|
||||
<div className="mx-auto max-w-5xl px-4 py-20 sm:px-6 sm:py-28 lg:px-8">
|
||||
<div className="grid gap-12 md:grid-cols-2 md:items-start md:gap-16">
|
||||
<div>
|
||||
<h2 className="ui-public-display-md">{m.source.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4">{m.source.body}</p>
|
||||
<p className="mt-6 font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{m.source.licenseLabel}
|
||||
</p>
|
||||
|
||||
<div className="mt-6 overflow-hidden rounded-lg border border-default bg-surface-base">
|
||||
<div className="flex items-center gap-2 border-b border-subtle bg-surface-raised px-3 py-2 font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary">
|
||||
<span aria-hidden="true" className="inline-block h-2 w-2 rounded-full bg-border-default" />
|
||||
<span aria-hidden="true" className="inline-block h-2 w-2 rounded-full bg-border-default" />
|
||||
<span aria-hidden="true" className="inline-block h-2 w-2 rounded-full bg-border-default" />
|
||||
<span className="ml-2">{m.source.repoUrl.replace(/^https?:\/\//, '').replace(/^[^/]+/, '~')}</span>
|
||||
</div>
|
||||
<a
|
||||
href={m.source.repoUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="group block px-4 py-4 font-mono text-sm leading-relaxed"
|
||||
>
|
||||
<span className="select-none text-action" aria-hidden="true">$ </span>
|
||||
<span className="text-text-primary">git clone </span>
|
||||
<span className="text-text-secondary underline-offset-4 group-hover:underline">
|
||||
{m.source.repoUrl}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a
|
||||
href={m.source.repoUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-action hover:underline"
|
||||
>
|
||||
<Github className="h-4 w-4" aria-hidden="true" />
|
||||
{m.source.repoCta}
|
||||
<ExternalLink className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</a>
|
||||
|
||||
{/* Public Umbau-Wiki — the project's open documentation platform
|
||||
(Swico Abschlussbericht). URL from config (SSOT). */}
|
||||
<div className="mt-8 rounded-lg border border-subtle bg-surface-base p-5">
|
||||
<h3 className="text-base font-semibold text-text-primary">{m.source.wikiTitle}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-text-secondary">{m.source.wikiBody}</p>
|
||||
<a
|
||||
href={UPCYCLING_WIKI_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-3 inline-flex items-center gap-2 text-sm font-medium text-action hover:underline"
|
||||
>
|
||||
{m.source.wikiCta}
|
||||
<ExternalLink className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="ui-public-display-md">{m.contribute.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4">{m.contribute.body}</p>
|
||||
|
||||
<ol className="mt-6 space-y-4">
|
||||
{m.contribute.items.map((item, i) => (
|
||||
<li key={i} className="flex items-start gap-4 border-t border-subtle pt-4">
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="font-mono text-sm font-medium tabular-nums text-text-tertiary"
|
||||
>
|
||||
{String(i + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<span className="text-sm leading-relaxed text-text-secondary">{item}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
<Link
|
||||
href="/contact"
|
||||
className="mt-8 inline-flex items-center gap-2 text-sm font-medium text-action hover:underline"
|
||||
>
|
||||
{m.contribute.cta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* Sticky left-rail table-of-contents for the businessplan page.
|
||||
*
|
||||
* Client component because scroll-spy needs IntersectionObserver — the
|
||||
* rest of the businessplan page stays server-rendered. The contract is
|
||||
* just a list of {id, label} items; the page hands them in.
|
||||
*
|
||||
* Highlight rule: the section whose top is currently inside the upper
|
||||
* 40% of the viewport is "active". When no section is in that zone
|
||||
* (e.g. mid-section while a long one fills the screen), the most
|
||||
* recently entered section stays active. After the user clicks an
|
||||
* anchor, the browser scrolls and the observer settles on that section
|
||||
* automatically.
|
||||
*/
|
||||
export function DesktopTocRail({
|
||||
nav,
|
||||
}: {
|
||||
nav: {
|
||||
label: string
|
||||
items: { id: string; label: string }[]
|
||||
}
|
||||
}) {
|
||||
const [activeId, setActiveId] = useState<string>(nav.items[0]?.id ?? '')
|
||||
|
||||
useEffect(() => {
|
||||
const targets = nav.items
|
||||
.map((item) => document.getElementById(item.id))
|
||||
.filter((el): el is HTMLElement => !!el)
|
||||
if (targets.length === 0) return
|
||||
|
||||
// Map id → last known intersectionRatio so we can pick the most-
|
||||
// visible section when more than one is in the active zone.
|
||||
const ratios = new Map<string, number>()
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
ratios.set(entry.target.id, entry.isIntersecting ? entry.intersectionRatio : 0)
|
||||
}
|
||||
// Pick the section with the highest intersection ratio.
|
||||
// Ties broken by document order (the first section listed wins).
|
||||
let bestId = ''
|
||||
let bestRatio = 0
|
||||
for (const item of nav.items) {
|
||||
const r = ratios.get(item.id) ?? 0
|
||||
if (r > bestRatio) {
|
||||
bestId = item.id
|
||||
bestRatio = r
|
||||
}
|
||||
}
|
||||
if (bestId) setActiveId(bestId)
|
||||
},
|
||||
{
|
||||
// Activation zone: top 10% to top 60% of viewport. A section
|
||||
// becomes "active" when its top enters this band and stays until
|
||||
// its top exits. Wider than typical scroll-spy because section
|
||||
// headings are large (display-md) and visitors scroll in chunks.
|
||||
rootMargin: '-10% 0px -40% 0px',
|
||||
threshold: [0, 0.1, 0.25, 0.5, 0.75, 1],
|
||||
},
|
||||
)
|
||||
|
||||
for (const t of targets) observer.observe(t)
|
||||
return () => observer.disconnect()
|
||||
}, [nav.items])
|
||||
|
||||
return (
|
||||
<nav aria-label={nav.label} className="ui-public-toc-rail hidden lg:block">
|
||||
<p className="font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary mb-3">
|
||||
{nav.label}
|
||||
</p>
|
||||
<ul className="space-y-1.5 text-sm">
|
||||
{nav.items.map((item) => {
|
||||
const active = item.id === activeId
|
||||
return (
|
||||
<li key={item.id}>
|
||||
<a
|
||||
href={`#${item.id}`}
|
||||
aria-current={active ? 'true' : undefined}
|
||||
className={cn(
|
||||
'relative block rounded-md px-2 py-1.5 transition-colors',
|
||||
active
|
||||
? 'bg-surface-raised font-medium text-text-primary'
|
||||
: 'text-text-tertiary hover:bg-surface-raised hover:text-text-primary',
|
||||
)}
|
||||
>
|
||||
{/* Subtle left-edge accent for the active item; only
|
||||
shows on hover for the rest. Discipline: no off-
|
||||
palette colour, no shadow. */}
|
||||
{active && (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-r-full bg-action"
|
||||
/>
|
||||
)}
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import type { BusinessPlan } from '../types'
|
||||
import { Select } from '@/components/ui/select'
|
||||
|
||||
export function BusinessPlanHero({
|
||||
hero,
|
||||
documentMeta,
|
||||
}: {
|
||||
hero: BusinessPlan['hero']
|
||||
documentMeta: BusinessPlan['documentMeta']
|
||||
}) {
|
||||
return (
|
||||
<header className="border-b border-subtle bg-surface-base">
|
||||
<div className="mx-auto max-w-7xl px-4 pb-10 pt-12 sm:px-6 sm:pb-14 sm:pt-16 lg:px-8">
|
||||
<dl className="mb-8 grid gap-x-8 gap-y-2 border-b border-subtle pb-6 font-mono text-[10px] uppercase tracking-[0.16em] text-text-tertiary sm:grid-cols-2 lg:grid-cols-4">
|
||||
<div>
|
||||
<dt>{documentMeta.versionLabel}</dt>
|
||||
<dd className="mt-0.5 text-xs text-text-secondary">{documentMeta.asOf}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>{documentMeta.projectLabel}</dt>
|
||||
<dd className="mt-0.5 text-xs normal-case tracking-normal text-text-secondary">
|
||||
{documentMeta.project}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>{documentMeta.sponsorLabel}</dt>
|
||||
<dd className="mt-0.5 text-xs normal-case tracking-normal text-text-secondary">
|
||||
{documentMeta.sponsor}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>{documentMeta.preparedByLabel}</dt>
|
||||
<dd className="mt-0.5 text-xs normal-case tracking-normal text-text-secondary">
|
||||
{documentMeta.preparedBy}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<div className="grid gap-10 lg:grid-cols-[1.1fr_0.9fr] lg:items-center">
|
||||
<div className="min-w-0">
|
||||
<div className="ui-public-eyebrow">{hero.eyebrow}</div>
|
||||
<h1 className="ui-public-display-lg mt-3">{hero.title}</h1>
|
||||
<p className="ui-public-section-lede mt-4 max-w-2xl">{hero.intro}</p>
|
||||
</div>
|
||||
<figure className="relative aspect-[4/3] overflow-hidden rounded-2xl border border-subtle bg-canvas">
|
||||
<video
|
||||
src={hero.heroVideo}
|
||||
poster={hero.heroPoster}
|
||||
autoPlay
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
aria-label={hero.heroImageAlt}
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
/>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
export function BusinessPlanMobileToc({ nav }: { nav: BusinessPlan['nav'] }) {
|
||||
return (
|
||||
<nav
|
||||
aria-label={nav.label}
|
||||
className="ui-sticky-subnav lg:hidden border-b border-subtle bg-surface-base/95 backdrop-blur supports-[backdrop-filter]:bg-surface-base/75"
|
||||
>
|
||||
<div className="mx-auto max-w-5xl px-4 py-2.5 sm:px-6">
|
||||
<label className="flex items-center gap-3">
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.18em] text-text-tertiary shrink-0">
|
||||
{nav.label}
|
||||
</span>
|
||||
<Select
|
||||
className="flex-1 min-w-0 text-sm"
|
||||
defaultValue=""
|
||||
onChange={(e) => {
|
||||
if (e.target.value) {
|
||||
window.location.hash = e.target.value
|
||||
}
|
||||
}}
|
||||
>
|
||||
<option value="">— {nav.label} —</option>
|
||||
{nav.items.map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{item.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</label>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
import { cn } from '@/lib/utils'
|
||||
import { Check, X } from 'lucide-react'
|
||||
import type { BusinessPlanUi, Cite } from '../types'
|
||||
|
||||
export function formatStepLabel(template: string, step: number): string {
|
||||
return template.replace('{n}', String(step))
|
||||
}
|
||||
|
||||
export function formatCitationAria(template: string, n: number): string {
|
||||
return template.replace('{n}', String(n))
|
||||
}
|
||||
|
||||
export function Cite({
|
||||
k,
|
||||
citeMap,
|
||||
ui,
|
||||
}: {
|
||||
k: Cite
|
||||
citeMap: Map<string, number>
|
||||
ui: BusinessPlanUi
|
||||
}) {
|
||||
if (!k) return null
|
||||
const n = citeMap.get(k)
|
||||
if (!n) return null
|
||||
return (
|
||||
<a
|
||||
href={`#belege-${k}`}
|
||||
className="ml-1 inline-flex align-baseline rounded-sm bg-surface-raised px-1 text-[10px] font-mono text-text-tertiary no-underline hover:bg-action-muted hover:text-action"
|
||||
aria-label={formatCitationAria(ui.citationAria, n)}
|
||||
>
|
||||
[{n}]
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
export function Section({
|
||||
id,
|
||||
tone = 'canvas',
|
||||
children,
|
||||
}: {
|
||||
id: string
|
||||
tone?: 'canvas' | 'raised' | 'base'
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<section
|
||||
id={id}
|
||||
className={cn(
|
||||
'border-b border-subtle scroll-mt-24 sm:scroll-mt-28',
|
||||
tone === 'canvas' && 'bg-canvas',
|
||||
tone === 'raised' && 'bg-surface-raised -mx-4 px-4 sm:-mx-6 sm:px-6 lg:-mx-0 lg:px-0',
|
||||
tone === 'base' && 'bg-surface-base -mx-4 px-4 sm:-mx-6 sm:px-6 lg:-mx-0 lg:px-0',
|
||||
)}
|
||||
>
|
||||
<div className="py-14 sm:py-16">{children}</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
export function CriteriaCard({
|
||||
variant,
|
||||
title,
|
||||
items,
|
||||
cite,
|
||||
citeMap,
|
||||
ui,
|
||||
}: {
|
||||
variant: 'accept' | 'reject'
|
||||
title: string
|
||||
items: string[]
|
||||
cite: Cite
|
||||
citeMap: Map<string, number>
|
||||
ui: BusinessPlanUi
|
||||
}) {
|
||||
const Icon = variant === 'accept' ? Check : X
|
||||
return (
|
||||
<div className="min-w-0 rounded-xl border border-subtle bg-surface-base p-6">
|
||||
<h3 className="font-mono text-xs uppercase tracking-[0.18em] text-action">{title}</h3>
|
||||
<ul className="mt-4 space-y-2 text-sm text-text-secondary">
|
||||
{items.map((item, i) => (
|
||||
<li key={i} className="flex items-start gap-2">
|
||||
<Icon
|
||||
className={cn(
|
||||
'mt-0.5 h-4 w-4 shrink-0',
|
||||
variant === 'accept' ? 'text-action' : 'text-text-tertiary',
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span>{item}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p className="mt-3 text-xs text-text-tertiary">
|
||||
{ui.source}
|
||||
<Cite k={cite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function SourceLine({
|
||||
cite,
|
||||
citeMap,
|
||||
ui,
|
||||
}: {
|
||||
cite: Cite
|
||||
citeMap: Map<string, number>
|
||||
ui: BusinessPlanUi
|
||||
}) {
|
||||
return (
|
||||
<p className="mt-3 text-xs text-text-tertiary">
|
||||
{ui.source}
|
||||
<Cite k={cite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
export function DisclosureSummary({
|
||||
badge,
|
||||
title,
|
||||
}: {
|
||||
badge: string
|
||||
title: string
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<span>
|
||||
<span className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-tertiary mr-2">
|
||||
{badge}
|
||||
</span>
|
||||
{title}
|
||||
</span>
|
||||
<span aria-hidden="true" className="font-mono text-text-tertiary transition-transform group-open:rotate-180">
|
||||
⌄
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,500 +0,0 @@
|
||||
import Image from 'next/image'
|
||||
import { ArrowRight, ExternalLink, Mail } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import type { BusinessPlan, BusinessPlanUi } from '../types'
|
||||
import {
|
||||
Cite,
|
||||
CriteriaCard,
|
||||
DisclosureSummary,
|
||||
Section,
|
||||
SourceLine,
|
||||
formatStepLabel,
|
||||
} from './primitives'
|
||||
|
||||
/* ─── Executive summary ───────────────────────────────────────────── */
|
||||
|
||||
export function ExecutiveSummary({ section }: { section: BusinessPlan['executiveSummary'] }) {
|
||||
return (
|
||||
<Section id="zusammenfassung" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<div className="mt-6 max-w-3xl space-y-4 text-sm leading-relaxed text-text-secondary sm:text-base">
|
||||
{section.paragraphs.map((p, i) => (
|
||||
<p key={i}>{p}</p>
|
||||
))}
|
||||
</div>
|
||||
<dl className="mt-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{section.highlights.map((h) => (
|
||||
<div key={h.label} className="rounded-xl border border-subtle bg-surface-base px-4 py-3">
|
||||
<dt className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-tertiary">{h.label}</dt>
|
||||
<dd className="mt-1 font-mono text-lg font-light tabular-nums text-text-primary">{h.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 1. Status ────────────────────────────────────────────────────── */
|
||||
|
||||
export function Status({ section, citeMap, ui }: { section: BusinessPlan['status']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="status" tone="base">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
<ul className="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{section.kpis.map((k) => (
|
||||
<li key={k.label} className="rounded-xl border border-subtle bg-canvas p-5">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-action">{k.label}</div>
|
||||
<div className="mt-2 font-mono text-xl font-light tabular-nums text-text-primary">{k.value}</div>
|
||||
<p className="mt-2 text-xs leading-relaxed text-text-secondary">
|
||||
{k.note}<Cite k={k.cite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 2. Was wir bauen ────────────────────────────────────────────── */
|
||||
|
||||
export function Produkt({ section, ui }: { section: BusinessPlan['produkt']; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="produkt" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<h3 className="mt-10 text-lg font-semibold text-text-primary">{section.buildSteps.title}</h3>
|
||||
<ol className="mt-4 grid gap-4 sm:grid-cols-2">
|
||||
{section.buildSteps.steps.map((s, i) => (
|
||||
<li key={i} className="flex flex-col gap-2 rounded-xl border border-subtle bg-surface-base p-5">
|
||||
<span className="font-mono text-xs uppercase tracking-[0.18em] text-action">{formatStepLabel(ui.step, i + 1)}</span>
|
||||
<h4 className="text-base font-semibold text-text-primary">{s.title}</h4>
|
||||
<p className="text-sm leading-relaxed text-text-secondary">{s.body}</p>
|
||||
{s.linkUrl && s.linkLabel && (
|
||||
<a href={s.linkUrl} target="_blank" rel="noopener noreferrer" className="mt-auto inline-flex items-center gap-1.5 pt-2 text-xs font-medium text-action hover:underline underline-offset-2">
|
||||
{s.linkLabel}<ExternalLink className="h-3 w-3" aria-hidden="true" />
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
<h3 className="mt-12 text-lg font-semibold text-text-primary">{section.photoGallery.title}</h3>
|
||||
<p className="mt-2 text-sm text-text-secondary">{section.photoGallery.intro}</p>
|
||||
<ul className="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{section.photoGallery.items.map((p) => (
|
||||
<li key={p.src} className="flex flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-3">
|
||||
<figure className="relative aspect-[4/3] overflow-hidden rounded-lg bg-canvas">
|
||||
{/* Photos are pre-compressed (max 1600px, mozjpeg q82). Letting
|
||||
Next/Image transcode to AVIF/WebP + size them per breakpoint
|
||||
is a further 2-4x savings on most clients. */}
|
||||
<Image
|
||||
src={p.src}
|
||||
alt={p.caption}
|
||||
fill
|
||||
sizes="(min-width: 1024px) 30vw, (min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</figure>
|
||||
<figcaption className="text-xs leading-relaxed text-text-secondary">{p.caption}</figcaption>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<ul className="mt-8 flex flex-wrap gap-x-5 gap-y-2 text-sm">
|
||||
{section.links.map((l) => (
|
||||
<li key={l.url}>
|
||||
<a href={l.url} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-1.5 font-medium text-action hover:underline underline-offset-2">
|
||||
{l.label}<ExternalLink className="h-3 w-3" aria-hidden="true" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 3. Lieferanten ──────────────────────────────────────────────── */
|
||||
|
||||
export function Lieferanten({ section, citeMap, ui }: { section: BusinessPlan['lieferanten']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="lieferanten" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<div className="mt-8 rounded-xl border border-subtle bg-surface-base p-5 sm:p-6">
|
||||
<h3 className="text-lg font-semibold text-text-primary">{section.stockBreakdown.title}</h3>
|
||||
<p className="mt-1 font-mono text-xs uppercase tracking-[0.14em] text-text-tertiary">{section.stockBreakdown.subtitle}</p>
|
||||
<dl className="mt-4 divide-y divide-subtle border-y border-subtle">
|
||||
{section.stockBreakdown.rows.map((r, i) => (
|
||||
<div key={i} className={cn('grid grid-cols-[1fr_auto] gap-x-4 py-3 sm:gap-x-6', r.emphasis && 'bg-action-muted/40 -mx-4 px-4 sm:-mx-6 sm:px-6')}>
|
||||
<dt className={cn('text-sm text-text-primary', r.emphasis && 'font-semibold')}>{r.label}{r.note && <span className="ml-2 text-xs text-action">{r.note}</span>}</dt>
|
||||
<dd className={cn('font-mono text-sm tabular-nums text-text-primary', r.emphasis && 'font-semibold')}>{r.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<SourceLine cite={section.stockBreakdown.cite} citeMap={citeMap} ui={ui} />
|
||||
</div>
|
||||
|
||||
<h3 className="mt-10 text-lg font-semibold text-text-primary">{section.channels.title}</h3>
|
||||
<ul className="mt-4 grid gap-4 sm:grid-cols-3">
|
||||
{section.channels.items.map((c, i) => (
|
||||
<li key={i} className="flex flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-5">
|
||||
<span className="font-mono text-xs uppercase tracking-[0.16em] text-action">{c.label}</span>
|
||||
<p className="text-sm leading-relaxed text-text-secondary">{c.body}<Cite k={c.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
{c.linkUrl && c.linkLabel && (
|
||||
<a href={c.linkUrl} {...(c.linkUrl.startsWith('http') ? { target: '_blank', rel: 'noopener noreferrer' } : {})} className="mt-auto inline-flex items-center gap-1.5 text-xs font-medium text-action hover:underline underline-offset-2">
|
||||
{c.linkLabel}<ExternalLink className="h-3 w-3" aria-hidden="true" />
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<div className="mt-8 grid gap-4 sm:grid-cols-2">
|
||||
<CriteriaCard variant="accept" title={section.criteria.title} items={section.criteria.items} cite={section.criteria.cite} citeMap={citeMap} ui={ui} />
|
||||
<CriteriaCard variant="reject" title={section.rejected.title} items={section.rejected.items} cite={section.rejected.cite} citeMap={citeMap} ui={ui} />
|
||||
</div>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 4. Alternativen am Markt ────────────────────────────────────── */
|
||||
|
||||
export function Alternativen({ section, citeMap, ui }: { section: BusinessPlan['alternativen']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="alternativen" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<figure className="mt-8 grid gap-6 rounded-xl border border-subtle bg-surface-base p-4 sm:grid-cols-[1.2fr_1fr] sm:p-6">
|
||||
<div className="relative aspect-[4/3] overflow-hidden rounded-lg bg-canvas">
|
||||
<Image src={section.benchmarkPhoto.src} alt={section.benchmarkPhoto.caption} fill sizes="(min-width: 640px) 40vw, 100vw" className="object-cover" />
|
||||
</div>
|
||||
<figcaption className="self-center text-sm leading-relaxed text-text-secondary">{section.benchmarkPhoto.caption}</figcaption>
|
||||
</figure>
|
||||
|
||||
<h3 className="mt-10 text-lg font-semibold text-text-primary">{section.alternativesTable.title}</h3>
|
||||
<ul className="mt-4 divide-y divide-subtle border-y border-subtle">
|
||||
{section.alternativesTable.rows.map((alt, i) => (
|
||||
<li key={i} className={cn('grid grid-cols-1 gap-2 py-5 sm:grid-cols-[1fr_auto] sm:gap-x-6', alt.isOurs && 'bg-action-muted/30 -mx-4 px-4 sm:-mx-6 sm:px-6')}>
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<span className={cn('text-sm font-medium text-text-primary sm:text-base', alt.isOurs && 'text-action')}>{alt.label}</span>
|
||||
{alt.linkUrl && alt.linkLabel && (
|
||||
<a href={alt.linkUrl} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-0.5 text-xs text-action hover:underline" aria-label={`${alt.label} — Quelle`}>
|
||||
{alt.linkLabel}<ExternalLink className="h-3 w-3" aria-hidden="true" />
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
<p className="mt-1.5 text-xs leading-relaxed text-text-secondary sm:text-sm">{alt.note}<Cite k={alt.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</div>
|
||||
<div className="font-mono text-sm tabular-nums text-text-primary sm:text-base sm:text-right">{alt.price}</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p className="mt-6 max-w-3xl text-sm leading-relaxed text-text-secondary sm:text-base">
|
||||
<span className="mr-2 font-mono text-xs uppercase tracking-[0.16em] text-text-tertiary">→</span>{section.verdict}
|
||||
</p>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 5. Kunden ──────────────────────────────────────────────────── */
|
||||
|
||||
export function Kunden({ section, citeMap, ui }: { section: BusinessPlan['kunden']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="kunden" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ul className="mt-8 grid gap-4 sm:gap-5 md:grid-cols-2">
|
||||
{section.segments.map((s, i) => (
|
||||
<li key={i} className="flex min-w-0 flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-6">
|
||||
<span className="font-mono text-xs uppercase tracking-[0.18em] text-action">{s.label}</span>
|
||||
<p className="text-sm leading-relaxed text-text-secondary">{s.body}<Cite k={s.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<details className="mt-8 group rounded-xl border border-subtle bg-surface-base open:bg-canvas">
|
||||
<summary className="cursor-pointer list-none px-5 py-4 flex items-center justify-between gap-3 text-sm font-medium text-text-secondary hover:text-text-primary">
|
||||
<DisclosureSummary badge={ui.badges.detail} title={section.pilotPlan.title} />
|
||||
</summary>
|
||||
<div className="px-5 pb-5 text-sm leading-relaxed text-text-secondary">
|
||||
<p>{section.pilotPlan.intro}</p>
|
||||
<ul className="mt-3 space-y-1">
|
||||
{section.pilotPlan.items.map((it, i) => (
|
||||
<li key={i} className="flex items-start gap-2">
|
||||
<span aria-hidden="true" className="font-mono text-text-tertiary">·</span>{it}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<SourceLine cite={section.pilotPlan.cite} citeMap={citeMap} ui={ui} />
|
||||
</div>
|
||||
</details>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 6. Wirtschaftlichkeit ──────────────────────────────────────── */
|
||||
|
||||
export function Wirtschaftlichkeit({ section, citeMap, ui }: { section: BusinessPlan['wirtschaftlichkeit']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="wirtschaftlichkeit" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<div className="mt-8 rounded-xl border border-subtle bg-surface-base p-5 sm:p-6">
|
||||
<h3 className="text-lg font-semibold text-text-primary">{section.budget.title}</h3>
|
||||
<p className="mt-2 text-sm text-text-secondary">{section.budget.note}</p>
|
||||
<dl className="mt-5 divide-y divide-subtle border-y border-subtle">
|
||||
{section.budget.rows.map((r, i) => (
|
||||
<div key={i} className={cn('grid grid-cols-[1fr_auto] gap-x-4 py-3 sm:gap-x-6', r.emphasis && 'bg-action-muted/40 -mx-4 px-4 sm:-mx-6 sm:px-6')}>
|
||||
<dt className={cn('text-sm leading-snug text-text-primary', r.emphasis && 'font-semibold')}>{r.label}{r.note && <span className="ml-2 text-xs text-text-tertiary">{r.note}</span>}</dt>
|
||||
<dd className={cn('font-mono text-sm tabular-nums text-text-primary', r.emphasis && 'font-semibold')}>{r.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<SourceLine cite={section.budget.cite} citeMap={citeMap} ui={ui} />
|
||||
</div>
|
||||
|
||||
<p className="mt-6 max-w-3xl rounded-xl border border-dashed border-subtle bg-canvas p-5 text-sm leading-relaxed text-text-secondary">
|
||||
{section.scopeNote}<Cite k={section.scopeCite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 7. Wissenschaftliche Begleitung ─────────────────────────────── */
|
||||
|
||||
export function Wissenschaft({ section, citeMap, ui }: { section: BusinessPlan['wissenschaft']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="wissenschaft" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<div className="mt-8 rounded-xl border border-subtle bg-surface-base p-5 sm:p-6">
|
||||
<h3 className="text-lg font-semibold text-text-primary">{section.factsheet.title}</h3>
|
||||
<dl className="mt-4 divide-y divide-subtle border-y border-subtle">
|
||||
{section.factsheet.rows.map((r, i) => (
|
||||
<div key={i} className="grid grid-cols-1 gap-1 py-3 sm:grid-cols-[12rem_1fr] sm:gap-x-6">
|
||||
<dt className="font-mono text-xs uppercase tracking-[0.14em] text-text-tertiary">{r.label}</dt>
|
||||
<dd className="text-sm text-text-primary">{r.value}<Cite k={r.cite} citeMap={citeMap} ui={ui} />{r.linkUrl && r.linkLabel && (<> · <a href={r.linkUrl} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-0.5 text-xs text-action hover:underline">{r.linkLabel}<ExternalLink className="h-3 w-3" aria-hidden="true" /></a></>)}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<details className="mt-6 group rounded-xl border border-subtle bg-surface-base open:bg-canvas">
|
||||
<summary className="cursor-pointer list-none px-5 py-4 flex items-center justify-between gap-3 text-sm font-medium text-text-secondary hover:text-text-primary">
|
||||
<DisclosureSummary badge={ui.badges.plan} title={section.timeline.title} />
|
||||
</summary>
|
||||
<ol className="px-5 pb-5 divide-y divide-subtle border-t border-subtle">
|
||||
{section.timeline.phases.map((p, i) => (
|
||||
<li key={i} className="grid grid-cols-1 gap-1 py-3 sm:grid-cols-[1fr_auto] sm:gap-x-6">
|
||||
<span className="text-sm text-text-primary">{p.label}</span>
|
||||
<span className="font-mono text-xs tabular-nums text-text-tertiary sm:text-right">{p.date}</span>
|
||||
</li>
|
||||
))}
|
||||
<li className="pt-3"><SourceLine cite={section.timeline.cite} citeMap={citeMap} ui={ui} /></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
<details className="mt-4 group rounded-xl border border-subtle bg-surface-base open:bg-canvas">
|
||||
<summary className="cursor-pointer list-none px-5 py-4 flex items-center justify-between gap-3 text-sm font-medium text-text-secondary hover:text-text-primary">
|
||||
<DisclosureSummary badge={ui.badges.scope} title={section.scope.title} />
|
||||
</summary>
|
||||
<div className="px-5 pb-5 text-sm leading-relaxed text-text-secondary">
|
||||
<ul className="space-y-2">
|
||||
{section.scope.items.map((it, i) => (
|
||||
<li key={i} className="flex items-start gap-2"><span aria-hidden="true" className="mt-1 font-mono text-text-tertiary">·</span>{it}</li>
|
||||
))}
|
||||
</ul>
|
||||
<SourceLine cite={section.scope.cite} citeMap={citeMap} ui={ui} />
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<p className="mt-6 max-w-3xl text-sm leading-relaxed text-text-secondary">
|
||||
{section.history}<Cite k={section.historyCite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 8. CE-Konformität ────────────────────────────────────────── */
|
||||
|
||||
export function CE({ section, citeMap, ui }: { section: BusinessPlan['ce']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="ce" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<h3 className="mt-8 text-lg font-semibold text-text-primary">{section.approach.title}</h3>
|
||||
<ul className="mt-4 grid gap-4 sm:grid-cols-2">
|
||||
{section.approach.items.map((it, i) => (
|
||||
<li key={i} className="rounded-xl border border-subtle bg-surface-base p-5">
|
||||
<h4 className="font-mono text-xs uppercase tracking-[0.18em] text-action">{it.label}</h4>
|
||||
<p className="mt-3 text-sm leading-relaxed text-text-secondary">{it.body}<Cite k={it.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 9. Partner ──────────────────────────────────────────────── */
|
||||
|
||||
export function Partner({ section, citeMap, ui }: { section: BusinessPlan['partner']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="partner" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<div className="mt-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3">
|
||||
{section.groups.map((g, gi) => (
|
||||
<details key={gi} open={gi < 2} className="group rounded-xl border border-subtle bg-surface-base open:bg-canvas">
|
||||
<summary className="cursor-pointer list-none px-5 py-4 flex items-center justify-between gap-3">
|
||||
<span className="font-mono text-xs uppercase tracking-[0.18em] text-action">{g.title}</span>
|
||||
<span aria-hidden="true" className="font-mono text-text-tertiary transition-transform group-open:rotate-180">⌄</span>
|
||||
</summary>
|
||||
<div className="px-5 pb-5 space-y-3 text-sm leading-relaxed">
|
||||
{g.intro && <p className="text-text-tertiary text-xs">{g.intro}</p>}
|
||||
<ul className="space-y-3">
|
||||
{g.items.map((it, i) => (
|
||||
<li key={i} className="border-t border-subtle pt-3 first:border-t-0 first:pt-0">
|
||||
<div className="font-medium text-text-primary">{it.name}{it.linkUrl && it.linkLabel && (<> · <a href={it.linkUrl} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-0.5 text-xs text-action hover:underline">{it.linkLabel}<ExternalLink className="h-3 w-3" aria-hidden="true" /></a></>)}</div>
|
||||
<p className="mt-0.5 text-text-secondary">{it.role}<Cite k={it.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p className="mt-6 max-w-3xl rounded-xl border border-dashed border-subtle bg-surface-base p-5 text-sm leading-relaxed text-text-secondary">
|
||||
{section.klimastNote}<Cite k={section.klimastCite} citeMap={citeMap} ui={ui} />
|
||||
</p>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 10. Risiken ─────────────────────────────────────────────── */
|
||||
|
||||
export function Risiken({ section, citeMap, ui }: { section: BusinessPlan['risiken']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="risiken" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ul className="mt-8 space-y-3">
|
||||
{section.items.map((r, i) => (
|
||||
<li key={i} className="rounded-xl border border-subtle bg-surface-base">
|
||||
<details className="group">
|
||||
<summary className="cursor-pointer list-none px-5 py-4 flex items-start gap-4">
|
||||
<span className="flex-1 text-sm font-medium text-text-primary sm:text-base">{r.label}</span>
|
||||
<span className="shrink-0 rounded-full bg-surface-raised px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.14em] text-action">{r.status}</span>
|
||||
<span aria-hidden="true" className="mt-1 font-mono text-text-tertiary transition-transform group-open:rotate-180">⌄</span>
|
||||
</summary>
|
||||
<p className="px-5 pb-5 text-sm leading-relaxed text-text-secondary">{r.body}<Cite k={r.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</details>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 11. Förderung ─────────────────────────────────────────── */
|
||||
|
||||
export function Foerderung({ section, citeMap, ui }: { section: BusinessPlan['foerderung']; citeMap: Map<string, number>; ui: BusinessPlanUi }) {
|
||||
return (
|
||||
<Section id="foerderung" tone="raised">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ul className="mt-8 divide-y divide-subtle border-y border-subtle">
|
||||
{section.lines.map((l, i) => (
|
||||
<li key={i} className="grid grid-cols-1 gap-2 py-4 sm:grid-cols-[1.4fr_auto_auto] sm:items-baseline sm:gap-x-6">
|
||||
<div className="min-w-0">
|
||||
<div className="text-sm font-medium text-text-primary sm:text-base">{l.label}</div>
|
||||
<p className="mt-1 text-xs leading-relaxed text-text-secondary sm:text-sm">{l.note}<Cite k={l.cite} citeMap={citeMap} ui={ui} /></p>
|
||||
</div>
|
||||
<span className="rounded-full bg-surface-base px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.14em] text-action sm:self-start">{l.status}</span>
|
||||
<span className="font-mono text-sm tabular-nums text-text-primary sm:text-right">{l.amount}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 12. Mitmachen ─────────────────────────────────────────── */
|
||||
|
||||
export function Mitmachen({ section }: { section: BusinessPlan['mitmachen'] }) {
|
||||
return (
|
||||
<Section id="mitmachen" tone="canvas">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ul className="mt-8 grid gap-4 sm:grid-cols-2">
|
||||
{section.options.map((o) => (
|
||||
<li key={o.key} className="flex min-w-0 flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-6">
|
||||
<h3 className="text-base font-semibold text-text-primary">{o.title}</h3>
|
||||
<p className="text-sm leading-relaxed text-text-secondary">{o.body}</p>
|
||||
<a href={o.ctaHref} {...(o.ctaHref.startsWith('http') ? { target: '_blank', rel: 'noopener noreferrer' } : {})} className="mt-auto inline-flex items-center gap-1.5 pt-2 text-sm font-medium text-action hover:underline underline-offset-2">
|
||||
{o.ctaLabel}<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 13. Belege & Quellen ─────────────────────────────────── */
|
||||
|
||||
export function Belege({ section }: { section: BusinessPlan['belege'] }) {
|
||||
return (
|
||||
<Section id="belege" tone="base">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ol className="mt-8 space-y-3">
|
||||
{section.citations.map((c, i) => (
|
||||
<li id={`belege-${c.key}`} key={c.key} className="scroll-mt-28 rounded-lg border border-subtle bg-canvas p-4">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<span className="font-mono text-xs text-action shrink-0">[{i + 1}]</span>
|
||||
<div className="min-w-0">
|
||||
<div className="text-sm font-medium text-text-primary">{c.label}</div>
|
||||
<p className="mt-1 text-xs leading-relaxed text-text-secondary">{c.detail}</p>
|
||||
{c.url && (
|
||||
<a href={c.url} target="_blank" rel="noopener noreferrer" className="mt-1 inline-flex items-center gap-1 text-xs text-action hover:underline">
|
||||
<Mail className="h-3 w-3" aria-hidden="true" />{c.url}<ExternalLink className="h-3 w-3" aria-hidden="true" />
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { DesktopTocRail } from './DesktopTocRail'
|
||||
import { BusinessPlanHero, BusinessPlanMobileToc } from './components/HeroAndToc'
|
||||
import {
|
||||
Alternativen,
|
||||
Belege,
|
||||
CE,
|
||||
ExecutiveSummary,
|
||||
Foerderung,
|
||||
Kunden,
|
||||
Lieferanten,
|
||||
Mitmachen,
|
||||
Partner,
|
||||
Produkt,
|
||||
Risiken,
|
||||
Status,
|
||||
Wirtschaftlichkeit,
|
||||
Wissenschaft,
|
||||
} from './components/sections'
|
||||
import type { BusinessPlan } from './types'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/**
|
||||
* /projects/upcycling/businessplan — source-grounded evidence page.
|
||||
* Content SSOT: messages/<lc>.json → projects.upcycling.businessPlan
|
||||
* Shape/invariant parity: npm run i18n:businessplan
|
||||
*/
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.businessPlan') as BusinessPlan
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('businessplan', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingBusinessPlanPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.businessPlan') as BusinessPlan
|
||||
const citeMap = new Map(m.belege.citations.map((c, i) => [c.key, i + 1]))
|
||||
const sectionProps = { citeMap, ui: m.ui }
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<BusinessPlanHero hero={m.hero} documentMeta={m.documentMeta} />
|
||||
<BusinessPlanMobileToc nav={m.nav} />
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="lg:grid lg:grid-cols-[12rem_minmax(0,1fr)] lg:gap-10">
|
||||
<DesktopTocRail nav={m.nav} />
|
||||
<main className="min-w-0">
|
||||
<ExecutiveSummary section={m.executiveSummary} />
|
||||
<Status section={m.status} {...sectionProps} />
|
||||
<Produkt section={m.produkt} ui={m.ui} />
|
||||
<Lieferanten section={m.lieferanten} {...sectionProps} />
|
||||
<Alternativen section={m.alternativen} {...sectionProps} />
|
||||
<Kunden section={m.kunden} {...sectionProps} />
|
||||
<Wirtschaftlichkeit section={m.wirtschaftlichkeit} {...sectionProps} />
|
||||
<Wissenschaft section={m.wissenschaft} {...sectionProps} />
|
||||
<CE section={m.ce} {...sectionProps} />
|
||||
<Partner section={m.partner} {...sectionProps} />
|
||||
<Risiken section={m.risiken} {...sectionProps} />
|
||||
<Foerderung section={m.foerderung} {...sectionProps} />
|
||||
<Mitmachen section={m.mitmachen} />
|
||||
<Belege section={m.belege} />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
export type Cite = string | null
|
||||
|
||||
export type NavItem = { id: string; label: string }
|
||||
|
||||
export type Kpi = { label: string; value: string; note: string; cite: Cite }
|
||||
|
||||
export type BuildStep = { title: string; body: string; cite: Cite; linkLabel?: string; linkUrl?: string }
|
||||
|
||||
export type Photo = { src: string; caption: string }
|
||||
|
||||
export type StockRow = { label: string; value: string; emphasis?: boolean; note?: string }
|
||||
|
||||
export type Channel = { label: string; body: string; cite: Cite; linkLabel?: string; linkUrl?: string }
|
||||
|
||||
export type AlternativeRow = { label: string; price: string; note: string; cite: Cite; linkLabel: string | null; linkUrl: string | null; isOurs?: boolean }
|
||||
|
||||
export type Segment = { label: string; body: string; cite: Cite }
|
||||
|
||||
export type BudgetRow = { label: string; value: string; note?: string; emphasis?: boolean }
|
||||
|
||||
export type FactRow = { label: string; value: string; cite: Cite; linkLabel?: string; linkUrl?: string }
|
||||
|
||||
export type TimelinePhase = { label: string; date: string }
|
||||
|
||||
export type PartnerItem = { name: string; role: string; cite: Cite; linkLabel?: string; linkUrl?: string }
|
||||
|
||||
export type PartnerGroup = { title: string; intro?: string; items: PartnerItem[] }
|
||||
|
||||
export type RiskItem = { label: string; status: string; body: string; cite: Cite }
|
||||
|
||||
export type FundingLine = { label: string; status: string; amount: string; note: string; cite: Cite }
|
||||
|
||||
export type GetInvolved = { key: string; title: string; body: string; ctaLabel: string; ctaHref: string; cite: Cite }
|
||||
|
||||
export type Citation = { key: string; label: string; detail: string; url: string | null }
|
||||
|
||||
export type BusinessPlanUi = {
|
||||
step: string
|
||||
source: string
|
||||
citationAria: string
|
||||
badges: { detail: string; plan: string; scope: string }
|
||||
}
|
||||
|
||||
export type BusinessPlan = {
|
||||
meta: { title: string; description: string }
|
||||
ui: BusinessPlanUi
|
||||
nav: { label: string; items: NavItem[] }
|
||||
documentMeta: {
|
||||
project: string
|
||||
sponsor: string
|
||||
preparedBy: string
|
||||
asOf: string
|
||||
versionLabel: string
|
||||
projectLabel: string
|
||||
sponsorLabel: string
|
||||
preparedByLabel: string
|
||||
}
|
||||
hero: { eyebrow: string; title: string; intro: string; heroVideo: string; heroPoster: string; heroImageAlt: string }
|
||||
executiveSummary: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
paragraphs: string[]
|
||||
highlights: { label: string; value: string }[]
|
||||
}
|
||||
status: { eyebrow: string; title: string; intro: string; kpis: Kpi[] }
|
||||
produkt: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
buildSteps: { title: string; steps: BuildStep[] }
|
||||
photoGallery: { title: string; intro: string; items: Photo[] }
|
||||
links: { label: string; url: string }[]
|
||||
}
|
||||
lieferanten: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
stockBreakdown: { title: string; subtitle: string; rows: StockRow[]; cite: Cite }
|
||||
channels: { title: string; items: Channel[] }
|
||||
criteria: { title: string; items: string[]; cite: Cite }
|
||||
rejected: { title: string; items: string[]; cite: Cite }
|
||||
}
|
||||
alternativen: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
benchmarkPhoto: Photo
|
||||
alternativesTable: { title: string; rows: AlternativeRow[] }
|
||||
verdict: string
|
||||
}
|
||||
kunden: {
|
||||
eyebrow: string; title: string; intro: string; segments: Segment[]
|
||||
pilotPlan: { title: string; intro: string; items: string[]; cite: Cite }
|
||||
}
|
||||
wirtschaftlichkeit: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
budget: { title: string; note: string; rows: BudgetRow[]; cite: Cite }
|
||||
scopeNote: string; scopeCite: Cite
|
||||
}
|
||||
wissenschaft: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
factsheet: { title: string; rows: FactRow[] }
|
||||
timeline: { title: string; phases: TimelinePhase[]; cite: Cite }
|
||||
scope: { title: string; items: string[]; cite: Cite }
|
||||
history: string; historyCite: Cite
|
||||
}
|
||||
ce: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
approach: { title: string; items: { label: string; body: string; cite: Cite }[] }
|
||||
}
|
||||
partner: {
|
||||
eyebrow: string; title: string; intro: string
|
||||
groups: PartnerGroup[]
|
||||
klimastNote: string; klimastCite: Cite
|
||||
}
|
||||
risiken: { eyebrow: string; title: string; intro: string; items: RiskItem[] }
|
||||
foerderung: { eyebrow: string; title: string; intro: string; lines: FundingLine[] }
|
||||
mitmachen: { eyebrow: string; title: string; intro: string; options: GetInvolved[] }
|
||||
belege: { eyebrow: string; title: string; intro: string; citations: Citation[] }
|
||||
}
|
||||
@@ -1,221 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useMemo, useState } from 'react'
|
||||
import { Mail, Phone, ExternalLink, MapPin, Search, Send } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import type { DossierGroup, DossierContact, DossierOutreach } from '@/data/upcycling-dossier'
|
||||
|
||||
/** Vorausgefüllter mailto:-Link aus der Akquise-Botschaft der Gruppe. */
|
||||
function mailtoFor(email: string, outreach: DossierOutreach): string {
|
||||
const params = new URLSearchParams({ subject: outreach.subject, body: outreach.body })
|
||||
// URLSearchParams kodiert Leerzeichen als '+'; mailto erwartet %20.
|
||||
return `mailto:${email}?${params.toString().replace(/\+/g, '%20')}`
|
||||
}
|
||||
|
||||
function telHref(phone: string): string {
|
||||
return `tel:${phone.replace(/[^+\d]/g, '')}`
|
||||
}
|
||||
|
||||
function matches(c: DossierContact, q: string): boolean {
|
||||
if (!q) return true
|
||||
const hay = `${c.name} ${c.category} ${c.city ?? ''} ${c.note ?? ''}`.toLowerCase()
|
||||
return hay.includes(q)
|
||||
}
|
||||
|
||||
export function DossierContacts({ groups }: { groups: DossierGroup[] }) {
|
||||
const [active, setActive] = useState<string>('alle')
|
||||
const [query, setQuery] = useState('')
|
||||
const q = query.trim().toLowerCase()
|
||||
|
||||
const visibleGroups = useMemo(() => {
|
||||
const base = active === 'alle' ? groups : groups.filter((g) => g.key === active)
|
||||
return base
|
||||
.map((g) => ({ ...g, contacts: g.contacts.filter((c) => matches(c, q)) }))
|
||||
.filter((g) => g.contacts.length > 0)
|
||||
}, [groups, active, q])
|
||||
|
||||
const totalShown = visibleGroups.reduce((n, g) => n + g.contacts.length, 0)
|
||||
|
||||
const chips: { key: string; label: string; count: number }[] = [
|
||||
{ key: 'alle', label: 'Alle', count: groups.reduce((n, g) => n + g.contacts.length, 0) },
|
||||
...groups.map((g) => ({ key: g.key, label: g.shortLabel, count: g.contacts.length })),
|
||||
]
|
||||
|
||||
return (
|
||||
<section className="border-b border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<h2 className="ui-public-display-md">Akquise-Kontakte</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">
|
||||
Reale, öffentlich verifizierbare Geschäftsadressen. Die E-Mail-Schaltfläche
|
||||
öffnet eine vorausgefüllte Nachricht — passend zur jeweiligen Gruppe.
|
||||
</p>
|
||||
|
||||
{/* Steuerung: Gruppen-Chips + Suche */}
|
||||
<div className="mt-8 flex flex-col gap-4">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{chips.map((chip) => {
|
||||
const isActive = active === chip.key
|
||||
return (
|
||||
<Button
|
||||
key={chip.key}
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => setActive(chip.key)}
|
||||
aria-pressed={isActive}
|
||||
className={cn(
|
||||
'h-auto gap-1.5 rounded-full border px-3 py-1.5 text-sm font-medium',
|
||||
isActive
|
||||
? 'border-action bg-action text-white hover:bg-action'
|
||||
: 'border-subtle bg-surface-base text-text-secondary hover:border-action/40 hover:bg-surface-base hover:text-text-primary',
|
||||
)}
|
||||
>
|
||||
{chip.label}
|
||||
<span className={cn('font-mono text-xs', isActive ? 'text-white/80' : 'text-text-tertiary')}>
|
||||
{chip.count}
|
||||
</span>
|
||||
</Button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div className="relative max-w-sm">
|
||||
<Search className="pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-text-tertiary" aria-hidden="true" />
|
||||
<Input
|
||||
type="search"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder="Name, Kategorie oder Ort suchen…"
|
||||
aria-label="Kontakte durchsuchen"
|
||||
className="pl-9"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Gruppen */}
|
||||
{visibleGroups.length === 0 ? (
|
||||
<p className="mt-12 text-sm text-text-tertiary">
|
||||
Keine Treffer für „{query}“.
|
||||
</p>
|
||||
) : (
|
||||
<div className="mt-12 space-y-14">
|
||||
{visibleGroups.map((group) => (
|
||||
<div key={group.key}>
|
||||
<div className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1">
|
||||
<h3 className="text-lg font-semibold text-text-primary sm:text-xl">{group.title}</h3>
|
||||
<span className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{group.contacts.length} {group.contacts.length === 1 ? 'Kontakt' : 'Kontakte'}
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-2 max-w-3xl text-sm text-text-secondary">{group.intro}</p>
|
||||
<p className="mt-2 inline-flex items-center gap-1.5 text-xs text-text-tertiary">
|
||||
<Send className="h-3 w-3" aria-hidden="true" />
|
||||
E-Mail-Vorlage: „{group.outreach.subject}“
|
||||
</p>
|
||||
|
||||
<div className="mt-6 grid gap-4 sm:grid-cols-2">
|
||||
{group.contacts.map((contact) => (
|
||||
<ContactCard key={contact.name} contact={contact} outreach={group.outreach} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="mt-10 font-mono text-xs text-text-tertiary">
|
||||
{totalShown} von {chips[0].count} Kontakten angezeigt
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function ContactCard({
|
||||
contact,
|
||||
outreach,
|
||||
}: {
|
||||
contact: DossierContact
|
||||
outreach: DossierOutreach
|
||||
}) {
|
||||
return (
|
||||
<div className="flex min-w-0 flex-col rounded-xl border border-subtle bg-surface-base p-5 transition-colors hover:border-strong">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<h4 className="min-w-0 break-words text-base font-semibold text-text-primary">{contact.name}</h4>
|
||||
<span className="shrink-0 rounded-full border border-subtle bg-surface-raised px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.14em] text-text-tertiary">
|
||||
{contact.category}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{(contact.address || contact.city) && (
|
||||
<p className="mt-2 inline-flex items-start gap-1.5 text-sm text-text-secondary">
|
||||
<MapPin className="mt-0.5 h-3.5 w-3.5 shrink-0 text-text-tertiary" aria-hidden="true" />
|
||||
<span>
|
||||
{contact.address ? `${contact.address}, ` : ''}
|
||||
{contact.city}
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
|
||||
{contact.note && <p className="mt-2 text-sm text-text-secondary">{contact.note}</p>}
|
||||
|
||||
<div className="mt-auto flex flex-wrap gap-2 pt-4">
|
||||
{contact.email && (
|
||||
<ActionLink href={mailtoFor(contact.email, outreach)} icon={Mail} primary>
|
||||
E-Mail
|
||||
</ActionLink>
|
||||
)}
|
||||
|
||||
{contact.bestContactUrl && (
|
||||
<ActionLink href={contact.bestContactUrl} icon={ExternalLink} external primary={!contact.email}>
|
||||
Kontaktseite
|
||||
</ActionLink>
|
||||
)}
|
||||
|
||||
{contact.phone && (
|
||||
<ActionLink href={telHref(contact.phone)} icon={Phone}>
|
||||
{contact.phone}
|
||||
</ActionLink>
|
||||
)}
|
||||
|
||||
{contact.website && contact.website !== contact.bestContactUrl && (
|
||||
<ActionLink href={contact.website} icon={ExternalLink} external primary={!contact.email && !contact.bestContactUrl}>
|
||||
Website
|
||||
</ActionLink>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function ActionLink({
|
||||
href,
|
||||
icon: Icon,
|
||||
children,
|
||||
primary,
|
||||
external,
|
||||
}: {
|
||||
href: string
|
||||
icon: typeof Mail
|
||||
children: React.ReactNode
|
||||
primary?: boolean
|
||||
external?: boolean
|
||||
}) {
|
||||
return (
|
||||
<a
|
||||
href={href}
|
||||
{...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
|
||||
className={cn(
|
||||
'inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors',
|
||||
primary
|
||||
? 'border-action/40 bg-action-muted/15 text-action hover:bg-action-muted/25'
|
||||
: 'border-subtle bg-surface-base text-text-secondary hover:border-action/40 hover:text-text-primary',
|
||||
)}
|
||||
>
|
||||
<Icon className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
<span className="break-all">{children}</span>
|
||||
</a>
|
||||
)
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useActionState, useEffect, useRef } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { Lock, Loader2, ArrowRight } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { unlockDossier, type UnlockState } from './actions'
|
||||
|
||||
const INITIAL: UnlockState = { ok: false }
|
||||
|
||||
/**
|
||||
* Passwortschranke für das interne Dossier. Prüfung erfolgt serverseitig
|
||||
* (Server Action); bei Erfolg setzt der Server das Cookie und der Client
|
||||
* lädt die Route neu, sodass die geschützten Inhalte gerendert werden.
|
||||
*/
|
||||
export function DossierGate() {
|
||||
const router = useRouter()
|
||||
const [state, formAction, pending] = useActionState(unlockDossier, INITIAL)
|
||||
const inputRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (state.ok) router.refresh()
|
||||
}, [state.ok, router])
|
||||
|
||||
useEffect(() => {
|
||||
if (state.error) inputRef.current?.focus()
|
||||
}, [state.error])
|
||||
|
||||
return (
|
||||
<div className="flex min-h-[70vh] items-center justify-center bg-canvas px-4 py-16">
|
||||
<div className="w-full max-w-sm">
|
||||
<div className="flex flex-col items-center text-center">
|
||||
<span className="flex h-12 w-12 items-center justify-center rounded-full border border-subtle bg-surface-raised text-action">
|
||||
<Lock className="h-5 w-5" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="ui-public-eyebrow mt-6">Intern · Vertraulich</div>
|
||||
<h1 className="ui-public-display-md mt-2">Projektdossier</h1>
|
||||
<p className="mt-3 text-sm text-text-secondary">
|
||||
Dieser Bereich enthält interne Akquise-Kontakte und den Projektstand
|
||||
zur Umwandlung von Monitoren in Leuchten. Bitte Passwort eingeben.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form action={formAction} className="mt-8">
|
||||
<label htmlFor="dossier-password" className="sr-only">
|
||||
Passwort
|
||||
</label>
|
||||
<Input
|
||||
ref={inputRef}
|
||||
id="dossier-password"
|
||||
name="password"
|
||||
type="password"
|
||||
autoComplete="off"
|
||||
autoFocus
|
||||
required
|
||||
aria-invalid={state.error ? true : undefined}
|
||||
aria-describedby={state.error ? 'dossier-error' : undefined}
|
||||
placeholder="Passwort"
|
||||
/>
|
||||
|
||||
{state.error && (
|
||||
<p id="dossier-error" className="mt-2 text-sm text-warning-600 dark:text-warning-400">
|
||||
{state.error}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
disabled={pending}
|
||||
className="mt-4 w-full gap-2"
|
||||
>
|
||||
{pending ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" aria-hidden="true" />
|
||||
) : (
|
||||
<>
|
||||
Öffnen
|
||||
<ArrowRight className="h-4 w-4" aria-hidden="true" />
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
import {
|
||||
ListChecks,
|
||||
HelpCircle,
|
||||
Lightbulb,
|
||||
CheckCircle2,
|
||||
Circle,
|
||||
Lock,
|
||||
FileText,
|
||||
} from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { UpcyclingPageHeader } from '../UpcyclingPageHeader'
|
||||
import { DOSSIER_GROUPS, DOSSIER_PROJECT } from '@/data/upcycling-dossier'
|
||||
import { DossierContacts } from './DossierContacts'
|
||||
import { lockDossier } from './actions'
|
||||
|
||||
/**
|
||||
* Geschützte Dossier-Ansicht. Reine Render-Schicht über der Daten-SSOT
|
||||
* `@/data/upcycling-dossier`. Wird nur gerendert, wenn das Zugangscookie
|
||||
* gültig ist (Prüfung in page.tsx).
|
||||
*/
|
||||
export function DossierView() {
|
||||
const p = DOSSIER_PROJECT
|
||||
const snapshotLabel = formatSnapshot(p.snapshotIso)
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<UpcyclingPageHeader
|
||||
eyebrow="Intern · Vertraulich"
|
||||
title="Projektdossier"
|
||||
intro={p.summary}
|
||||
belowIntro={
|
||||
<div className="mt-5 flex flex-wrap items-center gap-x-4 gap-y-3">
|
||||
<time
|
||||
dateTime={p.snapshotIso}
|
||||
className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary"
|
||||
>
|
||||
Stand {snapshotLabel}
|
||||
</time>
|
||||
<form action={lockDossier}>
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="h-auto gap-1.5 rounded-full border border-subtle bg-surface-raised px-3 py-1.5 text-xs font-medium text-text-secondary hover:border-action/40 hover:bg-surface-raised hover:text-text-primary"
|
||||
>
|
||||
<Lock className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
Sperren
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Hauptinhalt: die actionable Kontaktdatenbank */}
|
||||
<DossierContacts groups={DOSSIER_GROUPS} />
|
||||
|
||||
{/* Projektbrief */}
|
||||
<ListSection
|
||||
icon={ListChecks}
|
||||
title="Aufgaben"
|
||||
intro="Wichtigste offene Arbeitspakete der laufenden Projektphase."
|
||||
ordered
|
||||
items={p.tasks}
|
||||
/>
|
||||
|
||||
<ListSection
|
||||
icon={HelpCircle}
|
||||
title="Offene Fragen"
|
||||
intro="Zu klärende Punkte für Produktentscheid, Ökobilanz und Markteinführung."
|
||||
items={p.openQuestions}
|
||||
/>
|
||||
|
||||
<Timeline items={p.timeline} />
|
||||
|
||||
<ListSection
|
||||
icon={Lightbulb}
|
||||
title="Empfehlungen"
|
||||
intro="Priorisierung für den erfolgreichen Abschluss der Projektphase."
|
||||
items={[...p.recommendations]}
|
||||
tone="raised"
|
||||
/>
|
||||
|
||||
<SourceNote />
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Listen-Sektion (Aufgaben / Fragen / Empfehlungen) ───────────── */
|
||||
|
||||
function ListSection({
|
||||
icon: Icon,
|
||||
title,
|
||||
intro,
|
||||
items,
|
||||
ordered,
|
||||
tone = 'canvas',
|
||||
}: {
|
||||
icon: typeof ListChecks
|
||||
title: string
|
||||
intro: string
|
||||
items: readonly string[]
|
||||
ordered?: boolean
|
||||
tone?: 'canvas' | 'raised'
|
||||
}) {
|
||||
const List = ordered ? 'ol' : 'ul'
|
||||
return (
|
||||
<section className={tone === 'raised' ? 'border-b border-subtle bg-surface-raised' : 'border-b border-subtle bg-canvas'}>
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="flex h-9 w-9 items-center justify-center rounded-lg border border-subtle bg-surface-base text-action">
|
||||
<Icon className="h-5 w-5" aria-hidden="true" />
|
||||
</span>
|
||||
<h2 className="ui-public-display-md">{title}</h2>
|
||||
</div>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{intro}</p>
|
||||
|
||||
<List className="mt-8 max-w-3xl space-y-3">
|
||||
{items.map((item, i) => (
|
||||
<li key={i} className="flex gap-3 text-text-secondary">
|
||||
<span className="mt-0.5 shrink-0 font-mono text-xs text-text-tertiary tabular-nums">
|
||||
{ordered ? `${String(i + 1).padStart(2, '0')}` : '—'}
|
||||
</span>
|
||||
<span className="text-sm sm:text-base">{item}</span>
|
||||
</li>
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Zeitplan ────────────────────────────────────────────────────── */
|
||||
|
||||
function Timeline({ items }: { items: typeof DOSSIER_PROJECT.timeline }) {
|
||||
return (
|
||||
<section className="border-b border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="flex h-9 w-9 items-center justify-center rounded-lg border border-subtle bg-surface-base text-action">
|
||||
<FileText className="h-4.5 w-4.5" aria-hidden="true" />
|
||||
</span>
|
||||
<h2 className="ui-public-display-md">Zeitplan & Fristen</h2>
|
||||
</div>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">
|
||||
Meilensteine bis zur Präsentation vor dem Swico Innovationsfonds.
|
||||
</p>
|
||||
|
||||
<ol className="mt-10 space-y-0 border-l border-subtle">
|
||||
{items.map((item, i) => {
|
||||
const Icon = item.done ? CheckCircle2 : Circle
|
||||
return (
|
||||
<li key={i} className="relative -ml-px flex gap-4 pb-8 pl-6 last:pb-0 sm:gap-6 sm:pl-8">
|
||||
<span
|
||||
className={`absolute -left-3 flex h-6 w-6 items-center justify-center rounded-full bg-canvas ${
|
||||
item.done ? 'text-action' : 'text-text-tertiary'
|
||||
}`}
|
||||
>
|
||||
<Icon className="h-5 w-5" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{item.date}
|
||||
</div>
|
||||
<div className="mt-1.5 text-base font-medium text-text-primary sm:text-lg">
|
||||
{item.label}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function SourceNote() {
|
||||
return (
|
||||
<section className="bg-surface-raised">
|
||||
<div className="mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8">
|
||||
<p className="text-xs text-text-tertiary">
|
||||
Quelle: interne Projektunterlagen (Projektinfo & Kontaktdetails),
|
||||
übergeben an Andreas. Kontaktangaben sind öffentlich verifizierbare
|
||||
Geschäftsadressen. Vertraulich behandeln und nicht öffentlich teilen.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Helfer ──────────────────────────────────────────────────────── */
|
||||
|
||||
function formatSnapshot(iso: string): string {
|
||||
const [y, m, d] = iso.split('-').map(Number)
|
||||
const MONTHS = [
|
||||
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
|
||||
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember',
|
||||
]
|
||||
return `${d}. ${MONTHS[(m ?? 1) - 1]} ${y}`
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
'use server'
|
||||
|
||||
import { cookies } from 'next/headers'
|
||||
import {
|
||||
DOSSIER_COOKIE,
|
||||
EXPECTED_TOKEN,
|
||||
passwordMatches,
|
||||
} from '@/lib/upcycling/dossier-auth'
|
||||
|
||||
export interface UnlockState {
|
||||
ok: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
const THIRTY_DAYS = 60 * 60 * 24 * 30
|
||||
|
||||
export async function unlockDossier(
|
||||
_prev: UnlockState,
|
||||
formData: FormData,
|
||||
): Promise<UnlockState> {
|
||||
const password = String(formData.get('password') ?? '')
|
||||
|
||||
if (!passwordMatches(password)) {
|
||||
return { ok: false, error: 'Falsches Passwort. Bitte erneut versuchen.' }
|
||||
}
|
||||
|
||||
const store = await cookies()
|
||||
store.set(DOSSIER_COOKIE, EXPECTED_TOKEN, {
|
||||
httpOnly: true,
|
||||
sameSite: 'lax',
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
path: '/',
|
||||
maxAge: THIRTY_DAYS,
|
||||
})
|
||||
|
||||
return { ok: true }
|
||||
}
|
||||
|
||||
export async function lockDossier(): Promise<void> {
|
||||
const store = await cookies()
|
||||
store.delete(DOSSIER_COOKIE)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import type { Metadata } from 'next'
|
||||
import { isDossierUnlocked } from '@/lib/upcycling/dossier-auth'
|
||||
import { DossierGate } from './DossierGate'
|
||||
import { DossierView } from './DossierView'
|
||||
|
||||
/**
|
||||
* /projects/upcycling/dossier — interner, passwortgeschützter Bereich.
|
||||
*
|
||||
* Enthält die an Andreas übergebenen Akquise-Kontakte (Hersteller, Kunden,
|
||||
* Förderer, Vertrieb, Grossverteiler) sowie Projektstand, Aufgaben und
|
||||
* Meilensteine. Inhalte werden nur serverseitig gerendert, wenn das
|
||||
* Zugangscookie gültig ist — andernfalls erscheint die Passwortschranke.
|
||||
*
|
||||
* `cookies()` macht die Route automatisch dynamisch; `noindex` hält sie
|
||||
* aus Suchmaschinen heraus.
|
||||
*/
|
||||
export const metadata: Metadata = {
|
||||
title: 'Projektdossier — intern · Monitor-Upcycling',
|
||||
robots: { index: false, follow: false },
|
||||
}
|
||||
|
||||
export default async function DossierPage() {
|
||||
const unlocked = await isDossierUnlocked()
|
||||
return unlocked ? <DossierView /> : <DossierGate />
|
||||
}
|
||||
@@ -1,256 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslations } from 'next-intl'
|
||||
import Image from 'next/image'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { ArrowRight } from 'lucide-react'
|
||||
import { UPCYCLING_GALLERY_ASSET_BASE, UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
import {
|
||||
splitUpcyclingGalleryPieces,
|
||||
type UpcyclingGalleryPiece,
|
||||
} from '@/data/upcycling-gallery'
|
||||
import { UPCYCLING_INSTALLATIONS } from '@/data/upcycling-installations'
|
||||
import type { ApplicationsMessages } from '../applications/ApplicationsExperience'
|
||||
import { MonitorLampPlaceholder } from '../MonitorLampPlaceholder'
|
||||
|
||||
type GalleryMessages = {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
statsLine: string
|
||||
installsCta: string
|
||||
documented: { title: string; cta: string }
|
||||
queued: { title: string; intro: string }
|
||||
help: { eyebrow: string; title: string; body: string; cta: string }
|
||||
empty: string
|
||||
placeholderNote: string
|
||||
}
|
||||
|
||||
function usePrefersReducedMotion(): boolean {
|
||||
const [reduced, setReduced] = useState(false)
|
||||
useEffect(() => {
|
||||
const mq = window.matchMedia('(prefers-reduced-motion: reduce)')
|
||||
const update = () => setReduced(mq.matches)
|
||||
update()
|
||||
mq.addEventListener('change', update)
|
||||
return () => mq.removeEventListener('change', update)
|
||||
}, [])
|
||||
return reduced
|
||||
}
|
||||
|
||||
export function GalleryClient() {
|
||||
const t = useTranslations('projects')
|
||||
const m = t.raw('upcycling.gallery') as GalleryMessages
|
||||
// Install captions are owned by the Applications page (i18n SSOT) — reuse,
|
||||
// don't duplicate. Structure comes from UPCYCLING_INSTALLATIONS (data SSOT).
|
||||
const installs = t.raw('upcycling.applications.installs') as ApplicationsMessages['installs']
|
||||
const { documented, queued } = splitUpcyclingGalleryPieces()
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<header className="border-b border-subtle bg-surface-base">
|
||||
<div className="mx-auto max-w-5xl px-4 pb-10 pt-12 sm:px-6 sm:pb-14 sm:pt-16 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{m.eyebrow}</div>
|
||||
<h1 className="ui-public-display-lg mt-3">{m.title}</h1>
|
||||
<p className="ui-public-section-lede mt-4">{m.intro}</p>
|
||||
<p className="mt-3 font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{t('upcycling.gallery.statsLine', {
|
||||
documented: documented.length,
|
||||
queued: queued.length,
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<InstallationsStrip installs={installs} ctaLabel={m.installsCta} />
|
||||
|
||||
{documented.length > 0 && (
|
||||
<section aria-labelledby="gallery-documented-title" className="border-b border-subtle">
|
||||
<div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 sm:py-16 lg:px-8">
|
||||
<h2 id="gallery-documented-title" className="ui-public-eyebrow">
|
||||
{m.documented.title}
|
||||
</h2>
|
||||
<div className="mt-6 grid gap-8 sm:gap-10 lg:grid-cols-2">
|
||||
{documented.map((piece) => (
|
||||
<DocumentedPiece key={piece.id} piece={piece} ctaLabel={m.documented.cta} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{queued.length > 0 && (
|
||||
<section aria-labelledby="gallery-queued-title" className="border-b border-subtle bg-surface-raised">
|
||||
<div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 sm:py-16 lg:px-8">
|
||||
<h2 id="gallery-queued-title" className="ui-public-eyebrow">
|
||||
{m.queued.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-3 max-w-3xl">{m.queued.intro}</p>
|
||||
<ul className="mt-8 grid grid-cols-2 gap-4 sm:grid-cols-3 sm:gap-5 lg:grid-cols-4">
|
||||
{queued.map((piece) => (
|
||||
<QueuedCard key={piece.id} piece={piece} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section aria-labelledby="gallery-help-title" className="bg-canvas">
|
||||
<div className="mx-auto max-w-3xl px-4 py-14 text-center sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{m.help.eyebrow}</div>
|
||||
<h2 id="gallery-help-title" className="ui-public-display-md mt-3">{m.help.title}</h2>
|
||||
<p className="ui-public-section-lede mx-auto mt-4">{m.help.body}</p>
|
||||
<Link href="/get-involved" className="ui-public-cta mt-10 inline-flex items-center gap-2">
|
||||
{m.help.cta}
|
||||
<ArrowRight className="h-4 w-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* Real-world installations (Juli-2026 shoot) — photographed installs as
|
||||
* cards linking to the Applications page, which owns the full field stories.
|
||||
* Sits above the model gallery: hung-and-in-use beats studio shots. */
|
||||
function InstallationsStrip({
|
||||
installs,
|
||||
ctaLabel,
|
||||
}: {
|
||||
installs: ApplicationsMessages['installs']
|
||||
ctaLabel: string
|
||||
}) {
|
||||
const photographed = UPCYCLING_INSTALLATIONS.filter((i) => !!i.image)
|
||||
if (!photographed.length) return null
|
||||
|
||||
return (
|
||||
<section aria-labelledby="gallery-installs-title" className="border-b border-subtle">
|
||||
<div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 sm:py-16 lg:px-8">
|
||||
<h2 id="gallery-installs-title" className="ui-public-eyebrow">
|
||||
{installs.eyebrow}
|
||||
</h2>
|
||||
<div className="mt-6 grid gap-4 sm:grid-cols-2">
|
||||
{photographed.map((install) => {
|
||||
const msg = installs.items[install.id]
|
||||
if (!msg) return null
|
||||
return (
|
||||
<Link
|
||||
key={install.id}
|
||||
href={UPCYCLING_ROUTES.applications}
|
||||
className="group overflow-hidden rounded-xl border border-subtle bg-surface-base transition-colors hover:border-default"
|
||||
>
|
||||
<div className="relative aspect-[16/10] bg-surface-raised">
|
||||
<Image
|
||||
src={install.image!}
|
||||
alt={`${msg.title} — ${msg.location}`}
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-baseline justify-between gap-3 p-4">
|
||||
<div className="min-w-0">
|
||||
<p className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-muted">
|
||||
{msg.location}
|
||||
</p>
|
||||
<h3 className="mt-1 text-base font-semibold text-text-primary">{msg.title}</h3>
|
||||
</div>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{ctaLabel}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function DocumentedPiece({ piece, ctaLabel }: { piece: UpcyclingGalleryPiece; ctaLabel: string }) {
|
||||
const body = (
|
||||
<>
|
||||
<figure className="relative aspect-[16/10] overflow-hidden rounded-2xl border border-subtle bg-surface-base">
|
||||
<PieceVisual piece={piece} sizes="(min-width: 1024px) 45vw, 100vw" />
|
||||
</figure>
|
||||
<div className="mt-5 flex items-baseline justify-between gap-3">
|
||||
<h3 className="text-xl font-semibold text-text-primary">{piece.model}</h3>
|
||||
<span className="inline-flex items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{ctaLabel}
|
||||
<ArrowRight className="h-4 w-4" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
if (piece.guideHref) {
|
||||
return (
|
||||
<Link href={piece.guideHref} className="group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action focus-visible:rounded-2xl">
|
||||
{body}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
return <div>{body}</div>
|
||||
}
|
||||
|
||||
function QueuedCard({ piece }: { piece: UpcyclingGalleryPiece }) {
|
||||
return (
|
||||
<li className="overflow-hidden rounded-xl border border-subtle bg-surface-base">
|
||||
<div className="relative aspect-[4/3]">
|
||||
<MonitorLampPlaceholder
|
||||
variant={piece.variant}
|
||||
seed={piece.seed}
|
||||
className="absolute inset-0 h-full w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="px-3 py-2 text-xs font-medium text-text-secondary">{piece.model}</div>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
function PieceVisual({ piece, sizes }: { piece: UpcyclingGalleryPiece; sizes: string }) {
|
||||
const [failed, setFailed] = useState(false)
|
||||
const prefersReducedMotion = usePrefersReducedMotion()
|
||||
|
||||
if (!piece.image || failed) {
|
||||
return (
|
||||
<MonitorLampPlaceholder
|
||||
variant={piece.variant}
|
||||
seed={piece.seed}
|
||||
className="h-full w-full"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const assetBase = UPCYCLING_GALLERY_ASSET_BASE
|
||||
const showVideo = piece.video && !prefersReducedMotion
|
||||
|
||||
if (showVideo) {
|
||||
return (
|
||||
<video
|
||||
src={`${assetBase}/${piece.video}`}
|
||||
poster={`${assetBase}/${piece.image}`}
|
||||
autoPlay
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
aria-label={piece.model}
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
onError={() => setFailed(true)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Image
|
||||
src={`${assetBase}/${piece.image}`}
|
||||
alt={piece.model}
|
||||
fill
|
||||
sizes={sizes}
|
||||
className="object-cover"
|
||||
onError={() => setFailed(true)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { GalleryClient } from './GalleryClient'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.gallery') as { meta: { title: string; description: string } }
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('gallery', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default function UpcyclingGalleryPage() {
|
||||
return <GalleryClient />
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { GuideBody, type GuideData, type GuideStructure } from '../GuideBody'
|
||||
|
||||
/**
|
||||
* HP Z23n guide — DRAFT, not yet published.
|
||||
*
|
||||
* Transcribed from the workshop wiki. Intentionally NOT in UPCYCLING_GUIDE_SLUGS,
|
||||
* so it never appears in the landing / build-your-own / gallery guide lists —
|
||||
* reachable only by direct URL for review.
|
||||
*
|
||||
* Publish blockers (remove this notice + add to UPCYCLING_GUIDE_SLUGS once done):
|
||||
* 1. Bridging schematic is unverified — the wiki marks it "TODO", and this
|
||||
* model bridges different pins than the L2251pwd voltage divider. Until
|
||||
* verified, STRUCTURE.schematicAtStep stays null (no diagram shown).
|
||||
* 2. No result/step photos yet — every step ships with images: [].
|
||||
* 3. No OG image — generateMetadata omits openGraph until one exists.
|
||||
*/
|
||||
|
||||
type WithMeta = GuideData & { meta: { title: string; description: string } }
|
||||
|
||||
const STRUCTURE: GuideStructure = {
|
||||
stageSteps: { disassemble: [1], bridge: [2], lcd: [3], assemble: [4] },
|
||||
schematicAtStep: null,
|
||||
hero: {},
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.hp_z23n') as WithMeta
|
||||
return { title: m.meta.title, description: m.meta.description }
|
||||
}
|
||||
|
||||
export default async function HpZ23nGuidePage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.hp_z23n') as WithMeta
|
||||
return <GuideBody data={m} structure={STRUCTURE} />
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import {
|
||||
UPCYCLING_NAV_LABEL_KEYS,
|
||||
UPCYCLING_NAV_ROUTE_KEYS,
|
||||
UPCYCLING_ROUTES,
|
||||
} from '@/config/upcycling-routes'
|
||||
import { UpcyclingInterestBand } from './UpcyclingInterestBand'
|
||||
import { UpcyclingNextStepBand } from './UpcyclingNextStepBand'
|
||||
import { UpcyclingSubNav } from './UpcyclingSubNav'
|
||||
|
||||
/**
|
||||
* Shared layout for the Monitor-Upcycling mini-site.
|
||||
*
|
||||
* Renders a sticky sub-nav so visitors can move freely between
|
||||
* Overview / Applications / Gallery / Build-Your-Own without going back
|
||||
* to the main project index. Treated as a sub-site by convention; the
|
||||
* URL prefix is intentionally portable so a future split to its own
|
||||
* domain is a redirect, not a refactor.
|
||||
*/
|
||||
|
||||
type SubNavMessages = {
|
||||
brand: string
|
||||
overview: string
|
||||
applications: string
|
||||
gallery: string
|
||||
buildYourOwn: string
|
||||
wirkung: string
|
||||
businessPlan: string
|
||||
status: string
|
||||
}
|
||||
|
||||
type InterestMessages = {
|
||||
eyebrow: string
|
||||
heading: string
|
||||
body: string
|
||||
}
|
||||
|
||||
export default async function UpcyclingLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const t = await getTranslations('projects')
|
||||
const nav = t.raw('upcycling.nav') as SubNavMessages
|
||||
const interest = t.raw('upcycling.interestCta') as InterestMessages
|
||||
const nextStep = t.raw('upcycling.nextStep') as Record<
|
||||
string,
|
||||
{ eyebrow: string; title: string; body: string; cta: string }
|
||||
>
|
||||
|
||||
const items = UPCYCLING_NAV_ROUTE_KEYS.map((routeKey) => ({
|
||||
href: UPCYCLING_ROUTES[routeKey],
|
||||
label: nav[UPCYCLING_NAV_LABEL_KEYS[routeKey]],
|
||||
}))
|
||||
|
||||
return (
|
||||
<>
|
||||
<UpcyclingSubNav items={items} brand={nav.brand} />
|
||||
{children}
|
||||
<UpcyclingNextStepBand messages={nextStep} />
|
||||
<UpcyclingInterestBand
|
||||
eyebrow={interest.eyebrow}
|
||||
heading={interest.heading}
|
||||
body={interest.body}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { GuideBody, type GuideData, type GuideStructure } from '../GuideBody'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/**
|
||||
* Lenovo L2251pwd guide — server-side metadata + i18n loading only.
|
||||
* All rendering lives in <GuideBody> (client) so the lightbox, scroll
|
||||
* tracking, and tap-to-play hero have the state they need.
|
||||
*/
|
||||
|
||||
type WithMeta = GuideData & { meta: { title: string; description: string } }
|
||||
|
||||
/** Language-independent shape of this guide (structure → not i18n). */
|
||||
const STRUCTURE: GuideStructure = {
|
||||
stageSteps: { disassemble: [1, 2, 3], lcd: [4], bridge: [5] },
|
||||
schematicAtStep: 5,
|
||||
hero: {
|
||||
poster: UPCYCLING_ASSETS.lenovoGuide.heroPoster,
|
||||
video: UPCYCLING_ASSETS.lenovoGuide.heroVideo,
|
||||
},
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.lenovo_l2251pwd') as WithMeta
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('lenovoL2251pwd', m.meta, { type: 'article' }),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function LenovoL2251pwdGuidePage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.lenovo_l2251pwd') as WithMeta
|
||||
return <GuideBody data={m} structure={STRUCTURE} />
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import { GuideBody, type GuideData, type GuideStructure } from '../GuideBody'
|
||||
|
||||
/**
|
||||
* Lenovo L2440pwC guide — DRAFT, not yet published.
|
||||
*
|
||||
* Transcribed from the workshop wiki. Intentionally NOT in UPCYCLING_GUIDE_SLUGS,
|
||||
* so it never appears in the landing / build-your-own / gallery guide lists —
|
||||
* reachable only by direct URL for review.
|
||||
*
|
||||
* Publish blockers (remove this notice + add to UPCYCLING_GUIDE_SLUGS once done):
|
||||
* 1. Bridging schematic is unverified — the wiki marks it "noch falsch", and
|
||||
* this model bridges different pins than the L2251pwd voltage divider.
|
||||
* Until verified, STRUCTURE.schematicAtStep stays null (no diagram shown).
|
||||
* 2. No result/step photos yet — every step ships with images: [].
|
||||
* 3. No OG image — generateMetadata omits openGraph until one exists.
|
||||
*/
|
||||
|
||||
type WithMeta = GuideData & { meta: { title: string; description: string } }
|
||||
|
||||
const STRUCTURE: GuideStructure = {
|
||||
stageSteps: { disassemble: [1, 2], bridge: [3], lcd: [4], assemble: [5] },
|
||||
schematicAtStep: null,
|
||||
hero: {},
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.lenovo_l2440pwc') as WithMeta
|
||||
return { title: m.meta.title, description: m.meta.description }
|
||||
}
|
||||
|
||||
export default async function LenovoL2440pwcGuidePage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.lenovo_l2440pwc') as WithMeta
|
||||
return <GuideBody data={m} structure={STRUCTURE} />
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Open Graph image paths for each minisite page.
|
||||
*
|
||||
* SSOT for the per-page social-share preview. Each minisite page's
|
||||
* generateMetadata() reads the matching path and emits a 1200×630 og:image
|
||||
* tag. Images are generated by scripts/generate-og-images.mjs from the
|
||||
* existing minisite photography — never inline tooling, always real
|
||||
* source material so previews stay honest.
|
||||
*/
|
||||
|
||||
import { UPCYCLING_BASE } from '@/config/upcycling-routes'
|
||||
|
||||
const OG_BASE = `${UPCYCLING_BASE}/og` as const
|
||||
|
||||
export const OG_IMAGES = {
|
||||
landing: `${OG_BASE}/landing.jpg`,
|
||||
wirkung: `${OG_BASE}/wirkung.jpg`,
|
||||
applications: `${OG_BASE}/applications.jpg`,
|
||||
gallery: `${OG_BASE}/gallery.jpg`,
|
||||
businessplan: `${OG_BASE}/businessplan.jpg`,
|
||||
buildYourOwn: `${OG_BASE}/build-your-own.jpg`,
|
||||
status: `${OG_BASE}/status.jpg`,
|
||||
lenovoL2251pwd: `${OG_BASE}/lenovo-l2251pwd.jpg`,
|
||||
} as const
|
||||
|
||||
/** Shape a Metadata.openGraph + twitter block for a minisite page. */
|
||||
export function ogFor(
|
||||
key: keyof typeof OG_IMAGES,
|
||||
meta: { title: string; description: string },
|
||||
options: { type?: 'website' | 'article' } = {},
|
||||
) {
|
||||
const image = OG_IMAGES[key]
|
||||
return {
|
||||
openGraph: {
|
||||
title: meta.title,
|
||||
description: meta.description,
|
||||
type: options.type ?? 'website',
|
||||
images: [{ url: image, width: 1200, height: 630, alt: meta.title }],
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image' as const,
|
||||
title: meta.title,
|
||||
description: meta.description,
|
||||
images: [image],
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import Image from 'next/image'
|
||||
import {
|
||||
ArrowRight,
|
||||
Layers,
|
||||
Image as ImageIcon,
|
||||
Wrench,
|
||||
} from 'lucide-react'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import {
|
||||
UPCYCLING_EXPLORE_ROUTE_KEYS,
|
||||
UPCYCLING_ROUTES,
|
||||
} from '@/config/upcycling-routes'
|
||||
import { orderPublishedGuides, UPCYCLING_GUIDE_ROUTES } from '@/data/upcycling-guides'
|
||||
import {
|
||||
ProjectNeedsSection,
|
||||
type NeedsSectionLabels,
|
||||
} from '@/components/projects'
|
||||
import { UpcyclingInterestCTA } from './UpcyclingInterestCTA'
|
||||
import { UpcyclingLandingHero } from './UpcyclingLandingHero'
|
||||
import { ogFor } from './og-images'
|
||||
|
||||
type GuideItem = {
|
||||
slug: string
|
||||
model: string
|
||||
href: string
|
||||
summary: string
|
||||
author: string
|
||||
publishedAt: string
|
||||
}
|
||||
|
||||
type ExploreCard = {
|
||||
key: 'applications' | 'gallery' | 'buildYourOwn'
|
||||
title: string
|
||||
description: string
|
||||
cta: string
|
||||
}
|
||||
|
||||
type EvidenceCardCopy = { title: string; body: string; cta: string }
|
||||
|
||||
type PageMessages = {
|
||||
meta: { title: string; description: string }
|
||||
hero: {
|
||||
title: string
|
||||
description: string
|
||||
cta1: string
|
||||
cta2: string
|
||||
photoAlt: string
|
||||
}
|
||||
interestCta: { eyebrow: string; heading: string; body: string }
|
||||
evidence: {
|
||||
eyebrow: string
|
||||
status: EvidenceCardCopy
|
||||
businessplan: EvidenceCardCopy
|
||||
}
|
||||
guides: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
openCta: string
|
||||
items: GuideItem[]
|
||||
moreComing: { title: string; body: string; cta: string }
|
||||
}
|
||||
explore: { eyebrow: string; title: string; intro: string; cards: ExploreCard[] }
|
||||
needs: NeedsSectionLabels
|
||||
}
|
||||
|
||||
const EXPLORE_ICONS: Record<ExploreCard['key'], LucideIcon> = {
|
||||
applications: Layers,
|
||||
gallery: ImageIcon,
|
||||
buildYourOwn: Wrench,
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('upcycling') as PageMessages
|
||||
return {
|
||||
title: p.meta.title,
|
||||
description: p.meta.description,
|
||||
...ogFor('landing', p.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const p = t.raw('upcycling') as PageMessages
|
||||
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
<UpcyclingLandingHero
|
||||
title={p.hero.title}
|
||||
description={p.hero.description}
|
||||
cta1={p.hero.cta1}
|
||||
cta2={p.hero.cta2}
|
||||
photoAlt={p.hero.photoAlt}
|
||||
/>
|
||||
<ExploreSection explore={p.explore} />
|
||||
<GuidesSection guides={p.guides} />
|
||||
<ProjectNeedsSection slug="upcycling" labels={p.needs} />
|
||||
<InterestSection interestCta={p.interestCta} />
|
||||
<EvidenceSection evidence={p.evidence} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function EvidenceSection({ evidence }: { evidence: PageMessages['evidence'] }) {
|
||||
return (
|
||||
<section className="border-t border-subtle bg-surface-raised py-12 sm:py-14">
|
||||
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{evidence.eyebrow}</div>
|
||||
<div className="mt-6 grid gap-4 sm:grid-cols-2">
|
||||
<EvidenceCard
|
||||
href={UPCYCLING_ROUTES.status}
|
||||
copy={evidence.status}
|
||||
/>
|
||||
<EvidenceCard
|
||||
href={UPCYCLING_ROUTES.businessplan}
|
||||
copy={evidence.businessplan}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function EvidenceCard({ href, copy }: { href: string; copy: EvidenceCardCopy }) {
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
className="group flex flex-col gap-2 rounded-lg border border-subtle bg-surface-base p-5 transition-colors hover:border-default"
|
||||
>
|
||||
<p className="text-base font-semibold text-text-primary">{copy.title}</p>
|
||||
<p className="text-sm text-text-secondary">{copy.body}</p>
|
||||
<span className="mt-2 inline-flex items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{copy.cta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
function InterestSection({ interestCta }: { interestCta: PageMessages['interestCta'] }) {
|
||||
return (
|
||||
<section className="border-t border-subtle bg-canvas py-14 sm:py-16">
|
||||
<div className="mx-auto max-w-3xl px-4 sm:px-6 lg:px-8 text-center">
|
||||
<div className="ui-public-eyebrow">{interestCta.eyebrow}</div>
|
||||
<p className="mt-4 text-xl sm:text-2xl font-medium leading-snug text-text-primary">
|
||||
{interestCta.heading}
|
||||
</p>
|
||||
<p className="mt-3 text-sm text-text-secondary">{interestCta.body}</p>
|
||||
<UpcyclingInterestCTA className="mt-8 max-w-md mx-auto" />
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function ExploreSection({ explore }: { explore: PageMessages['explore'] }) {
|
||||
if (!explore?.cards?.length) return null
|
||||
return (
|
||||
<section className="bg-surface-base border-t border-subtle py-14 sm:py-16">
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center">
|
||||
<div className="ui-public-eyebrow">{explore.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{explore.title}</h2>
|
||||
<p className="ui-public-section-lede mx-auto mt-3">{explore.intro}</p>
|
||||
</div>
|
||||
|
||||
<div className="mt-10 grid gap-4 sm:grid-cols-3">
|
||||
{explore.cards.map((card) => {
|
||||
if (!UPCYCLING_EXPLORE_ROUTE_KEYS.includes(card.key)) return null
|
||||
const Icon = EXPLORE_ICONS[card.key]
|
||||
const href = UPCYCLING_ROUTES[card.key]
|
||||
const imageSrc = UPCYCLING_ASSETS.explore[card.key]
|
||||
return (
|
||||
<Link
|
||||
key={card.key}
|
||||
href={href}
|
||||
className="group flex flex-col overflow-hidden rounded-lg border border-subtle bg-surface-raised transition-colors hover:border-default"
|
||||
>
|
||||
<div className="relative aspect-[16/10] border-b border-subtle bg-surface-base">
|
||||
<Image
|
||||
src={imageSrc}
|
||||
alt=""
|
||||
fill
|
||||
sizes="(min-width: 640px) 30vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col p-6">
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-action-muted/15">
|
||||
<Icon className="h-5 w-5 text-action" aria-hidden="true" />
|
||||
</div>
|
||||
<h3 className="mt-4 text-lg font-semibold text-text-primary">{card.title}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-text-secondary">{card.description}</p>
|
||||
<span className="mt-auto pt-6 inline-flex items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{card.cta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function GuidesSection({ guides }: { guides: PageMessages['guides'] }) {
|
||||
const items = orderPublishedGuides(guides?.items ?? [])
|
||||
if (!items.length) return null
|
||||
const isSingle = items.length === 1
|
||||
return (
|
||||
<section className="bg-canvas border-t border-subtle py-16 sm:py-20">
|
||||
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{guides.eyebrow}</div>
|
||||
<h2 className="ui-public-display-md mt-3">{guides.title}</h2>
|
||||
<p className="ui-public-section-lede mt-3">{guides.intro}</p>
|
||||
|
||||
<div className="mt-10 grid gap-4 sm:grid-cols-2">
|
||||
{items.map((guide) => {
|
||||
const href = UPCYCLING_GUIDE_ROUTES[guide.slug as keyof typeof UPCYCLING_GUIDE_ROUTES] ?? guide.href
|
||||
const showPhoto = guide.slug === 'lenovo-l2251pwd'
|
||||
return (
|
||||
<Link
|
||||
key={guide.slug}
|
||||
href={href}
|
||||
className="group flex flex-col overflow-hidden rounded-lg border border-subtle bg-surface-base transition-colors hover:border-default"
|
||||
>
|
||||
{showPhoto && (
|
||||
<div className="relative aspect-[16/10] border-b border-subtle">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.gallery.lenovoPoster}
|
||||
alt=""
|
||||
fill
|
||||
sizes="(min-width: 640px) 45vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-1 flex-col p-6">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{guide.publishedAt}
|
||||
</div>
|
||||
<h3 className="mt-3 text-lg font-semibold text-text-primary">{guide.model}</h3>
|
||||
<p className="mt-2 text-sm text-text-secondary">{guide.summary}</p>
|
||||
<span className="mt-auto pt-6 inline-flex items-center gap-1.5 text-sm font-medium text-action group-hover:gap-2 transition-all">
|
||||
{guides.openCta}
|
||||
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
{isSingle && guides.moreComing && (
|
||||
<div className="flex flex-col rounded-lg border border-dashed border-subtle bg-canvas p-6">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{guides.moreComing.title}
|
||||
</div>
|
||||
<p className="mt-3 text-sm text-text-secondary">{guides.moreComing.body}</p>
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.buildYourOwn}
|
||||
className="mt-auto pt-6 inline-flex items-center gap-1.5 text-sm font-medium text-action hover:gap-2 transition-all"
|
||||
>
|
||||
{guides.moreComing.cta}
|
||||
<ArrowRight className="w-3.5 h-3.5" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,317 +0,0 @@
|
||||
import { getLocale, getTranslations } from 'next-intl/server'
|
||||
import { CheckCircle2, CircleDot, Circle, Clock } from 'lucide-react'
|
||||
import {
|
||||
UPCYCLING_STATUS,
|
||||
type MilestoneKey,
|
||||
type MilestoneStatus,
|
||||
} from '@/data/upcycling-status'
|
||||
import {
|
||||
formatDeadlineMessage,
|
||||
formatSnapshotDate,
|
||||
pickNextDeadline,
|
||||
} from '@/lib/domain/upcycling-status-helpers'
|
||||
import { UpcyclingPageHeader } from '../UpcyclingPageHeader'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/** Rebuild every hour so the deadline countdown stays within 1 day of accurate.
|
||||
* The rest of the page is otherwise static-data-driven. */
|
||||
export const revalidate = 3600
|
||||
|
||||
/**
|
||||
* /projects/upcycling/status — public progress snapshot.
|
||||
*
|
||||
* Single job: "where is the project right now?" Header + production +
|
||||
* timeline. Outbound navigation is handled by the layout next-step band
|
||||
* (businessplan → status is the reverse lane).
|
||||
*
|
||||
* Everything that previously lived here (project brief, economics,
|
||||
* partners, open questions) moved to its proper home:
|
||||
* - Economics & funding & partners → /businessplan
|
||||
* - Environmental / scientific / open-hardware → /wirkung
|
||||
* - Project brief / approach / open questions → /businessplan
|
||||
*
|
||||
* Keeping this page lean is the design discipline we lost in the prior
|
||||
* iteration. If it grows again, split — don't stack.
|
||||
*/
|
||||
|
||||
type StatusMessages = {
|
||||
meta: { title: string; description: string }
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
snapshot: { label: string; updatedLabel: string }
|
||||
/** ICU-format strings for the next-deadline countdown chip. The same
|
||||
* countdown serves any milestone with an ISO date; the milestone-specific
|
||||
* label is interpolated via `{milestone}`. */
|
||||
countdown: {
|
||||
daysLeft: string // "{days, plural, one {Noch # Tag} other {Noch # Tage}} bis {milestone}"
|
||||
today: string // "Heute fällig: {milestone}"
|
||||
overdue: string // "{days, plural, one {# Tag} other {# Tage}} überfällig: {milestone}"
|
||||
}
|
||||
production: {
|
||||
title: string
|
||||
intro: string
|
||||
lampsLabel: string
|
||||
lampsOf: string
|
||||
lampsTarget: string
|
||||
modelsLabel: string
|
||||
pilotsLabel: string
|
||||
intakeLabel: string
|
||||
}
|
||||
timeline: {
|
||||
title: string
|
||||
intro: string
|
||||
labels: Record<MilestoneStatus, string>
|
||||
items: { key: MilestoneKey; date: string; label: string }[]
|
||||
}
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.status') as StatusMessages
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('status', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingStatusPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const locale = await getLocale()
|
||||
const m = t.raw('upcycling.status') as StatusMessages
|
||||
const status = UPCYCLING_STATUS
|
||||
|
||||
const nextDeadline = pickNextDeadline(status.milestoneDeadlines, m.timeline.items)
|
||||
const deadlineMessage = nextDeadline
|
||||
? formatDeadlineMessage(
|
||||
(key, values) => t(`upcycling.status.countdown.${key}`, values),
|
||||
nextDeadline,
|
||||
)
|
||||
: null
|
||||
const snapshotDateLabel = formatSnapshotDate(status.snapshotIso, locale)
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<Header
|
||||
eyebrow={m.eyebrow}
|
||||
title={m.title}
|
||||
intro={m.intro}
|
||||
snapshot={m.snapshot}
|
||||
snapshotIso={status.snapshotIso}
|
||||
snapshotDateLabel={snapshotDateLabel}
|
||||
nextDeadline={nextDeadline}
|
||||
deadlineMessage={deadlineMessage}
|
||||
/>
|
||||
<Production section={m.production} numbers={status.production} />
|
||||
<Timeline section={m.timeline} statuses={status.milestoneStatuses} />
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Header ─────────────────────────────────────────────────────── */
|
||||
|
||||
function Header({
|
||||
eyebrow,
|
||||
title,
|
||||
intro,
|
||||
snapshot,
|
||||
snapshotIso,
|
||||
snapshotDateLabel,
|
||||
nextDeadline,
|
||||
deadlineMessage,
|
||||
}: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
snapshot: StatusMessages['snapshot']
|
||||
snapshotIso: string
|
||||
snapshotDateLabel: string
|
||||
nextDeadline: { key: MilestoneKey; label: string; daysLeft: number; isoDate: string } | null
|
||||
deadlineMessage: string | null
|
||||
}) {
|
||||
return (
|
||||
<UpcyclingPageHeader
|
||||
eyebrow={eyebrow}
|
||||
title={title}
|
||||
intro={intro}
|
||||
belowIntro={
|
||||
<>
|
||||
<div className="mt-4 flex flex-wrap items-baseline gap-x-4 gap-y-2">
|
||||
<time
|
||||
dateTime={snapshotIso}
|
||||
className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary"
|
||||
>
|
||||
{snapshot.label} {snapshotDateLabel}
|
||||
</time>
|
||||
</div>
|
||||
{nextDeadline && deadlineMessage && (
|
||||
<DeadlineChip nextDeadline={nextDeadline} message={deadlineMessage} />
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function DeadlineChip({
|
||||
nextDeadline,
|
||||
message,
|
||||
}: {
|
||||
nextDeadline: { key: MilestoneKey; label: string; daysLeft: number; isoDate: string }
|
||||
message: string
|
||||
}) {
|
||||
const { daysLeft } = nextDeadline
|
||||
const tone =
|
||||
daysLeft < 0 ? 'border-warning-300/60 bg-warning-50 text-warning-700 dark:bg-warning-900/20 dark:text-warning-300'
|
||||
: daysLeft <= 7 ? 'border-action/40 bg-action-muted/15 text-action'
|
||||
: 'border-subtle bg-surface-raised text-text-secondary'
|
||||
return (
|
||||
<div className="mt-6">
|
||||
<div className={cn(
|
||||
'inline-flex items-center gap-2 rounded-full border px-3.5 py-1.5 text-xs font-medium sm:text-sm',
|
||||
tone,
|
||||
)}>
|
||||
<Clock className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
<span>{message}</span>
|
||||
<time dateTime={nextDeadline.isoDate} className="hidden font-mono text-[10px] uppercase tracking-[0.18em] opacity-70 sm:inline">
|
||||
{nextDeadline.isoDate}
|
||||
</time>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Production ────────────────────────────────────────────────── */
|
||||
|
||||
function Production({
|
||||
section,
|
||||
numbers,
|
||||
}: {
|
||||
section: StatusMessages['production']
|
||||
numbers: typeof UPCYCLING_STATUS.production
|
||||
}) {
|
||||
const percent = numbers.lampsTarget > 0
|
||||
? Math.min(100, Math.round((numbers.lampsBuilt / numbers.lampsTarget) * 100))
|
||||
: 0
|
||||
|
||||
return (
|
||||
<section className="border-b border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<h2 className="ui-public-display-md">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<div className="mt-10 grid gap-8 lg:grid-cols-[1.4fr_1fr] lg:items-end">
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<span className="font-mono text-6xl font-light leading-none tabular-nums text-text-primary sm:text-7xl">
|
||||
{numbers.lampsBuilt}
|
||||
</span>
|
||||
<span className="font-mono text-xl text-text-tertiary sm:text-2xl">
|
||||
{section.lampsOf} {numbers.lampsTarget}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-3 font-mono text-xs uppercase tracking-[0.22em] text-text-tertiary">
|
||||
{section.lampsLabel} · {section.lampsTarget}
|
||||
</div>
|
||||
|
||||
<div className="mt-6">
|
||||
<div
|
||||
className="relative h-1.5 w-full overflow-hidden rounded-full bg-surface-raised"
|
||||
role="progressbar"
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={numbers.lampsTarget}
|
||||
aria-valuenow={numbers.lampsBuilt}
|
||||
>
|
||||
<div
|
||||
className="absolute inset-y-0 left-0 rounded-full bg-action"
|
||||
style={{ width: `${percent}%` }}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-2 font-mono text-xs tabular-nums text-text-tertiary">
|
||||
{percent}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dl className="grid grid-cols-3 gap-4 sm:gap-6">
|
||||
<SecondaryMetric label={section.modelsLabel} value={numbers.modelsDocumented} />
|
||||
<SecondaryMetric label={section.pilotsLabel} value={numbers.pilotsActive} />
|
||||
<SecondaryMetric label={section.intakeLabel} value={numbers.monitorsInIntake} />
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function SecondaryMetric({ label, value }: { label: string; value: number }) {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<dd className="font-mono text-3xl font-light leading-none tabular-nums text-text-primary sm:text-4xl">
|
||||
{value}
|
||||
</dd>
|
||||
<dt className="text-xs uppercase tracking-[0.18em] text-text-tertiary">{label}</dt>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Timeline ──────────────────────────────────────────────────── */
|
||||
|
||||
const MILESTONE_ICON: Record<MilestoneStatus, typeof CheckCircle2> = {
|
||||
done: CheckCircle2,
|
||||
active: CircleDot,
|
||||
upcoming: Circle,
|
||||
}
|
||||
|
||||
function Timeline({
|
||||
section,
|
||||
statuses,
|
||||
}: {
|
||||
section: StatusMessages['timeline']
|
||||
statuses: Record<MilestoneKey, MilestoneStatus>
|
||||
}) {
|
||||
return (
|
||||
<section className="border-b border-subtle bg-canvas">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<h2 className="ui-public-display-md">{section.title}</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ol className="mt-10 space-y-0 border-l border-subtle">
|
||||
{section.items.map((item) => {
|
||||
const status = statuses[item.key] ?? 'upcoming'
|
||||
const Icon = MILESTONE_ICON[status]
|
||||
return (
|
||||
<li
|
||||
key={item.key}
|
||||
className="relative -ml-px flex gap-4 pb-8 pl-6 last:pb-0 sm:gap-6 sm:pl-8"
|
||||
>
|
||||
<span
|
||||
aria-label={section.labels[status]}
|
||||
className={cn(
|
||||
'absolute -left-3 flex h-6 w-6 items-center justify-center rounded-full bg-canvas',
|
||||
status === 'active' && 'text-action',
|
||||
status === 'done' && 'text-action',
|
||||
status === 'upcoming' && 'text-text-tertiary',
|
||||
)}
|
||||
>
|
||||
<Icon className="h-5 w-5" aria-hidden="true" />
|
||||
</span>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{item.date} · {section.labels[status]}
|
||||
</div>
|
||||
<div className="mt-1.5 text-base font-medium text-text-primary sm:text-lg">
|
||||
{item.label}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import Image from 'next/image'
|
||||
import { ArrowRight, ExternalLink, BookOpen } from 'lucide-react'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
import { UpcyclingPageHeader } from '../UpcyclingPageHeader'
|
||||
import { ogFor } from '../og-images'
|
||||
|
||||
/**
|
||||
* /projects/upcycling/wirkung — the environmental, scientific, and
|
||||
* open-hardware story of the project.
|
||||
*
|
||||
* Four blocks:
|
||||
* 1. Environment — CO₂ + materials + lifespan with cited sources
|
||||
* 2. Scientific — what ZHAW measures and why
|
||||
* 3. Open hardware — what we publish, licence, who benefits
|
||||
* 4. Circularity — four-stage material flow
|
||||
*
|
||||
* Each block leans on existing transparency surfaces (/transparenz/co2,
|
||||
* the github source, etc) instead of duplicating their content. The
|
||||
* numbers shown here are provisional; the ZHAW LCA (Q3 2026) replaces
|
||||
* them with rigorous values.
|
||||
*
|
||||
* Server component — pure render. No interactivity.
|
||||
*/
|
||||
|
||||
type Metric = { value: string; label: string; note: string }
|
||||
type Stage = { label: string; description: string }
|
||||
|
||||
type WirkungCopy = {
|
||||
meta: { title: string; description: string }
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
environment: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
metrics: Metric[]
|
||||
caveat: string
|
||||
transparencyLink: string
|
||||
comparison: { eyebrow: string; alt: string; caption: string }
|
||||
}
|
||||
scientific: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
scope: string[]
|
||||
timeline: string
|
||||
commitment: string
|
||||
results: {
|
||||
eyebrow: string
|
||||
quote: string
|
||||
quoteSource: string
|
||||
stats: Record<string, { value: string; label: string }>
|
||||
specs: string
|
||||
caveat: string
|
||||
}
|
||||
}
|
||||
openHardware: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
body: string
|
||||
licenseLine: string
|
||||
guideCta: string
|
||||
sourceLink: { label: string; url: string }
|
||||
}
|
||||
circularity: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
stages: Stage[]
|
||||
}
|
||||
nextSteps: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
body: string
|
||||
primary: string
|
||||
secondary: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.wirkung') as WirkungCopy
|
||||
return {
|
||||
title: m.meta.title,
|
||||
description: m.meta.description,
|
||||
...ogFor('wirkung', m.meta),
|
||||
}
|
||||
}
|
||||
|
||||
export default async function UpcyclingWirkungPage() {
|
||||
const t = await getTranslations('projects')
|
||||
const m = t.raw('upcycling.wirkung') as WirkungCopy
|
||||
|
||||
return (
|
||||
<article className="bg-canvas">
|
||||
<Header eyebrow={m.eyebrow} title={m.title} intro={m.intro} />
|
||||
<Environment section={m.environment} />
|
||||
<Scientific section={m.scientific} />
|
||||
<OpenHardware section={m.openHardware} />
|
||||
<Circularity section={m.circularity} />
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── Header ─────────────────────────────────────────────────────── */
|
||||
|
||||
function Header({
|
||||
eyebrow,
|
||||
title,
|
||||
intro,
|
||||
}: {
|
||||
eyebrow: string
|
||||
title: string
|
||||
intro: string
|
||||
}) {
|
||||
return <UpcyclingPageHeader eyebrow={eyebrow} title={title} intro={intro} />
|
||||
}
|
||||
|
||||
/* ─── 1. Environment ────────────────────────────────────────────── */
|
||||
/* Top-line metric(s) with the methodology link sitting ON the card —
|
||||
* not orphaned in the caveat paragraph below. Credibility requires that
|
||||
* the source be one click from the number, per pattern_co2_credibility.
|
||||
* Layout adapts: a single headline metric renders as a featured card;
|
||||
* multiple metrics fall back to the original 3-col grid. */
|
||||
|
||||
function Environment({ section }: { section: WirkungCopy['environment'] }) {
|
||||
const single = section.metrics.length === 1
|
||||
return (
|
||||
<section
|
||||
className="border-b border-subtle bg-canvas"
|
||||
aria-labelledby="env-title"
|
||||
>
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 id="env-title" className="ui-public-display-md mt-3">
|
||||
{section.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{section.intro}</p>
|
||||
|
||||
{single ? (
|
||||
<HeadlineMetric metric={section.metrics[0]} transparencyLink={section.transparencyLink} />
|
||||
) : (
|
||||
<dl className="mt-10 grid gap-4 sm:gap-5 md:grid-cols-3">
|
||||
{section.metrics.map((metric, i) => (
|
||||
<MetricCard key={i} metric={metric} transparencyLink={section.transparencyLink} />
|
||||
))}
|
||||
</dl>
|
||||
)}
|
||||
|
||||
<p className="mt-8 max-w-3xl text-sm leading-relaxed text-text-secondary">
|
||||
{section.caveat}
|
||||
</p>
|
||||
|
||||
{/* Photo evidence, no invented data: a comparable new 24-W LED panel
|
||||
on the shelf at CHF 79.95 — every one of them a full new
|
||||
production run. Shot Juli 2026. */}
|
||||
<figure className="mt-10 grid gap-0 overflow-hidden rounded-xl border border-subtle bg-surface-base sm:grid-cols-[1.4fr_1fr] sm:items-stretch">
|
||||
<div className="relative aspect-[4/3] sm:aspect-auto sm:min-h-[16rem]">
|
||||
<Image
|
||||
src={UPCYCLING_ASSETS.installs.ledPanelVergleich}
|
||||
alt={section.comparison.alt}
|
||||
fill
|
||||
sizes="(min-width: 640px) 55vw, 100vw"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
<figcaption className="flex flex-col justify-center border-t border-subtle p-6 sm:border-l sm:border-t-0">
|
||||
<span className="font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{section.comparison.eyebrow}
|
||||
</span>
|
||||
<p className="mt-3 text-sm leading-relaxed text-text-secondary">
|
||||
{section.comparison.caption}
|
||||
</p>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/** Headline-treatment for a single metric: number left, source + methodology
|
||||
* link right. The link sits on the card so a reader who sees the number
|
||||
* has one click to verify it. */
|
||||
function HeadlineMetric({ metric, transparencyLink }: { metric: Metric; transparencyLink: string }) {
|
||||
return (
|
||||
<article className="mt-10 grid gap-6 rounded-xl border border-subtle bg-surface-base p-6 sm:p-8 lg:grid-cols-[1fr_1.4fr] lg:items-center lg:gap-10">
|
||||
<div className="min-w-0">
|
||||
<div className="font-mono text-5xl font-light leading-none tabular-nums text-text-primary sm:text-6xl">
|
||||
{metric.value}
|
||||
</div>
|
||||
<div className="mt-3 font-mono text-xs uppercase tracking-[0.18em] text-action">
|
||||
{metric.label}
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm leading-relaxed text-text-secondary">{metric.note}</p>
|
||||
<Link
|
||||
href="/transparenz/co2"
|
||||
className="mt-4 inline-flex items-center gap-1.5 text-sm font-medium text-action underline-offset-2 hover:underline"
|
||||
>
|
||||
{transparencyLink}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
/** Grid card for the multi-metric layout. Methodology link sits at the
|
||||
* bottom of each card so the per-card credibility chain stays intact
|
||||
* whether one or three metrics are configured. */
|
||||
function MetricCard({ metric, transparencyLink }: { metric: Metric; transparencyLink: string }) {
|
||||
return (
|
||||
<div className="flex min-w-0 flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-6">
|
||||
<dd className="font-mono text-3xl font-light leading-none tabular-nums text-text-primary sm:text-4xl">
|
||||
{metric.value}
|
||||
</dd>
|
||||
<dt className="font-mono text-xs uppercase tracking-[0.18em] text-action">
|
||||
{metric.label}
|
||||
</dt>
|
||||
<p className="text-xs leading-snug text-text-secondary">{metric.note}</p>
|
||||
<Link
|
||||
href="/transparenz/co2"
|
||||
className="mt-auto inline-flex items-center gap-1.5 text-xs font-medium text-action underline-offset-2 hover:underline"
|
||||
>
|
||||
{transparencyLink}
|
||||
<ArrowRight className="h-3 w-3" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 2. Scientific ─────────────────────────────────────────────── */
|
||||
/* Scope list + timeline + the "publish unchanged" commitment.
|
||||
* The commitment line is the most important sentence on this page. */
|
||||
|
||||
function Scientific({ section }: { section: WirkungCopy['scientific'] }) {
|
||||
return (
|
||||
<section
|
||||
className="border-b border-subtle bg-surface-raised"
|
||||
aria-labelledby="science-title"
|
||||
>
|
||||
<div className="mx-auto max-w-3xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 id="science-title" className="ui-public-display-md mt-3">
|
||||
{section.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-4">{section.intro}</p>
|
||||
|
||||
<ul className="mt-8 space-y-3 border-l border-subtle pl-5">
|
||||
{section.scope.map((item, i) => (
|
||||
<li key={i} className="text-sm leading-relaxed text-text-secondary">
|
||||
{item}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p className="mt-8 font-mono text-xs uppercase tracking-[0.18em] text-text-tertiary">
|
||||
{section.timeline}
|
||||
</p>
|
||||
|
||||
<p className="mt-6 border-l-2 border-action pl-4 text-sm leading-relaxed text-text-primary sm:text-base">
|
||||
{section.commitment}
|
||||
</p>
|
||||
|
||||
{/* Vorläufige ZHAW-Resultate — Zwischenstand, ehrlich als solcher
|
||||
markiert. Zahlen aus der ZHAW-Zwischenpräsentation (28.05.2026). */}
|
||||
<div className="mt-12 rounded-xl border border-subtle bg-surface-base p-6 sm:p-8">
|
||||
<p className="font-mono text-[10px] uppercase tracking-[0.16em] text-text-muted">
|
||||
{section.results.eyebrow}
|
||||
</p>
|
||||
<div className="mt-6 grid gap-6 sm:grid-cols-3">
|
||||
{Object.entries(section.results.stats).map(([key, stat]) => (
|
||||
<div key={key}>
|
||||
<p className="text-3xl font-semibold tracking-tight text-action sm:text-4xl">
|
||||
{stat.value}
|
||||
</p>
|
||||
<p className="mt-1.5 font-mono text-[10px] uppercase tracking-[0.14em] leading-relaxed text-text-muted">
|
||||
{stat.label}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<blockquote className="mt-8 border-l-2 border-action pl-4">
|
||||
<p className="text-base leading-relaxed text-text-primary sm:text-lg">
|
||||
«{section.results.quote}»
|
||||
</p>
|
||||
<cite className="mt-2 block font-mono text-[10px] uppercase not-italic tracking-[0.14em] text-text-muted">
|
||||
{section.results.quoteSource}
|
||||
</cite>
|
||||
</blockquote>
|
||||
<p className="mt-6 text-sm leading-relaxed text-text-secondary">{section.results.specs}</p>
|
||||
<p className="mt-3 text-xs leading-relaxed text-text-tertiary">{section.results.caveat}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 3. Open hardware ──────────────────────────────────────────── */
|
||||
|
||||
function OpenHardware({ section }: { section: WirkungCopy['openHardware'] }) {
|
||||
return (
|
||||
<section
|
||||
className="border-b border-subtle bg-canvas"
|
||||
aria-labelledby="osh-title"
|
||||
>
|
||||
<div className="mx-auto max-w-3xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 id="osh-title" className="ui-public-display-md mt-3">
|
||||
{section.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-4">{section.body}</p>
|
||||
<p className="mt-3 text-sm text-text-secondary">{section.licenseLine}</p>
|
||||
|
||||
<div className="mt-8 flex flex-wrap items-center gap-4 sm:gap-6">
|
||||
<Link
|
||||
href={UPCYCLING_ROUTES.buildYourOwn}
|
||||
className="inline-flex items-center gap-2 text-sm font-semibold text-action hover:gap-3 transition-all"
|
||||
>
|
||||
<BookOpen className="h-4 w-4" aria-hidden="true" />
|
||||
{section.guideCta}
|
||||
<ArrowRight className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</Link>
|
||||
<a
|
||||
href={section.sourceLink.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-2 text-sm font-medium text-text-secondary hover:text-action transition-colors"
|
||||
>
|
||||
{section.sourceLink.label}
|
||||
<ExternalLink className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/* ─── 4. Circularity ────────────────────────────────────────────── */
|
||||
|
||||
function Circularity({ section }: { section: WirkungCopy['circularity'] }) {
|
||||
return (
|
||||
<section className="bg-surface-raised" aria-labelledby="circ-title">
|
||||
<div className="mx-auto max-w-5xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8">
|
||||
<div className="ui-public-eyebrow">{section.eyebrow}</div>
|
||||
<h2 id="circ-title" className="ui-public-display-md mt-3">
|
||||
{section.title}
|
||||
</h2>
|
||||
<p className="ui-public-section-lede mt-4 max-w-3xl">{section.intro}</p>
|
||||
|
||||
<ol className="mt-10 grid gap-4 sm:gap-5 md:grid-cols-2 lg:grid-cols-4">
|
||||
{section.stages.map((stage, i) => (
|
||||
<li
|
||||
key={i}
|
||||
className="flex min-w-0 flex-col gap-3 rounded-xl border border-subtle bg-surface-base p-6"
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="font-mono text-xs tabular-nums text-text-tertiary"
|
||||
>
|
||||
{String(i + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<h3 className="text-base font-semibold text-text-primary">{stage.label}</h3>
|
||||
<p className="text-sm leading-relaxed text-text-secondary">
|
||||
{stage.description}
|
||||
</p>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -49,7 +49,6 @@ const STATIC_PAGES: Array<{ path: string; priority: number; changeFrequency: Met
|
||||
{ path: '/get-involved/kontakt', priority: 0.6, changeFrequency: 'monthly' },
|
||||
{ path: R.mitgliedWerden, priority: 0.7, changeFrequency: 'monthly' },
|
||||
{ path: '/abos', priority: 0.6, changeFrequency: 'monthly' },
|
||||
{ path: '/projects', priority: 0.6, changeFrequency: 'monthly' },
|
||||
{ path: '/revamped', priority: 0.6, changeFrequency: 'monthly' },
|
||||
{ path: '/knowhow', priority: 0.6, changeFrequency: 'monthly' },
|
||||
{ path: '/contact', priority: 0.6, changeFrequency: 'monthly' },
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
'use client'
|
||||
|
||||
/**
|
||||
* NeedContributionDialog — modal form for "I can help" with a specific need.
|
||||
* Posts to /api/projects/[slug]/contributions.
|
||||
*
|
||||
* Accepts the same flat `labels` shape as ProjectNeedsSection so callers
|
||||
* can pass through the i18n needs block unchanged.
|
||||
*/
|
||||
|
||||
import { useState, type FormEvent } from 'react'
|
||||
import { Modal } from '@/components/ui/Modal'
|
||||
import { FormField } from '@/components/ui/form-field'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { CheckCircle2 } from 'lucide-react'
|
||||
import type { NeedsSectionLabels } from './ProjectNeedsSection'
|
||||
|
||||
interface Need {
|
||||
id: string
|
||||
title: string
|
||||
}
|
||||
|
||||
interface Props {
|
||||
slug: string
|
||||
need: Need
|
||||
typeLabel: string
|
||||
labels: NeedsSectionLabels
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
export function NeedContributionDialog({ slug, need, typeLabel, labels, onClose }: Props) {
|
||||
const [submitting, setSubmitting] = useState(false)
|
||||
const [done, setDone] = useState(false)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
async function handleSubmit(e: FormEvent<HTMLFormElement>) {
|
||||
e.preventDefault()
|
||||
setError(null)
|
||||
setSubmitting(true)
|
||||
|
||||
const form = new FormData(e.currentTarget)
|
||||
const payload = {
|
||||
name: String(form.get('name') || '').trim(),
|
||||
email: String(form.get('email') || '').trim(),
|
||||
phone: String(form.get('phone') || '').trim() || undefined,
|
||||
organization: String(form.get('organization') || '').trim() || undefined,
|
||||
message: String(form.get('message') || '').trim(),
|
||||
needId: need.id,
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/projects/${encodeURIComponent(slug)}/contributions`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
const json = await res.json().catch(() => null)
|
||||
|
||||
if (res.status === 429) {
|
||||
setError(labels.errorTooMany)
|
||||
} else if (!res.ok || !json?.success) {
|
||||
setError(labels.errorGeneric)
|
||||
} else {
|
||||
setDone(true)
|
||||
}
|
||||
} catch {
|
||||
setError(labels.errorGeneric)
|
||||
} finally {
|
||||
setSubmitting(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal isOpen={true} onClose={onClose} title={labels.dialogTitle} size="lg">
|
||||
{done ? (
|
||||
<div className="text-center py-6">
|
||||
<CheckCircle2 className="mx-auto h-12 w-12 text-action mb-3" />
|
||||
<h3 className="text-lg font-semibold text-text-primary mb-2">
|
||||
{labels.successTitle}
|
||||
</h3>
|
||||
<p className="text-sm text-text-secondary mb-6">
|
||||
{labels.successBody}
|
||||
</p>
|
||||
<Button
|
||||
type="button"
|
||||
variant="primary"
|
||||
onClick={onClose}
|
||||
className="min-h-touch"
|
||||
>
|
||||
{labels.cancel}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<div className="rounded-lg border bg-surface-raised dark:bg-surface-base/3 p-3 text-sm">
|
||||
<p className="font-medium text-text-primary wrap-break-word">{need.title}</p>
|
||||
<p className="text-xs text-text-tertiary mt-0.5">{typeLabel}</p>
|
||||
</div>
|
||||
|
||||
<p className="text-sm text-text-secondary">{labels.dialogIntro}</p>
|
||||
|
||||
<FormField label={labels.fields.name} required htmlFor="name">
|
||||
<Input id="name" name="name" required minLength={2} maxLength={200} variant="elevated" />
|
||||
</FormField>
|
||||
|
||||
<FormField label={labels.fields.email} required htmlFor="email">
|
||||
<Input id="email" name="email" type="email" required maxLength={200} variant="elevated" />
|
||||
</FormField>
|
||||
|
||||
<div className="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
||||
<FormField label={labels.fields.phone} htmlFor="phone">
|
||||
<Input id="phone" name="phone" maxLength={50} variant="elevated" />
|
||||
</FormField>
|
||||
<FormField label={labels.fields.organization} htmlFor="organization">
|
||||
<Input id="organization" name="organization" maxLength={200} variant="elevated" />
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
<FormField label={labels.fields.message} required htmlFor="message">
|
||||
<Textarea
|
||||
id="message"
|
||||
name="message"
|
||||
required
|
||||
minLength={10}
|
||||
maxLength={4000}
|
||||
rows={5}
|
||||
placeholder={labels.messagePlaceholder}
|
||||
variant="elevated"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
{error && (
|
||||
<p className="text-sm text-error-600 dark:text-error-400" role="alert">{error}</p>
|
||||
)}
|
||||
|
||||
<div className="flex flex-col-reverse sm:flex-row items-stretch sm:items-center sm:justify-end gap-2 sm:gap-3 pt-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={onClose}
|
||||
disabled={submitting}
|
||||
className="min-h-touch"
|
||||
>
|
||||
{labels.cancel}
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
disabled={submitting}
|
||||
className="min-h-touch"
|
||||
>
|
||||
{submitting ? labels.submitting : labels.submit}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import Link from 'next/link'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
import type { ProjectCTASection } from './types'
|
||||
|
||||
interface ProjectCallToActionProps {
|
||||
cta: ProjectCTASection
|
||||
}
|
||||
|
||||
export function ProjectCallToAction({ cta }: ProjectCallToActionProps) {
|
||||
return (
|
||||
<section className="bg-action py-16 sm:py-20">
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center mb-10 sm:mb-12">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-white mb-3">
|
||||
{cta.title}
|
||||
</h2>
|
||||
{cta.subtitle && (
|
||||
<p className="text-base sm:text-lg text-action-text max-w-2xl mx-auto">
|
||||
{cta.subtitle}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={cn(
|
||||
'grid gap-6',
|
||||
cta.actions.length === 2 ? 'sm:grid-cols-2 max-w-3xl mx-auto' :
|
||||
cta.actions.length >= 3 ? 'sm:grid-cols-2 lg:grid-cols-3' :
|
||||
'max-w-sm mx-auto'
|
||||
)}>
|
||||
{cta.actions.map((action, i) => (
|
||||
<div key={i} className="flex flex-col rounded-lg bg-surface-base/10 p-6">
|
||||
<h3 className="text-base font-semibold text-white mb-2">
|
||||
{action.title}
|
||||
</h3>
|
||||
<p className="text-sm text-action-text grow mb-5">
|
||||
{action.description}
|
||||
</p>
|
||||
{action.href.startsWith('http') ? (
|
||||
<a
|
||||
href={action.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={cn(
|
||||
designPrimitive.buttonBase,
|
||||
designPrimitive.buttonSize.default,
|
||||
designPrimitive.button.outlineLight,
|
||||
'w-full justify-center'
|
||||
)}
|
||||
>
|
||||
{action.ctaText}
|
||||
</a>
|
||||
) : (
|
||||
<Link
|
||||
href={action.href}
|
||||
className={cn(
|
||||
designPrimitive.buttonBase,
|
||||
designPrimitive.buttonSize.default,
|
||||
designPrimitive.button.outlineLight,
|
||||
'w-full justify-center'
|
||||
)}
|
||||
>
|
||||
{action.ctaText}
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { Layers } from 'lucide-react'
|
||||
import { PageHero } from '@/components/layout/PageHero'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
import type { ProjectHero as ProjectHeroType } from './types'
|
||||
|
||||
interface ProjectHeroProps {
|
||||
hero: ProjectHeroType
|
||||
}
|
||||
|
||||
export function ProjectHero({ hero }: ProjectHeroProps) {
|
||||
const Icon = hero.icon ?? Layers
|
||||
|
||||
return (
|
||||
<PageHero
|
||||
theme="projects"
|
||||
icon={Icon}
|
||||
title={hero.title}
|
||||
subtitle={hero.description}
|
||||
>
|
||||
{hero.ctas && hero.ctas.length > 0 && (
|
||||
<div className="flex flex-wrap justify-center gap-3 mt-8">
|
||||
{hero.ctas.map((cta, i) => (
|
||||
<Link
|
||||
key={i}
|
||||
href={cta.href}
|
||||
className={cn(
|
||||
designPrimitive.buttonBase,
|
||||
designPrimitive.buttonSize.lg,
|
||||
cta.variant === 'outline'
|
||||
? designPrimitive.button.outline
|
||||
: designPrimitive.button.primary
|
||||
)}
|
||||
>
|
||||
{cta.text}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</PageHero>
|
||||
)
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
'use client'
|
||||
|
||||
/**
|
||||
* ProjectNeedsSection — public-facing list of open needs for a project.
|
||||
*
|
||||
* The `labels` prop matches the flat shape of messages/<locale>.json
|
||||
* projects.<slug>.needs — so callers can pass it through verbatim.
|
||||
*/
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
import { NeedContributionDialog } from './NeedContributionDialog'
|
||||
import { GraduationCap, Cpu, Handshake, Banknote, Clock, type LucideIcon } from 'lucide-react'
|
||||
import type { NeedType } from '@/config/projects'
|
||||
|
||||
interface ProjectNeed {
|
||||
id: string
|
||||
type: NeedType
|
||||
title: string
|
||||
description: string | null
|
||||
targetQuantity: number | null
|
||||
targetUnit: string | null
|
||||
status: string
|
||||
}
|
||||
|
||||
export interface NeedsSectionLabels {
|
||||
title: string
|
||||
intro: string
|
||||
loading: string
|
||||
empty: string
|
||||
helpCta: string
|
||||
errorGeneric: string
|
||||
errorTooMany: string
|
||||
dialogTitle: string
|
||||
dialogIntro: string
|
||||
fields: { name: string; email: string; phone: string; organization: string; message: string }
|
||||
messagePlaceholder: string
|
||||
submitting: string
|
||||
submit: string
|
||||
cancel: string
|
||||
successTitle: string
|
||||
successBody: string
|
||||
typeLabels: Record<NeedType, string>
|
||||
}
|
||||
|
||||
const TYPE_ICON: Record<NeedType, LucideIcon> = {
|
||||
expertise: GraduationCap,
|
||||
hardware: Cpu,
|
||||
partner_intro: Handshake,
|
||||
funding: Banknote,
|
||||
volunteer_time: Clock,
|
||||
}
|
||||
|
||||
interface Props {
|
||||
slug: string
|
||||
labels: NeedsSectionLabels
|
||||
}
|
||||
|
||||
export function ProjectNeedsSection({ slug, labels }: Props) {
|
||||
const [needs, setNeeds] = useState<ProjectNeed[] | null>(null)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [activeNeed, setActiveNeed] = useState<ProjectNeed | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
fetch(`/api/projects/${encodeURIComponent(slug)}/needs`)
|
||||
.then(r => r.json())
|
||||
.then(json => {
|
||||
if (cancelled) return
|
||||
if (json?.success) setNeeds(json.data as ProjectNeed[])
|
||||
else setError(labels.errorGeneric)
|
||||
})
|
||||
.catch(() => { if (!cancelled) setError(labels.errorGeneric) })
|
||||
return () => { cancelled = true }
|
||||
}, [slug, labels.errorGeneric])
|
||||
|
||||
if (needs && needs.length === 0 && !error) return null
|
||||
|
||||
return (
|
||||
<section className="py-12 sm:py-16 md:py-20 bg-surface-raised">
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center mb-8 sm:mb-12">
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-text-primary mb-3">
|
||||
{labels.title}
|
||||
</h2>
|
||||
<p className="text-base sm:text-lg text-text-tertiary max-w-3xl mx-auto">
|
||||
{labels.intro}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{needs === null && !error && (
|
||||
<p className="text-center text-sm text-text-tertiary">{labels.loading}</p>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<p className="text-center text-sm text-error-600 dark:text-error-400">{error}</p>
|
||||
)}
|
||||
|
||||
{needs && needs.length > 0 && (
|
||||
<div className="grid gap-4 sm:gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{needs.map(need => {
|
||||
const Icon = TYPE_ICON[need.type] ?? GraduationCap
|
||||
return (
|
||||
<div key={need.id} className={cn(designPrimitive.surface.card, 'p-5 sm:p-6 flex flex-col')}>
|
||||
<div className="flex items-start gap-3 mb-3">
|
||||
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-muted/15">
|
||||
<Icon className="h-5 w-5 text-action" />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-xs font-medium uppercase tracking-wider text-text-muted mb-0.5">
|
||||
{labels.typeLabels[need.type] ?? need.type}
|
||||
</p>
|
||||
<h3 className="text-base font-semibold text-text-primary wrap-break-word">
|
||||
{need.title}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{need.description && (
|
||||
<p className="text-sm text-text-secondary mb-4 grow">
|
||||
{need.description}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{need.targetQuantity != null && (
|
||||
<p className="text-xs text-text-tertiary mb-4">
|
||||
<span className="font-semibold">{need.targetQuantity}</span>
|
||||
{need.targetUnit ? ` ${need.targetUnit}` : ''}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
variant="primary"
|
||||
onClick={() => setActiveNeed(need)}
|
||||
className="mt-auto w-full justify-center min-h-touch"
|
||||
>
|
||||
{labels.helpCta}
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{activeNeed && (
|
||||
<NeedContributionDialog
|
||||
slug={slug}
|
||||
need={activeNeed}
|
||||
labels={labels}
|
||||
typeLabel={labels.typeLabels[activeNeed.type] ?? activeNeed.type}
|
||||
onClose={() => setActiveNeed(null)}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import { ProjectHero } from './ProjectHero'
|
||||
import { ProjectSection } from './ProjectSection'
|
||||
import { ProjectCallToAction } from './ProjectCallToAction'
|
||||
import type { ProjectPageConfig } from './types'
|
||||
|
||||
interface ProjectPageProps {
|
||||
config: ProjectPageConfig
|
||||
}
|
||||
|
||||
export function ProjectPage({ config }: ProjectPageProps) {
|
||||
// The locale layout's <MainLayout> already provides a single <main>; we
|
||||
// emit a plain <div> here to avoid nested-main invalid HTML / a11y issues.
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
{config.hero && <ProjectHero hero={config.hero} />}
|
||||
|
||||
{config.sections.map((section, i) => (
|
||||
<ProjectSection key={i} section={section} />
|
||||
))}
|
||||
|
||||
{config.cta && <ProjectCallToAction cta={config.cta} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function generateProjectMetadata(config: ProjectPageConfig) {
|
||||
return {
|
||||
title: config.metadata.title,
|
||||
description: config.metadata.description,
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
import { CheckCircle } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { designPrimitive } from '@/lib/design-system'
|
||||
import type { ProjectSection as ProjectSectionType } from './types'
|
||||
|
||||
interface ProjectSectionProps {
|
||||
section: ProjectSectionType
|
||||
}
|
||||
|
||||
const gridClass: Record<string, string> = {
|
||||
'grid-2': 'md:grid-cols-2',
|
||||
'grid-3': 'md:grid-cols-3',
|
||||
'grid-4': 'sm:grid-cols-2 lg:grid-cols-4',
|
||||
'single': 'max-w-2xl mx-auto',
|
||||
}
|
||||
|
||||
export function ProjectSection({ section }: ProjectSectionProps) {
|
||||
const isGray = section.backgroundColor === 'gray'
|
||||
|
||||
return (
|
||||
<section className={cn('py-16 sm:py-20', isGray ? 'bg-surface-raised' : 'bg-surface-base')}>
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
|
||||
{(section.title || section.description) && (
|
||||
<div className="text-center mb-12">
|
||||
{section.title && (
|
||||
<h2 className="text-2xl sm:text-3xl font-bold tracking-tight text-text-primary mb-3">
|
||||
{section.title}
|
||||
</h2>
|
||||
)}
|
||||
{section.description && (
|
||||
<p className="text-base sm:text-lg text-text-tertiary max-w-3xl mx-auto">
|
||||
{section.description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{section.cards && section.cards.length > 0 && (
|
||||
<div className={cn(
|
||||
'grid gap-6',
|
||||
section.layout === 'single' ? '' : 'md:grid-cols-2',
|
||||
gridClass[section.layout ?? 'grid-2']
|
||||
)}>
|
||||
{section.cards.map((card, i) => {
|
||||
const CardIcon = card.icon
|
||||
return (
|
||||
<div key={i} className={cn(designPrimitive.surface.card, 'p-6 sm:p-8')}>
|
||||
{CardIcon && (
|
||||
<div className="flex items-center gap-3 mb-4">
|
||||
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-muted/15">
|
||||
<CardIcon className="h-5 w-5 text-action" />
|
||||
</div>
|
||||
<h3 className="text-lg font-semibold text-text-primary">
|
||||
{card.title}
|
||||
</h3>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!CardIcon && (
|
||||
<h3 className="text-lg font-semibold text-text-primary mb-3">
|
||||
{card.title}
|
||||
</h3>
|
||||
)}
|
||||
|
||||
{card.description && (
|
||||
<p className="text-sm text-text-secondary mb-4">
|
||||
{card.description}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{card.features && card.features.length > 0 && (
|
||||
<ul className="space-y-2.5">
|
||||
{card.features.map((feat, fi) => (
|
||||
<li key={fi} className="flex items-start gap-2.5 text-sm text-text-secondary">
|
||||
<CheckCircle className="mt-0.5 h-4 w-4 shrink-0 text-action" />
|
||||
<span>{feat}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
export { ProjectHero } from './ProjectHero'
|
||||
export { ProjectSection } from './ProjectSection'
|
||||
export { ProjectCallToAction } from './ProjectCallToAction'
|
||||
export { ProjectPage, generateProjectMetadata } from './ProjectPage'
|
||||
export { ProjectNeedsSection, type NeedsSectionLabels } from './ProjectNeedsSection'
|
||||
export { NeedContributionDialog } from './NeedContributionDialog'
|
||||
export type {
|
||||
RawCard,
|
||||
RawAction,
|
||||
ProjectHero as ProjectHeroType,
|
||||
ProjectSection as ProjectSectionType,
|
||||
ProjectCard,
|
||||
ProjectCTA,
|
||||
ProjectCTASection,
|
||||
ProjectPageConfig,
|
||||
} from './types'
|
||||
@@ -1,65 +0,0 @@
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
|
||||
// ── Shared translation-layer types ────────────────────────────────────────────
|
||||
// Used in every project page to type the raw t.raw() output before mapping.
|
||||
|
||||
export type RawCard = { title: string; description?: string; features?: string[] }
|
||||
export type RawAction = { title: string; description: string; cta: string }
|
||||
|
||||
// ── Component types ───────────────────────────────────────────────────────────
|
||||
|
||||
export interface ProjectCTA {
|
||||
text: string
|
||||
href: string
|
||||
variant?: 'primary' | 'outline'
|
||||
}
|
||||
|
||||
export interface ProjectHero {
|
||||
title: string
|
||||
description: string
|
||||
icon?: LucideIcon
|
||||
ctas?: ProjectCTA[]
|
||||
}
|
||||
|
||||
export interface ProjectCard {
|
||||
title: string
|
||||
description: string
|
||||
icon?: LucideIcon
|
||||
features?: string[]
|
||||
href?: string
|
||||
ctaText?: string
|
||||
}
|
||||
|
||||
export interface ProjectSection {
|
||||
title?: string
|
||||
description?: string
|
||||
cards?: ProjectCard[]
|
||||
backgroundColor?: 'white' | 'gray'
|
||||
layout?: 'grid-2' | 'grid-3' | 'grid-4' | 'single'
|
||||
}
|
||||
|
||||
export interface ProjectCTASection {
|
||||
title: string
|
||||
subtitle?: string
|
||||
actions: Array<{
|
||||
title: string
|
||||
description: string
|
||||
href: string
|
||||
ctaText: string
|
||||
}>
|
||||
}
|
||||
|
||||
export interface ProjectPageConfig {
|
||||
/**
|
||||
* Optional — pages that render a bespoke hero (e.g. /projects/upcycling
|
||||
* with its cinematic spectrum composition) omit this and render their
|
||||
* own hero component above the section list.
|
||||
*/
|
||||
hero?: ProjectHero
|
||||
sections: ProjectSection[]
|
||||
cta?: ProjectCTASection
|
||||
metadata: {
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
}
|
||||
@@ -56,11 +56,6 @@ export const CO2_SOURCES = {
|
||||
url: 'https://www.refurbed.ch/sustainability/',
|
||||
year: 2024,
|
||||
},
|
||||
zhaw: {
|
||||
name: 'ZHAW Institut für Nachhaltige Entwicklung: LCA Upcycling-Projekt RevampIT (VORLÄUFIG)',
|
||||
url: '/projects/upcycling/wirkung',
|
||||
year: 2026,
|
||||
},
|
||||
} as const satisfies Record<string, Co2Source>
|
||||
|
||||
/**
|
||||
|
||||
@@ -178,17 +178,6 @@ export const PUBLIC_PAGE_CONTEXTS: HirnPageContext[] = [
|
||||
{ label: 'Mitglied werden', href: P.mitgliedWerden },
|
||||
],
|
||||
},
|
||||
{
|
||||
pattern: /^\/projects\/upcycling/,
|
||||
area: 'projects-upcycling',
|
||||
description:
|
||||
'Die Nutzerin schaut sich das Upcycling-Projekt an: Aus defekten Monitoren werden Leuchten und andere Produkte — funktionelle Kreislaufnutzung von IT-Geräten.',
|
||||
suggestions: [
|
||||
'Wie entstehen die Upcycling-Leuchten?',
|
||||
'Kann ich eine Leuchte kaufen oder selber bauen?',
|
||||
],
|
||||
quickActions: [{ label: 'Alle Projekte', href: '/projects' }],
|
||||
},
|
||||
{
|
||||
pattern: /^\/dashboard\/listings/,
|
||||
area: 'dashboard-listings',
|
||||
|
||||
@@ -34,18 +34,13 @@ export interface NavigationItem {
|
||||
/**
|
||||
* Main navigation structure
|
||||
*
|
||||
* Strategic positioning (7 top-level items):
|
||||
* Strategic positioning (6 top-level items):
|
||||
* 1. Über uns - About, mission, history (identity)
|
||||
* 2. Projekte - Mission proof — what we've built. Direct link, no dropdown.
|
||||
* 3. Dienstleistungen - Professional services (B2C)
|
||||
* 4. Marktplatz - ALL customer-facing buy/sell/help: Shop + Marketplace + IT-Hilfe
|
||||
* 5. Lernen - Workshops, guides, blog
|
||||
* 6. Mitmachen - Volunteer, donate, partner
|
||||
* 7. Kontakt - CTA (highlighted)
|
||||
*
|
||||
* Why 7 (not 6): "Projekte" became its own top-level entry because projects ARE the mission
|
||||
* proof — burying them under Über uns hid the work. Direct links don't add dropdown
|
||||
* cognitive load, so the extra slot is cheap.
|
||||
* 2. Dienstleistungen - Professional services (B2C)
|
||||
* 3. Marktplatz - ALL customer-facing buy/sell/help: Shop + Marketplace + IT-Hilfe
|
||||
* 4. Lernen - Workshops, guides, blog
|
||||
* 5. Mitmachen - Volunteer, donate, partner
|
||||
* 6. Kontakt - CTA (highlighted)
|
||||
*
|
||||
* Key decision: Shop + Marketplace (P2P) + IT-Hilfe live together under "Marktplatz" because
|
||||
* a customer looking for tech or help doesn't care about the organizational boundary between
|
||||
@@ -97,37 +92,6 @@ export const mainNavigation: NavigationItem[] = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// The dropdown shows only the two flagship projects + "Alle Projekte";
|
||||
// the long tail (LTSP, Kivitendo, Linuxola, FreieComputer, Compirat) stays
|
||||
// fully reachable on /projects, but doesn't bloat the mega-menu. Keeping
|
||||
// Projekte top-level (not under Über uns) because projects ARE the mission
|
||||
// proof — see the header note above.
|
||||
name: 'Projekte',
|
||||
nameKey: 'projects',
|
||||
href: '/projects',
|
||||
descriptionKey: 'projectsDesc',
|
||||
subItems: [
|
||||
{
|
||||
name: 'Monitor-Upcycling',
|
||||
nameKey: 'projectMonitorUpcycling',
|
||||
href: '/projects/upcycling',
|
||||
descriptionKey: 'projectMonitorUpcyclingDesc',
|
||||
badge: 'new',
|
||||
},
|
||||
{
|
||||
name: 'Hardware-Entwicklung',
|
||||
nameKey: 'projectHardware',
|
||||
href: '/projects/hardware',
|
||||
descriptionKey: 'projectHardwareDesc',
|
||||
},
|
||||
{
|
||||
name: 'Alle Projekte',
|
||||
nameKey: 'sectionAllProjects',
|
||||
href: '/projects',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Dienstleistungen',
|
||||
nameKey: 'services',
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import {
|
||||
UPCYCLING_GALLERY_PIECES,
|
||||
splitUpcyclingGalleryPieces,
|
||||
} from '@/data/upcycling-gallery'
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
|
||||
describe('splitUpcyclingGalleryPieces', () => {
|
||||
it('splits documented vs queued by presence of image', () => {
|
||||
const { documented, queued } = splitUpcyclingGalleryPieces()
|
||||
expect(documented).toHaveLength(1)
|
||||
expect(documented[0]?.id).toBe('lenovo-l2251pwd')
|
||||
expect(queued).toHaveLength(UPCYCLING_GALLERY_PIECES.length - 1)
|
||||
})
|
||||
|
||||
it('links the documented piece to its guide route', () => {
|
||||
const { documented } = splitUpcyclingGalleryPieces()
|
||||
expect(documented[0]?.guideHref).toBe(UPCYCLING_ROUTES.lenovoL2251pwd)
|
||||
})
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
import { orderPublishedGuides, UPCYCLING_GUIDE_SLUGS } from '@/data/upcycling-guides'
|
||||
|
||||
describe('upcycling guides SSOT', () => {
|
||||
it('orders i18n rows by published slug list', () => {
|
||||
const items = orderPublishedGuides([
|
||||
{ slug: 'other', model: 'Other' },
|
||||
{ slug: 'lenovo-l2251pwd', model: 'Lenovo L2251pwd' },
|
||||
])
|
||||
expect(items.map((g) => g.slug)).toEqual(['lenovo-l2251pwd'])
|
||||
})
|
||||
|
||||
it('matches gallery documented model', () => {
|
||||
expect(UPCYCLING_GUIDE_SLUGS).toContain('lenovo-l2251pwd')
|
||||
})
|
||||
})
|
||||
@@ -1,383 +0,0 @@
|
||||
/**
|
||||
* Monitor-Upcycling — internes Projektdossier (SSOT)
|
||||
*
|
||||
* Datenquelle: die an Andreas übergebenen Unterlagen unter
|
||||
* `Nextcloud/Kreislaufnutzung_IT/G/` (Projektinfo + Kontaktdetails).
|
||||
*
|
||||
* Dies ist die EINZIGE Quelle für den passwortgeschützten internen
|
||||
* Bereich `/projects/upcycling/dossier`. Kontakte hier sind reale,
|
||||
* öffentlich verifizierbare Geschäftsadressen — keine erfundenen Daten.
|
||||
*
|
||||
* Jede Gruppe trägt eine eigene Akquise-Botschaft (`outreach`), aus der
|
||||
* die Oberfläche einen vorausgefüllten `mailto:`-Link baut, damit die
|
||||
* Kontaktaufnahme ein Klick statt eine leere Seite ist.
|
||||
*/
|
||||
|
||||
import { ORG } from '@/config/org'
|
||||
|
||||
export interface DossierContact {
|
||||
name: string
|
||||
category: string
|
||||
address?: string
|
||||
/** PLZ/Ort */
|
||||
city?: string
|
||||
phone?: string
|
||||
email?: string
|
||||
website?: string
|
||||
/** Warum relevant / Notiz (v.a. für Grossverteiler). */
|
||||
note?: string
|
||||
/** Aktionärster Link: Nachhaltigkeits-/Partnerschafts-/Kontaktseite. */
|
||||
bestContactUrl?: string
|
||||
}
|
||||
|
||||
export interface DossierOutreach {
|
||||
/** Betreff der vorausgefüllten E-Mail. */
|
||||
subject: string
|
||||
/** Body der vorausgefüllten E-Mail (mit \n umbrüchen). */
|
||||
body: string
|
||||
}
|
||||
|
||||
export interface DossierGroup {
|
||||
key: string
|
||||
/** Kurzlabel für Filter-Chips. */
|
||||
shortLabel: string
|
||||
title: string
|
||||
intro: string
|
||||
outreach: DossierOutreach
|
||||
contacts: DossierContact[]
|
||||
}
|
||||
|
||||
/* ─── Akquise-Botschaften pro Gruppe ──────────────────────────────── */
|
||||
|
||||
const GRUSS = 'Guten Tag'
|
||||
const SIGNATUR =
|
||||
`Freundliche Grüsse\n${ORG.name} — funktionelle Kreislaufnutzung von IT-Geräten\n${ORG.website}`
|
||||
|
||||
const OUTREACH = {
|
||||
hersteller: {
|
||||
subject: 'Produktionspartnerschaft: Monitore werden zu Leuchten',
|
||||
body:
|
||||
`${GRUSS}\n\n` +
|
||||
'evig verwandelt ausgediente Computermonitore in funktionierende ' +
|
||||
'LED-Leuchten und Leuchtpaneele. Für die Serienfertigung einer Kleinserie ' +
|
||||
'(rund 70 Stück) suchen wir eine geschützte Werkstatt mit Elektronik- und ' +
|
||||
'Montage-Know-how als Produktionspartnerin.\n\n' +
|
||||
'Hätten Sie Interesse, das Vorhaben gemeinsam zu prüfen? Wir stellen Ihnen ' +
|
||||
'gerne Muster, Anleitungen und den Zeitplan vor.\n\n' +
|
||||
SIGNATUR,
|
||||
},
|
||||
kunden: {
|
||||
subject: 'Kreislauf-Leuchten aus Monitoren für Ihre Liegenschaften',
|
||||
body:
|
||||
`${GRUSS}\n\n` +
|
||||
'evig fertigt aus ausgedienten Monitoren langlebige LED-Leuchten für ' +
|
||||
'Nebenräume wie Keller, Velo- und Technikräume, Einstellhallen und Korridore. ' +
|
||||
'Wir suchen Pilotpartner mit grösseren Liegenschaftsportfolios für einen ' +
|
||||
'Praxistest mit Feedback.\n\n' +
|
||||
'Dürfen wir Ihnen das Produkt und die Ökobilanz in einem kurzen Termin ' +
|
||||
'vorstellen?\n\n' +
|
||||
SIGNATUR,
|
||||
},
|
||||
spender: {
|
||||
subject: 'Förderanfrage: Kreislaufnutzung von IT-Geräten',
|
||||
body:
|
||||
`${GRUSS}\n\n` +
|
||||
'evig entwickelt ein Verfahren, mit dem ausgediente Computermonitore ' +
|
||||
'zu funktionierenden Leuchten aufgewertet statt rezykliert werden — als ' +
|
||||
'gemeinnütziges Kreislauf- und Arbeitsintegrationsprojekt in der Region ' +
|
||||
'Zürich.\n\n' +
|
||||
'Für die nächste Projektphase suchen wir Fördermittel. Gerne senden wir ' +
|
||||
'Ihnen ein Kurzdossier und einen Finanzierungsplan zu — passt unser ' +
|
||||
'Vorhaben in Ihr Förderprofil?\n\n' +
|
||||
SIGNATUR,
|
||||
},
|
||||
vertrieb: {
|
||||
subject: 'Upcycling-Leuchten aus Monitoren — Verkauf in Ihrem Sortiment?',
|
||||
body:
|
||||
`${GRUSS}\n\n` +
|
||||
'evig stellt aus ausgedienten Monitoren designstarke Kreislauf-Leuchten ' +
|
||||
'her — lokal produziert, reparierbar und mit nachweisbarer Ökobilanz. ' +
|
||||
'Wir suchen Verkaufspartner, die solche Produkte führen.\n\n' +
|
||||
'Hätten Sie Interesse an Mustern und Konditionen für Ihr Sortiment?\n\n' +
|
||||
SIGNATUR,
|
||||
},
|
||||
grossverteiler: {
|
||||
subject: 'Kreislauf-Leuchten aus Schweizer Produktion — Partnerschaft',
|
||||
body:
|
||||
`${GRUSS}\n\n` +
|
||||
'evig verwandelt ausgediente Computermonitore in langlebige, ' +
|
||||
'reparierbare LED-Leuchten — gemeinnützig, lokal produziert und mit ' +
|
||||
'nachweisbarer CO₂-Einsparung gegenüber Neuware. Das passt zu Ihren ' +
|
||||
'Nachhaltigkeits- und Kreislaufzielen.\n\n' +
|
||||
'Wir würden das Produkt gerne Ihrem Einkauf bzw. Ihrem Nachhaltigkeitsteam ' +
|
||||
'vorstellen — als Sortimentsergänzung oder im Rahmen Ihrer Circular-Economy-' +
|
||||
'Aktivitäten. Wer wäre dafür die richtige Ansprechperson?\n\n' +
|
||||
SIGNATUR,
|
||||
},
|
||||
} satisfies Record<string, DossierOutreach>
|
||||
|
||||
/* ─── Kontaktgruppen ──────────────────────────────────────────────── */
|
||||
|
||||
export const DOSSIER_GROUPS: DossierGroup[] = [
|
||||
{
|
||||
key: 'hersteller',
|
||||
shortLabel: 'Hersteller',
|
||||
title: 'Hersteller — geschützte Werkstätten & Produktionspartner',
|
||||
intro:
|
||||
'Geschützte Werkstätten mit Elektronik- und Montagekompetenz für die ' +
|
||||
'Serienfertigung. Priorität auf Betriebe mit echtem Elektronik-Know-how; ' +
|
||||
'rein gastronomisch ausgerichtete Einrichtungen sind weniger geeignet.',
|
||||
outreach: OUTREACH.hersteller,
|
||||
contacts: [
|
||||
{ name: 'Werkraum 4', category: 'Geschützte Werkstatt', address: 'Kanonengasse 20', city: '8004 Zürich', phone: '+41 44 296 80 01', email: 'info@werkraum4.ch', website: 'https://www.werkraum4.ch' },
|
||||
{ name: 'Züriwerk', category: 'Geschützte Werkstatt', address: 'Baslerstrasse 30', city: '8048 Zürich', phone: '+41 44 405 71 00', email: 'stiftung@zueriwerk.ch', website: 'https://www.zueriwerk.ch' },
|
||||
{ name: 'Stiftung St. Jakob', category: 'Geschützte Werkstatt', address: 'Viaduktstrasse 20', city: '8005 Zürich', phone: '+41 44 295 93 93', email: 'info@st-jakob.ch', website: 'https://www.st-jakob.ch' },
|
||||
{ name: 'Pigna', category: 'Geschützte Werkstatt', address: 'Graswinkelstrasse 52', city: '8302 Kloten', phone: '+41 44 800 75 00', email: 'pigna@pigna.ch', website: 'https://www.pigna.ch' },
|
||||
{ name: 'Stiftung Wisli', category: 'Geschützte Werkstatt', address: 'Trafostrasse 1', city: '8180 Bülach', phone: '+41 43 411 45 45', email: 'info@wisli.ch', website: 'https://www.wisli.ch' },
|
||||
{ name: 'Re- und Upcycling Winterthur (RUW)', category: 'Trainingsarbeitsplätze', address: 'Schützenstrasse 1', city: '8400 Winterthur', phone: '+41 43 411 46 27', email: 'ruw@wisli.ch', website: 'https://www.wisli.ch/ruw' },
|
||||
{ name: 'Stiftung FARO', category: 'Elektro- & Kleinmontage', address: 'Süssbachareal 1', city: '5210 Windisch', phone: '+41 56 462 39 39', email: 'info@stiftung-faro.ch', website: 'https://www.stiftung-faro.ch' },
|
||||
{ name: 'Noveos', category: 'Geschützte Arbeitsplätze', address: 'Turicaphonstrasse 31', city: '8616 Riedikon', phone: '+41 44 944 60 40', email: 'info@noveos.ch', website: 'https://www.noveos.ch' },
|
||||
{ name: 'Drahtzug', category: 'Elektro / Montage', address: 'Drahtzugstrasse 72–78', city: '8008 Zürich', phone: '+41 43 336 76 76', email: 'kundendienst@drahtzug.ch', website: 'https://www.drahtzug.ch' },
|
||||
{ name: 'Stiftung Altried', category: 'Geschützte Werkstatt', address: 'Überlandstrasse 424', city: '8051 Zürich', phone: '+41 44 325 44 44', email: 'hauptsitz@altried.ch', website: 'https://www.altried.ch' },
|
||||
{ name: 'cb-Stiftung', category: 'Geschützte Arbeitsplätze', address: 'Thurgauerstrasse 30', city: '8050 Zürich', phone: '+41 44 319 80 40', email: 'cb@cb-stiftung.ch', website: 'https://www.cb-stiftung.ch' },
|
||||
{ name: 'Wagerenhof', category: 'Soziale Einrichtung', address: 'Asylstrasse 24', city: '8610 Uster', phone: '+41 44 905 13 11', email: 'info@wagerenhof.ch', website: 'https://www.wagerenhof.ch' },
|
||||
{ name: 'Werkheim Uster', category: 'Soziale Einrichtung', address: 'Friedhofstrasse 3A', city: '8610 Uster', phone: '+41 58 861 00 00', email: 'info@werkheim-uster.ch', website: 'https://www.werkheim-uster.ch' },
|
||||
{ name: 'IWAZ Sozialunternehmen', category: 'Geschützte Arbeitsplätze', address: 'Neugrundstrasse 4', city: '8620 Wetzikon', phone: '+41 44 933 23 23', email: 'kontakt@iwaz.ch', website: 'https://www.iwaz.ch' },
|
||||
{ name: 'EPI WohnWerk', category: 'Werkstätten & Wohnheime', address: 'Bleulerstrasse 60', city: '8008 Zürich', phone: '+41 44 387 64 01', email: 'info@epi-wohnwerk.ch', website: 'https://www.epi-wohnwerk.ch' },
|
||||
{ name: 'Stiftung zur Palme (Werkstatt)', category: 'Geschützte Werkstatt', address: 'Allmendstrasse 30', city: '8320 Fehraltorf', phone: '+41 44 953 31 78', email: 'werkstatt@palme.ch', website: 'https://www.palme.ch' },
|
||||
{ name: 'Stiftung zur Palme (Zentrale)', category: 'Soziale Einrichtung', address: 'Hochstrasse 31–33', city: '8330 Pfäffikon', phone: '+41 44 953 31 31', email: 'info@palme.ch', website: 'https://www.palme.ch' },
|
||||
{ name: 'SaveElektro', category: 'ReUse / Upcycling', city: 'Zürcher Region', email: 'info@saveelektro.ch', website: 'https://www.saveelektro.ch' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'kunden',
|
||||
shortLabel: 'Kunden',
|
||||
title: 'Kunden — Immobilienbewirtschaftung & Facility Management',
|
||||
intro:
|
||||
'Eigentümer und Verwalter grösserer Immobilienportfolios mit vielen ' +
|
||||
'geeigneten Nebenräumen (Keller, Technik-, Velo- und Einstellräume) für ' +
|
||||
'Pilotprojekte und Feedback.',
|
||||
outreach: OUTREACH.kunden,
|
||||
contacts: [
|
||||
{ name: 'Wincasa AG', category: 'Immobilienbewirtschaftung', address: 'Theaterstr. 17', city: '8400 Winterthur', phone: '+41 58 455 77 77', email: 'info@wincasa.ch', website: 'https://www.wincasa.ch' },
|
||||
{ name: 'Livit AG', category: 'Immobilienbewirtschaftung', address: 'Altstetterstrasse 124', city: '8048 Zürich', phone: '+41 58 360 33 33', email: 'info@livit.ch', website: 'https://www.livit.ch' },
|
||||
{ name: 'Allreal Holding AG', category: 'Immobilienunternehmen', address: 'Lindbergh-Allee 1', city: '8152 Glattpark', phone: '+41 44 319 11 11', email: 'info@allreal.ch', website: 'https://www.allreal.ch' },
|
||||
{ name: 'ISS Schweiz AG', category: 'Facility Management', address: 'Vulkanplatz 3', city: '8010 Zürich', phone: '+41 58 787 85 00', email: 'info@ch.issworld.com', website: 'https://www.issworld.com' },
|
||||
{ name: 'Schaeppi Grundstücke AG', category: 'Immobilienbewirtschaftung', address: 'Sihlfeldstrasse 10', city: '8003 Zürich', phone: '+41 44 456 56 56', website: 'https://www.schaeppi.ch' },
|
||||
{ name: 'Esca Immobilien AG', category: 'Immobilienbewirtschaftung', address: 'Rieterstrasse 52', city: '8002 Zürich', phone: '+41 44 281 00 01', email: 'info@escaverwaltung.ch', website: 'https://www.escaverwaltung.ch' },
|
||||
{ name: 'Stockwerk8', category: 'Immobilienbewirtschaftung', address: 'Zollikerstrasse 65', city: '8702 Zollikon', phone: '+41 44 318 70 70', email: 'hello@stockwerk8.ch', website: 'https://www.stockwerk8.ch' },
|
||||
{ name: 'Privera AG', category: 'Immobilienbewirtschaftung', address: 'Worbstrasse 142', city: '3073 Gümligen', phone: '+41 58 715 60 00', email: 'guemligen@privera.ch', website: 'https://www.privera.ch' },
|
||||
{ name: 'Helvetia Service AG (Real Estate)', category: 'Immobilienbewirtschaftung', address: 'Zürichstrasse 130', city: '8600 Dübendorf', phone: '+41 58 280 86 77', website: 'https://www.helvetia.com' },
|
||||
{ name: 'Stadt Zürich Immobilien (IMMO)', category: 'Immobilienverwaltung Stadt', address: 'Eggbühlstrasse 15', city: '8050 Zürich', website: 'https://www.stadt-zuerich.ch/immobilien' },
|
||||
{ name: 'ISS Facility Services (Basel)', category: 'Facility Management', address: 'Hochbergerstrasse 15', city: '4002 Basel', phone: '+41 58 787 76 00', website: 'https://www.ch.issworld.com' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'spender',
|
||||
shortLabel: 'Förderer',
|
||||
title: 'Spender — Stiftungen & Förderorganisationen',
|
||||
intro:
|
||||
'Stiftungen mit Förderprofil in Klima, Kreislaufwirtschaft, Innovation oder ' +
|
||||
'sozialer Integration. Mehrere parallel ansprechen erhöht die Chance auf ' +
|
||||
'eine Anschlussfinanzierung.',
|
||||
outreach: OUTREACH.spender,
|
||||
contacts: [
|
||||
{ name: 'Gebert Rüf Stiftung', category: 'Förderstiftung', address: 'St. Alban-Vorstadt 12', city: '4052 Basel', phone: '+41 61 270 88 22', email: 'info@grstiftung.ch', website: 'https://www.grstiftung.ch' },
|
||||
{ name: 'Klimastiftung Schweiz', category: 'Förderstiftung', address: 'Mythenquai 50/60', city: '8002 Zürich', phone: '+41 43 285 44 80', email: 'info@klimastiftung.ch', website: 'https://www.klimastiftung.ch' },
|
||||
{ name: 'Swiss Re Foundation', category: 'Stiftung', address: 'Mythenquai 50/60', city: '8022 Zürich', email: 'foundation@swissre.com', website: 'https://www.swissre.com/foundation' },
|
||||
{ name: 'Sophie und Karl Binding Stiftung', category: 'Förderstiftung', address: 'Rennweg 50', city: '4020 Basel', phone: '+41 61 317 40 90', email: 'contact@binding-stiftung.ch', website: 'https://www.binding-stiftung.ch' },
|
||||
{ name: 'Migros Pionierfonds', category: 'Förderfonds', address: 'Limmatstrasse 152', city: '8031 Zürich', phone: '+41 58 575 32 10', website: 'https://www.migros-pionierfonds.ch' },
|
||||
{ name: 'myclimate', category: 'Stiftung', address: 'Pfingstweidstrasse 10', city: '8005 Zürich', phone: '+41 44 500 43 50', email: 'info@myclimate.org', website: 'https://www.myclimate.org' },
|
||||
{ name: 'Schweizerische Energie-Stiftung', category: 'Stiftung', address: 'Sihlquai 67', city: '8005 Zürich', phone: '+41 44 275 21 21', email: 'info@energiestiftung.ch', website: 'https://www.energiestiftung.ch' },
|
||||
{ name: 'Clima Now', category: 'Stiftung', address: 'Forchstrasse 60', city: '8008 Zürich', email: 'contact@climanow.ch', website: 'https://www.climanow.ch' },
|
||||
{ name: 'Paul Schiller Stiftung', category: 'Stiftung', address: 'Feldmoosstrasse 12', city: '8853 Lachen', phone: '+41 55 451 53 90', email: 'info@paul-schiller-stiftung.ch', website: 'https://www.paul-schiller-stiftung.ch' },
|
||||
{ name: 'Christoph Merian Stiftung', category: 'Stiftung', address: 'St. Alban-Vorstadt 12', city: '4052 Basel', phone: '+41 61 226 33 33', email: 'info@cms-basel.ch', website: 'https://www.cms-basel.ch' },
|
||||
{ name: 'UBS Optimus Foundation', category: 'Förderstiftung', address: 'Bahnhofstrasse 45', city: '8001 Zürich', email: 'sh-philanthropy@ubs.com', website: 'https://www.ubs.com/optimusfoundation' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'vertrieb',
|
||||
shortLabel: 'Vertrieb (klein)',
|
||||
title: 'Vertriebspartner — nachhaltige Läden & Werkstätten',
|
||||
intro:
|
||||
'Kleinere, nachhaltig ausgerichtete Läden und Upcycling-Werkstätten als ' +
|
||||
'Verkaufskanäle mit passendem Publikum.',
|
||||
outreach: OUTREACH.vertrieb,
|
||||
contacts: [
|
||||
{ name: 'Marktlücke', category: 'Nachhaltiger Laden', address: 'Schipfe 24+26', city: '8001 Zürich', phone: '+41 44 212 77 25', email: 'laden@markt-luecke.ch', website: 'https://www.markt-luecke.ch' },
|
||||
{ name: 'Werk:laden', category: 'Upcycling & Veloreparaturen', address: 'Josefstrasse 104', city: '8005 Zürich', phone: '+41 78 228 87 64', email: 'info@werkladen.ch', website: 'https://www.werkladen.ch' },
|
||||
{ name: 'Akzentwerk', category: 'Upcycling-Design', address: 'Alpenstrasse 9', city: '3550 Langnau i.E.', phone: '+41 34 402 12 69', email: 'info@akzentwerk.ch', website: 'https://www.akzentwerk.ch' },
|
||||
{ name: 'Mr. Green', category: 'Nachhaltiger Shop', address: 'Predigerplatz 2', city: '8001 Zürich', phone: '+41 44 271 30 30', email: 'info@mr-green.ch', website: 'https://www.mr-green.ch' },
|
||||
{ name: 'Saus&Braus', category: 'Secondhand & Upcycling', address: 'Ankerstrasse 14', city: '8004 Zürich', phone: '+41 44 242 23 11', email: 'info@sausbraus.ch', website: 'https://www.sausbraus.ch' },
|
||||
{ name: 'Changemaker', category: 'Nachhaltige Produkte', address: 'Marktgasse 10', city: '8001 Zürich', phone: '+41 44 251 21 20', email: 'zuerich@changemaker.ch', website: 'https://www.changemaker.ch' },
|
||||
{ name: 'Marktlücke Werkstatt', category: 'Werkstatt & Produktion', address: 'Hermetschloostrasse 70', city: '8048 Zürich', phone: '+41 44 401 91 80', email: 'werkstatt@markt-luecke.ch', website: 'https://www.markt-luecke.ch' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'grossverteiler',
|
||||
shortLabel: 'Grossverteiler',
|
||||
title: 'Grossverteiler & Detailhandel — Schweiz',
|
||||
intro:
|
||||
'Grosse Schweizer Detailhändler aus Leuchten, Möbel, Heimsortiment und ' +
|
||||
'Baumarkt — bevorzugt mit bestehendem Nachhaltigkeits- oder Kreislauf-' +
|
||||
'Programm. Höheres Volumen, aber längere Entscheidungswege; idealer ' +
|
||||
'Einstieg über das Nachhaltigkeits- oder Einkaufsteam.',
|
||||
outreach: OUTREACH.grossverteiler,
|
||||
contacts: [
|
||||
{
|
||||
name: 'Lumimart (Coop-Gruppe)',
|
||||
category: 'Leuchten-Detailhandel',
|
||||
note: 'Grösste Schweizer Leuchten-Fachhandelskette — der direkteste Absatzkanal für upgecycelte LED-Leuchten. Telefon/E-Mail vor Kontaktaufnahme prüfen.',
|
||||
website: 'https://www.lumimart.ch',
|
||||
bestContactUrl: 'https://www.lumimart.ch/de/impressum',
|
||||
},
|
||||
{
|
||||
name: 'IKEA Schweiz',
|
||||
category: 'Möbel-Detailhandel',
|
||||
note: 'Betreibt mit dem Kreislauf-/Secondhand-Programm einen Rückkauf-Service — warmer Lead für Second-Life-Produkte.',
|
||||
address: 'Müslistrasse 16',
|
||||
city: '8957 Spreitenbach',
|
||||
email: 'customer.support.de.ch@ikea.com',
|
||||
website: 'https://www.ikea.com/ch/de/',
|
||||
bestContactUrl: 'https://www.ikea.com/ch/de/circular/',
|
||||
},
|
||||
{
|
||||
name: 'Micasa (Migros)',
|
||||
category: 'Möbel-Detailhandel',
|
||||
note: 'Führt mit der Linie „RELOVED“ restaurierte Secondhand-Möbel und verkauft Leuchten — Kreislauf-Affinität vorhanden.',
|
||||
phone: '+41 58 311 70 00',
|
||||
email: 'contact@micasa.ch',
|
||||
website: 'https://www.micasa.ch',
|
||||
bestContactUrl: 'https://www.micasa.ch/pages/nachhaltigkeit',
|
||||
},
|
||||
{
|
||||
name: 'Möbel Pfister',
|
||||
category: 'Möbel-Detailhandel',
|
||||
note: 'Grosse Einrichtungskette mit Beleuchtungssortiment und eigener Nachhaltigkeitsstrategie. Für den Vertrieb über die Kontaktseite, nicht die Presse-Adresse.',
|
||||
address: 'Bernstrasse Ost 49',
|
||||
city: '5034 Suhr',
|
||||
phone: '+41 62 855 33 33',
|
||||
website: 'https://www.pfister.ch',
|
||||
bestContactUrl: 'https://www.pfister.ch/de/umwelt-und-nachhaltigkeit',
|
||||
},
|
||||
{
|
||||
name: 'Vitra',
|
||||
category: 'Möbel-Detailhandel (Design)',
|
||||
note: 'Betreibt das „Vitra Circle“-Programm mit Circle Stores für aufbereitete Gebrauchtmöbel — explizit Second-Life-orientiert.',
|
||||
address: 'Klünenfeldstrasse 22',
|
||||
city: '4127 Birsfelden',
|
||||
website: 'https://www.vitra.com/de-ch/',
|
||||
bestContactUrl: 'https://www.vitra.com/de-ch/about-vitra/sustainability/vitra-circle-stores',
|
||||
},
|
||||
{
|
||||
name: 'HORNBACH Schweiz AG',
|
||||
category: 'Baumarkt / DIY',
|
||||
note: 'Schweizweite Bau-/Gartenmarktkette mit Beleuchtungssortiment und offenem Kanal für Lieferantenbewerbungen.',
|
||||
address: 'Schellenrain 9',
|
||||
city: '6210 Sursee',
|
||||
phone: '+41 41 929 64 99',
|
||||
website: 'https://www.hornbach.ch',
|
||||
bestContactUrl: 'https://www.hornbach.ch/services/hilfe-und-kontakt/',
|
||||
},
|
||||
{
|
||||
name: 'LANDI Schweiz AG (fenaco)',
|
||||
category: 'Baumarkt / DIY',
|
||||
note: 'Sehr dichtes Filialnetz im ländlichen Raum — breiter, dezentraler Absatzkanal.',
|
||||
address: 'Schulriederstrasse 5',
|
||||
city: '3293 Dotzigen',
|
||||
phone: '+41 848 000 120',
|
||||
email: 'kundendienst@landischweiz.ch',
|
||||
website: 'https://www.landi.ch',
|
||||
bestContactUrl: 'https://www.landi.ch/fenaco-landi-gruppe/landi-contact',
|
||||
},
|
||||
{
|
||||
name: 'BAUHAUS Schweiz',
|
||||
category: 'Baumarkt / DIY',
|
||||
note: 'Fachcentren-Kette für Heimwerker- und Renovationsbedarf mit Beleuchtungssortiment. Adresse vor Kontaktaufnahme prüfen.',
|
||||
phone: '+41 31 818 11 60',
|
||||
website: 'https://www.bauhaus.ch',
|
||||
bestContactUrl: 'https://www.bauhaus.ch/de/l/legal/contact-information',
|
||||
},
|
||||
{
|
||||
name: 'Globus (Magazine zum Globus AG)',
|
||||
category: 'Warenhaus (Premium)',
|
||||
note: 'Premium-Warenhaus mit Wohn-/Home-Sortiment und eigener Nachhaltigkeitsseite — passend für hochwertige Leuchten.',
|
||||
address: 'Schweizergasse 12',
|
||||
city: '8001 Zürich',
|
||||
email: 'service@globus.ch',
|
||||
website: 'https://www.globus.ch',
|
||||
bestContactUrl: 'https://www.globus.ch/nachhaltigkeit',
|
||||
},
|
||||
{
|
||||
name: 'Manor AG',
|
||||
category: 'Warenhaus',
|
||||
note: 'Grösste Warenhausgruppe der Schweiz mit Wohn-/Beleuchtungssortiment und offenem Lieferantenprogramm („Suppliers @ Manor“) — idealer Partnerschaftskanal.',
|
||||
address: 'Rebgasse 34',
|
||||
city: '4058 Basel',
|
||||
phone: '+41 848 802 805',
|
||||
email: 'info@manor.ch',
|
||||
website: 'https://www.manor.ch',
|
||||
bestContactUrl: 'https://www.manor.ch/de/u/suppliers',
|
||||
},
|
||||
{
|
||||
name: 'Digitec Galaxus AG',
|
||||
category: 'Online-Detailhandel',
|
||||
note: 'Grösster Schweizer Online-Händler mit eigenem Nachhaltigkeitsprogramm — potenzieller Online-Absatzkanal. Kontaktdaten vor Kontaktaufnahme prüfen.',
|
||||
website: 'https://www.digitec.ch',
|
||||
bestContactUrl: 'https://www.digitec.ch/de/page/nachhaltigkeit-bei-galaxus-und-digitec-34164',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
/* ─── Projektübersicht (aus Projektinfo-Dokument) ─────────────────── */
|
||||
|
||||
export interface DossierTimelineItem {
|
||||
date: string
|
||||
label: string
|
||||
done?: boolean
|
||||
}
|
||||
|
||||
export const DOSSIER_PROJECT = {
|
||||
/** ISO-Stand des Dossiers — von der Statusseite getrennt geführt. */
|
||||
snapshotIso: '2026-06-18',
|
||||
summary:
|
||||
'Umwandlung ausgedienter Computermonitore in Leuchten: Stand, offene ' +
|
||||
'Fragen, Meilensteine und Akquise-Kontakte auf einen Blick.',
|
||||
tasks: [
|
||||
'Produktion einer Kleinserie umgebauter Monitor-Leuchten (ca. 70 Stück) und Sicherstellung der Qualität.',
|
||||
'Kosten-Nutzen-Analyse mit Unterstützung der ZHAW und ökologischer Vergleich (LCA).',
|
||||
'Detaillierte Anleitung pro Monitor-Modell (Fotos, Boards, Pin-Belegung, Sicherheit) für die Veröffentlichung.',
|
||||
'Kontaktaufnahme mit Produktionspartnern (geschützte Werkstätten) und Bewertung ihrer Eignung.',
|
||||
'Kontaktaufnahme mit potenziellen Kunden (Immobilienverwaltungen, Facility-Manager) für Pilotprojekte.',
|
||||
'Identifikation von Förderorganisationen und Einreichen von Förderanträgen.',
|
||||
'Kontaktaufnahme mit Vertriebspartnern für mögliche Verkaufskanäle.',
|
||||
'Klärung der rechtlichen Rahmenbedingungen (CE-Konformität) mit einem Fachingenieur.',
|
||||
'Abklärung mit Entsorgung + Recycling Zürich (ERZ), ob Bildschirme vor dem Recycling herausgelöst werden können.',
|
||||
'Festlegung eines Mediums (Domain / Wiki) für die frei zugängliche Publikation der Anleitungen.',
|
||||
'Organisation des Schlussberichts und des Präsentationstermins (3. Juli 2026).',
|
||||
],
|
||||
openQuestions: [
|
||||
'Welche Monitor-Modelle eignen sich am besten? Wie lassen sich unterschiedliche Boards standardisieren?',
|
||||
'Wie lassen sich Flimmern und Helligkeitsregelung modellübergreifend lösen?',
|
||||
'Wie hoch ist der tatsächliche Umweltvorteil gegenüber neuen Leuchten — reicht eine grobe Ökobilanz oder braucht es eine umfassende LCA?',
|
||||
'Wie viel darf die Lampe kosten, damit sie im Markt akzeptiert wird?',
|
||||
'Welche Partner übernehmen Produkthaftung und CE-Kennzeichnung bei Serienproduktion?',
|
||||
'Wie lassen sich ausreichende Mengen an auszutauschenden Bildschirmen sichern (ERZ, weitere Sammelstellen)?',
|
||||
'Welche Fördergelder sind realistisch und an welche Bedingungen geknüpft?',
|
||||
'Wie wird das Projekt kommuniziert — funktionale Leuchte oder kreatives Designobjekt?',
|
||||
],
|
||||
timeline: [
|
||||
{ date: 'Januar 2026', label: 'Abschluss der Kleinserie sowie erste Kosten-/Nutzenanalysen.', done: true },
|
||||
{ date: '31. Januar 2026', label: 'Ursprüngliche Frist für Etappe 2 (Swico) — bis Juni 2026 verlängert.', done: true },
|
||||
{ date: 'Juni 2026', label: 'Fertigstellung des Schlussberichts mit allen Listen und Analysen.' },
|
||||
{ date: '3. Juli 2026', label: 'Präsentation der Projektergebnisse vor dem Swico Innovationsfonds.' },
|
||||
{ date: 'Laufend', label: 'Dokumentation weiterer Modelle, Akquise von Kunden und Partnern, Förderanträge.' },
|
||||
] satisfies DossierTimelineItem[],
|
||||
recommendations: [
|
||||
'Bei den Herstellern zuerst auf Produktionspartner mit Elektronik-Know-how konzentrieren (z. B. Drahtzug, FARO, cb-Stiftung) und rein gastronomisch ausgerichtete Einrichtungen meiden.',
|
||||
'Bei den Kunden mit Eigentümern grösserer Immobilienportfolios starten (Wincasa, Livit, Allreal), die über viele geeignete Nebenräume verfügen.',
|
||||
'Für die Finanzierung mehrere Stiftungen parallel ansprechen.',
|
||||
'Klare Kommunikationsstrategie: das Produkt als funktionale, kreislauffähige Alternative präsentieren; kreative Zusatznutzen in einer späteren Phase adressieren.',
|
||||
],
|
||||
} as const
|
||||
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* Monitor-Upcycling gallery — data SSOT
|
||||
*
|
||||
* Model list maintained in-repo (workshop SSOT). Gallery photos only where
|
||||
* documented on site under `public/projects/upcycling/gallery/`.
|
||||
* Photography workflow: public/projects/upcycling/gallery/REAL_PHOTOS.md
|
||||
*/
|
||||
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
|
||||
export type UpcyclingGalleryPlaceholderVariant = 'functional' | 'warm' | 'cool' | 'art'
|
||||
|
||||
export type UpcyclingGalleryTier = 'functional' | 'decor'
|
||||
|
||||
export interface UpcyclingGalleryPiece {
|
||||
id: string
|
||||
model: string
|
||||
tier: UpcyclingGalleryTier
|
||||
variant: UpcyclingGalleryPlaceholderVariant
|
||||
seed: number
|
||||
/** Filename under public/projects/upcycling/gallery/ */
|
||||
image?: string
|
||||
/** Optional mp4 demo; `image` serves as poster. */
|
||||
video?: string
|
||||
/** Present when a model-specific guide exists. */
|
||||
guideHref?: string
|
||||
}
|
||||
|
||||
export const UPCYCLING_GALLERY_PIECES: UpcyclingGalleryPiece[] = [
|
||||
{
|
||||
id: 'lenovo-l2251pwd',
|
||||
model: 'Lenovo L2251pwd',
|
||||
tier: 'functional',
|
||||
variant: 'functional',
|
||||
seed: 101,
|
||||
image: 'lenovo-l2251pwd-finished-poster.jpg',
|
||||
video: 'lenovo-l2251pwd-finished.mp4',
|
||||
guideHref: UPCYCLING_ROUTES.lenovoL2251pwd,
|
||||
},
|
||||
{ id: 'nec-multisync-e233-wmi', model: 'NEC Multisync E233 WMi', tier: 'functional', variant: 'functional', seed: 102 },
|
||||
{ id: 'lenovo-t2254a', model: 'Lenovo T2254A', tier: 'functional', variant: 'functional', seed: 103 },
|
||||
{ id: 'lenovo-24', model: 'Lenovo 24"', tier: 'functional', variant: 'functional', seed: 104 },
|
||||
{ id: 'dell-u2312hmt', model: 'DELL U2312HMt', tier: 'functional', variant: 'cool', seed: 105 },
|
||||
{ id: 'dell-u2412m', model: 'DELL U2412M', tier: 'functional', variant: 'cool', seed: 106 },
|
||||
{ id: 'dell-u2713hb', model: 'DELL U2713Hb', tier: 'functional', variant: 'cool', seed: 107 },
|
||||
{ id: 'dell-p2418d', model: 'DELL P2418D', tier: 'functional', variant: 'cool', seed: 108 },
|
||||
{ id: 'hp-elite-display-e242', model: 'HP EliteDisplay E242', tier: 'functional', variant: 'warm', seed: 109 },
|
||||
{ id: 'hp-e24i-g4', model: 'HP E24i G4', tier: 'functional', variant: 'warm', seed: 110 },
|
||||
{ id: 'hp-e243m', model: 'HP E243m', tier: 'functional', variant: 'warm', seed: 111 },
|
||||
{ id: 'asus-v247', model: 'ASUS V247', tier: 'decor', variant: 'warm', seed: 112 },
|
||||
{ id: 'eizo-ev2315w', model: 'EIZO EV2315W', tier: 'decor', variant: 'cool', seed: 113 },
|
||||
]
|
||||
|
||||
export function splitUpcyclingGalleryPieces(
|
||||
pieces: UpcyclingGalleryPiece[] = UPCYCLING_GALLERY_PIECES,
|
||||
) {
|
||||
return {
|
||||
documented: pieces.filter((p) => !!p.image),
|
||||
queued: pieces.filter((p) => !p.image),
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { UPCYCLING_ROUTES } from '@/config/upcycling-routes'
|
||||
|
||||
/** Published model guides — slug SSOT; copy lives in i18n keyed by slug. */
|
||||
export const UPCYCLING_GUIDE_SLUGS = ['lenovo-l2251pwd'] as const
|
||||
|
||||
export type UpcyclingGuideSlug = (typeof UPCYCLING_GUIDE_SLUGS)[number]
|
||||
|
||||
export const UPCYCLING_GUIDE_ROUTES: Record<UpcyclingGuideSlug, string> = {
|
||||
'lenovo-l2251pwd': UPCYCLING_ROUTES.lenovoL2251pwd,
|
||||
}
|
||||
|
||||
export function isUpcyclingGuideSlug(slug: string): slug is UpcyclingGuideSlug {
|
||||
return (UPCYCLING_GUIDE_SLUGS as readonly string[]).includes(slug)
|
||||
}
|
||||
|
||||
/** Keep i18n guide rows aligned with published slugs (SSOT order). */
|
||||
export function orderPublishedGuides<T extends { slug: string }>(items: T[]): T[] {
|
||||
const bySlug = new Map(items.map((item) => [item.slug, item]))
|
||||
return UPCYCLING_GUIDE_SLUGS.flatMap((slug) => {
|
||||
const item = bySlug.get(slug)
|
||||
return item ? [item] : []
|
||||
})
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Monitor-Upcycling — real-world installations (data SSOT)
|
||||
*
|
||||
* Every entry traces to the Swico Abschlussbericht (Projekt 2023-02-01,
|
||||
* Nextcloud: Kreislaufnutzung_IT/Abschlussbericht_Projekt_2023-02-01.odt).
|
||||
* Structure lives here (ids, photos, order); the translatable caption/story
|
||||
* strings live in messages under `projects.upcycling.applications.installs`
|
||||
* keyed by `id` (i18n SSOT: messages = strings only).
|
||||
*
|
||||
* `image` is optional on purpose: installations without photography yet are
|
||||
* still listed honestly as text entries (same discipline as the gallery's
|
||||
* documented-vs-queued split).
|
||||
*/
|
||||
|
||||
import { UPCYCLING_ASSETS } from '@/config/upcycling-assets'
|
||||
|
||||
export interface UpcyclingInstallation {
|
||||
/** i18n key under projects.upcycling.applications.installs.items */
|
||||
id: string
|
||||
/** Primary photo (public path); absent → text-only entry. */
|
||||
image?: string
|
||||
/** Additional photos for the same installation. */
|
||||
extraImages?: string[]
|
||||
}
|
||||
|
||||
export const UPCYCLING_INSTALLATIONS: UpcyclingInstallation[] = [
|
||||
{
|
||||
id: 'repairhub',
|
||||
image: UPCYCLING_ASSETS.installs.werkbankCurved1,
|
||||
extraImages: [UPCYCLING_ASSETS.installs.curvedRepairhub],
|
||||
},
|
||||
{
|
||||
id: 'laden',
|
||||
image: UPCYCLING_ASSETS.installs.eingangLaden,
|
||||
extraImages: [
|
||||
UPCYCLING_ASSETS.installs.ladenWand1,
|
||||
UPCYCLING_ASSETS.installs.ladenDecke1,
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'werkraum4',
|
||||
image: UPCYCLING_ASSETS.installs.werkraum4Decke1,
|
||||
extraImages: [UPCYCLING_ASSETS.installs.werkraum4Decke2],
|
||||
},
|
||||
{ id: 'recreazzz' },
|
||||
{ id: 'ambossrampe' },
|
||||
]
|
||||
@@ -27,7 +27,6 @@ export const chatbotMessages: Record<Language, ChatbotMessages> = {
|
||||
'/': 'Hallo! Ich bin dein persönlicher evig Assistent. Wie kann ich dir heute helfen, unsere nachhaltigen IT-Lösungen zu entdecken?',
|
||||
'/about': 'Du bist auf unserer "Über uns" Seite! Möchtest du mehr über unsere Mission erfahren oder zu anderen Bereichen navigieren?',
|
||||
'/services': 'Perfekt! Du schaust dir unsere Dienstleistungen an. Suchst du etwas Bestimmtes oder brauchst du Hilfe bei der Auswahl?',
|
||||
'/projects': 'Interessant! Du entdeckst unsere Projekte. Möchtest du mehr über ein spezielles Projekt erfahren oder andere Bereiche erkunden?',
|
||||
'/workshops': 'Du interessierst dich für unsere Workshops! Suchst du nach bestimmten Kursen oder hast du Fragen zu unserem Bildungsangebot?',
|
||||
'/get-involved': 'Fantastisch, dass du dich engagieren möchtest! Wie kannst du am besten bei evig mitmachen?',
|
||||
'/contact': 'Du bist auf unserer Kontaktseite. Brauchst du Hilfe dabei, den richtigen Ansprechpartner zu finden?',
|
||||
@@ -51,7 +50,6 @@ export const chatbotMessages: Record<Language, ChatbotMessages> = {
|
||||
'/': 'Hello! I\'m your personal evig assistant. How can I help you discover our sustainable IT solutions today?',
|
||||
'/about': 'You\'re on our "About us" page! Would you like to learn more about our mission or navigate to other areas?',
|
||||
'/services': 'Perfect! You\'re looking at our services. Are you looking for something specific or do you need help choosing?',
|
||||
'/projects': 'Interesting! You\'re exploring our projects. Would you like to learn more about a specific project or explore other areas?',
|
||||
'/workshops': 'You\'re interested in our workshops! Are you looking for specific courses or do you have questions about our educational offerings?',
|
||||
'/get-involved': 'Fantastic that you want to get involved! How can you best participate with evig?',
|
||||
'/contact': 'You\'re on our contact page. Do you need help finding the right contact person?',
|
||||
@@ -140,13 +138,11 @@ export function getContextualSuggestions(page: string, language: Language) {
|
||||
'/about': language === 'de' ? [
|
||||
{ label: '🏷️ REVAMPED-Zertifizierung', href: '/revamped', description: 'Unsere nachhaltige Computer-Zertifizierung' },
|
||||
{ label: '📚 Wiki besuchen', href: EXTERNAL_LINKS.wiki, description: 'Unser Wissensportal', external: true },
|
||||
{ label: '🔧 Dienstleistungen ansehen', href: '/services', description: 'Was wir für dich tun können' },
|
||||
{ label: '💼 Projekte entdecken', href: '/projects', description: 'Unsere aktuellen Initiativen' }
|
||||
{ label: '🔧 Dienstleistungen ansehen', href: '/services', description: 'Was wir für dich tun können' }
|
||||
] : [
|
||||
{ label: '🏷️ REVAMPED Certification', href: '/revamped', description: 'Our sustainable computer certification' },
|
||||
{ label: '📚 Visit Wiki', href: EXTERNAL_LINKS.wiki, description: 'Our knowledge portal', external: true },
|
||||
{ label: '🔧 View Services', href: '/services', description: 'What we can do for you' },
|
||||
{ label: '💼 Discover Projects', href: '/projects', description: 'Our current initiatives' }
|
||||
{ label: '🔧 View Services', href: '/services', description: 'What we can do for you' }
|
||||
],
|
||||
|
||||
'/services': language === 'de' ? [
|
||||
|
||||
Reference in new issue
Block a user