diff --git a/src/components/LanguageDetector.astro b/src/components/LanguageDetector.astro new file mode 100644 index 0000000..60d587f --- /dev/null +++ b/src/components/LanguageDetector.astro @@ -0,0 +1,36 @@ +--- +import { pathHasLocale, getRelativeLocaleUrl } from 'astro:i18n'; + +// 使用 pathHasLocale 安全判断当前路径是否已包含任何语言前缀(返回 boolean) +const hasLocale = pathHasLocale(Astro.url.pathname); + +// 自动生成中文根路径 +const cnRootUrl = getRelativeLocaleUrl('cn', ''); +--- + + \ No newline at end of file diff --git a/src/components/pages/article.astro b/src/components/pages/article.astro index 875075c..df76420 100644 --- a/src/components/pages/article.astro +++ b/src/components/pages/article.astro @@ -1,53 +1,45 @@ ---- + + -// 示例数据:字段严格对齐后端 BrandRunway 模型 + 图片集接口 -const article = { - id: 1, - title: "Maison Lumen — Paper Light", - description: - "巴黎,2026 秋冬。Maison Lumen 以“Paper Light(纸光)”为题,将薄纱、宣纸与压褶工艺叠合成一种近乎透明的体积感。\n\n系列延续了工作室对“轻”的执念:肩线被刻意放低,廓形在行走中随风摆动,像被光穿透的纸。色彩仅保留骨白、炭灰与一抹雾蓝。\n\n这不是关于廓形的宣言,而是关于 material 的克制——用最少的手段,制造最大的呼吸感。", - created_at: 1711948800, - updated_at: 1711948800, - year: 2026, - source_url: "https://example.com/runway/maison-lumen-paper-light", - brand_id: 12, - brand_name: "Maison Lumen", - images: [ - { id: 1, image: "https://picsum.photos/seed/art1/1200/1500", name: "Look 01", sort_order: 1 }, - { id: 2, image: "https://picsum.photos/seed/art2/1200/1500", name: "Look 02", sort_order: 2 }, - { id: 3, image: "https://picsum.photos/seed/art3/1200/1500", name: "Look 03", sort_order: 3 }, - { id: 4, image: "https://picsum.photos/seed/art4/1200/1500", name: "Look 04", sort_order: 4 }, - ], -} +
-const fmt = (ts: number) => { - const d = new Date(ts * 1000) - const y = d.getFullYear() - const m = String(d.getMonth() + 1).padStart(2, "0") - const day = String(d.getDate()).padStart(2, "0") - return `${y}.${m}.${day}` -} + +
+
+ Loading Article... +
-const body = article.description.split("\n\n") ---- + +
+

+ + ← Back to Index + +
-
+ +
← Index - Runway · {article.brand_name} + Runway ·
-

- {article.title} -

+

- {fmt(article.created_at)} - {article.year} - Source ↗ + + +
@@ -55,28 +47,36 @@ const body = article.description.split("\n\n")
Report
-
- {body.map((p) =>

{p}

)} +
+
-
+
- Gallery + Gallery
- +
-
@@ -85,376 +85,230 @@ const body = article.description.split("\n\n")
- - @@ -180,7 +194,7 @@ if (!yearChips.length) yearChips = yearSeed @@ -221,59 +235,6 @@ if (!yearChips.length) yearChips = yearSeed - - -
-
-
-
-

全部品牌

- -
- -
- -
-
-
热门推荐
-
-
    - -
  • 未找到匹配的品牌
  • -
-
- -
-
- @@ -325,6 +286,10 @@ if (!yearChips.length) yearChips = yearSeed .showsaside { @apply flex-none w-[240px] bg-white sticky top-5 max-h-[calc(100vh-40px)] rounded-none transition-[flex-basis] duration-250 ease-in-out flex flex-col max-md:static max-md:max-h-none max-md:w-full; } + html.showsaside-collapsed .showsaside, + .showsaside.is-collapsed { + @apply flex-none w-[44px]; + } .showsaside-head { @apply flex items-center justify-between p-[14px_14px_12px] border-b border-black shrink-0; @@ -332,10 +297,25 @@ if (!yearChips.length) yearChips = yearSeed .showsaside-h { @apply text-[11px] tracking-[0.26em] uppercase font-bold m-0 leading-none transition-opacity duration-200; } + html.showsaside-collapsed .showsaside-h, + .showsaside.is-collapsed .showsaside-h { + @apply opacity-0 pointer-events-none w-0 overflow-hidden; + } + + .showsaside-toggle { + @apply appearance-none bg-white border-[1.5px] border-black w-[22px] h-[22px] inline-flex items-center justify-center cursor-pointer rounded-none text-black p-0 transition-transform duration-250 ease-in-out hover:bg-black hover:text-white; + } + html.showsaside-collapsed .showsaside-toggle, + .showsaside.is-collapsed .showsaside-toggle { + @apply ml-auto rotate-180; + } .showsaside-body { @apply p-[14px_14px_18px] overflow-y-auto flex-1 min-h-0 [scrollbar-width:thin] [scrollbar-color:#ccc_#fff]; } + html.showsaside-collapsed .showsaside-body { + @apply hidden; + } .showsg { @apply border-t border-[#e6e6e6] py-[12px] pb-[6px] first-of-type:border-t-0 first-of-type:pt-1; @@ -499,62 +479,11 @@ if (!yearChips.length) yearChips = yearSeed @keyframes hbxProg { 0% { left: -38%; } 100% { left: 100%; } } @keyframes hbxShim { 0%, 100% { opacity: .85; } 50% { opacity: .55; } } - /* ===== 品牌筛选弹窗 ===== */ - .showsmodal { - @apply fixed inset-0 z-[60] flex items-center justify-center p-[16px]; - } - .showsmodal-mask { - @apply absolute inset-0 bg-black/45; - } - .showsmodal-panel { - @apply relative w-full max-w-[680px] max-h-[86vh] bg-white flex flex-col border border-black; - } - .showsmodal-head { - @apply flex items-center justify-between px-[16px] py-[13px] border-b border-black shrink-0; - } - .showsmodal-head h3 { - @apply m-0 text-[13px] tracking-[0.2em] uppercase font-bold; - } - .showsmodal-x { - @apply appearance-none bg-white border border-black w-[24px] h-[24px] inline-flex items-center justify-center cursor-pointer text-[12px] leading-none; - } - .showsmodal-x:hover { @apply bg-black text-white; } - .showsmodal-search { @apply px-[16px] pt-[12px] pb-[8px] shrink-0; } - .showsmodal-input { - @apply w-full border border-black px-[10px] py-[8px] text-[13px] outline-none; - } - .showsmodal-input:focus { @apply ring-1 ring-black; } - .showsmodal-az { - @apply flex flex-wrap gap-[4px] px-[16px] pb-[10px] border-b border-[#e6e6e6] shrink-0; - } - .showsmodal-az .az { - @apply appearance-none bg-white border border-[#ccc] w-[22px] h-[22px] text-[11px] cursor-pointer leading-none; - } - .showsmodal-az .az.active { @apply bg-black text-white border-black; } - .showsmodal-body { @apply flex-1 min-h-0 overflow-y-auto px-[16px] py-[8px]; } - .showsmodal-hint { - @apply text-[11px] tracking-[0.2em] uppercase text-[#888] py-[6px] pb-[8px]; - } - .showsmodal-loading { @apply flex justify-center py-[28px] text-[#bdbdbd]; } - .showsmodal-list { @apply list-none m-0 p-0; } - .showsmodal-row { - @apply flex items-center gap-[8px] w-full cursor-pointer py-[7px] border-b border-[#f0f0f0] text-[13px]; - } - .showsmodal-name { @apply flex-1 truncate; } - .showsmodal-ct { @apply text-[#999] text-[11px] ml-auto; } - .showsmodal-empty { @apply py-[28px] text-center text-[#999] text-[13px]; } - .showsmodal-foot { - @apply flex items-center justify-between px-[16px] py-[12px] border-t border-black shrink-0 text-[12px]; - } - .showsmodal-ok { - @apply appearance-none bg-black text-white border border-black px-[22px] py-[8px] cursor-pointer text-[12px] tracking-[0.1em]; - } -