/* ============================================================================= * A03_CompDetail_UI_Page.ts * 로그인 전 03: 회사 상세 (미션 + 핵심 가치 + 연락처) * * 제약 준수: * - 모든 문구는 ui_template_locale.ts 참조 (하드코딩 금지). * - 색상/간격은 A03_CompDetail_UI_Style.css + theme.css 변수만 사용. * - 공통 부품(createPublicFrame/createCard) 우선 사용. * ========================================================================== */ import { ui_locales, currentLanguageIndex } from "@ui/ui_template_locale"; import { createCard } from "@ui/ui_template_elements"; import { createPublicFrame } from "@ui/ui_template_public_layout"; import { createText } from "@ui/ui_template_text"; import "./A03_CompDetail_UI_Style.css"; /** locale 헬퍼 */ function L(key: keyof typeof ui_locales): string { return ui_locales[key][currentLanguageIndex]; } /* ----------------------------------------------------------------------------- * 섹션 빌더 * -------------------------------------------------------------------------- */ function buildMission(): HTMLElement { const body = document.createElement("p"); body.className = "a03-mission__body"; body.textContent = L("A03_CompDetail_Mission_Body"); return body; } function buildValues(): HTMLElement { const grid = document.createElement("div"); grid.className = "a03-value-grid"; const values: [keyof typeof ui_locales, keyof typeof ui_locales][] = [ ["A03_CompDetail_Value1_Title", "A03_CompDetail_Value1_Desc"], ["A03_CompDetail_Value2_Title", "A03_CompDetail_Value2_Desc"], ["A03_CompDetail_Value3_Title", "A03_CompDetail_Value3_Desc"], ]; for (const [titleKey, descKey] of values) { const card = createCard({ title: L(titleKey), body: [createText(L(descKey), "muted", 14)] }); card.classList.add("a03-value-card"); grid.append(card); } return grid; } function buildContact(): HTMLElement { const email = document.createElement("p"); email.className = "a03-contact__email"; email.textContent = L("A03_CompDetail_Contact_Email"); return email; } /* ----------------------------------------------------------------------------- * 페이지 진입점 * -------------------------------------------------------------------------- */ export function renderA03CompDetail(root: HTMLElement): void { const frame = createPublicFrame({ title: L("A03_CompDetail_Title"), lead: L("A03_CompDetail_Hero_Subtitle"), wide: true, }); frame.addSection(L("A03_CompDetail_Mission_SectionTitle")).append(buildMission()); frame.addSection(L("A03_CompDetail_Value_SectionTitle")).append(buildValues()); frame.addSection(L("A03_CompDetail_Contact_SectionTitle")).append(buildContact()); root.append(frame.root); }