62 lines
2.2 KiB
TypeScript
62 lines
2.2 KiB
TypeScript
import type { VisualTemplateKey } from "./template-keys.js";
|
|
import type { VisualTemplateDefinition } from "./brand-contracts.js";
|
|
|
|
export const visualTemplates: Record<VisualTemplateKey, VisualTemplateDefinition> = {
|
|
"linjing-editorial": {
|
|
key: "linjing-editorial",
|
|
version: "1.0.0",
|
|
name: "林境建筑画册",
|
|
description: "适合高端定制、建筑作品和项目型个人品牌。",
|
|
supportedIndustryTemplates: ["personal", "doors"],
|
|
variants: { hero: "architectural", offeringList: "editorial", detail: "project-case" },
|
|
theme: {
|
|
colors: { background: "#F7F5F1", foreground: "#252525", accent: "#8A6846", dark: "#202221" },
|
|
radius: { card: "16rpx" },
|
|
},
|
|
layout: {
|
|
home: ["founder-card", "brand-hero", "trust-proof", "trust-manifesto", "offering-list"],
|
|
offerings: ["offering-list"],
|
|
detail: ["offering-detail"],
|
|
profile: ["profile"],
|
|
},
|
|
},
|
|
"acheng-campus-food": {
|
|
key: "acheng-campus-food",
|
|
version: "1.0.0",
|
|
name: "阿成校园餐",
|
|
description: "适合校园餐饮、套餐预订和团体定制的暖橙菜单视觉。",
|
|
supportedIndustryTemplates: ["food"],
|
|
variants: { hero: "stall-board", offeringList: "menu-card", detail: "dish-detail" },
|
|
theme: {
|
|
colors: { background: "#FFF8F0", foreground: "#29231F", accent: "#E87532", dark: "#3B2118" },
|
|
radius: { card: "24rpx" },
|
|
},
|
|
layout: {
|
|
home: ["founder-card", "brand-hero", "trust-proof", "offering-list"],
|
|
offerings: ["offering-list"],
|
|
detail: ["offering-detail"],
|
|
profile: ["profile"],
|
|
},
|
|
},
|
|
};
|
|
|
|
export function listVisualTemplateKeys(): VisualTemplateKey[] {
|
|
return Object.keys(visualTemplates);
|
|
}
|
|
|
|
export const visualTemplateKeys = listVisualTemplateKeys();
|
|
|
|
export function getVisualTemplate(key: string): VisualTemplateDefinition | undefined {
|
|
return visualTemplates[key];
|
|
}
|
|
|
|
export function getDefaultVisualTemplateKey(industryTemplateKey: string): VisualTemplateKey {
|
|
return (
|
|
listVisualTemplateKeys().find((key) =>
|
|
getVisualTemplate(key)?.supportedIndustryTemplates.includes(industryTemplateKey),
|
|
) ?? defaultVisualTemplateKey
|
|
);
|
|
}
|
|
|
|
export const defaultVisualTemplateKey = "linjing-editorial" satisfies VisualTemplateKey;
|