master @ 23 LINES
[ HISTORY ] [ UP ]
┌─ ASTRO ────────────────────────────────────────────────────────────────────┐
│ --- │
│ import Pre from "../Pre/Pre.astro"; │
│ import { FRAME_W, MOBILE_FRAME_W } from "../../lib/config"; │
│ import { layoutTimeline, type Props, type TimelineRow } from "./Timeline"; │
│ import "./Timeline.scss"; │
│ │
│ const { entries } = Astro.props as Props; │
│ │
│ const variants: [string, TimelineRow[]][] = [ │
│ ["frame-wide", layoutTimeline(entries, FRAME_W)], │
│ ["frame-narrow", layoutTimeline(entries, MOBILE_FRAME_W)], │
│ ]; │
│ --- │
│ {variants.map(([variant, rows]) => │
│ rows.map((r) => ( │
│ <Pre class={`${variant} timeline-row`}>{r.prefix}{ │
│ r.href ? <a class="timeline-link" href={r.href}>{r.text}</a> │
│ : r.soft ? <span class="timeline-soft">{r.text}</span> │
│ : r.text │
│ }</Pre> │
│ )) │
│ )} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ASTRO ──────────────────────────────┐
│ --- │
│ import Pre from "../Pre/Pre.astro"; │
│ import { FRAME_W, MOBILE_FRAME_W } from "../ │
│ ../lib/config"; │
│ import { layoutTimeline, type Props, type Ti │
│ melineRow } from "./Timeline"; │
│ import "./Timeline.scss"; │
│ │
│ const { entries } = Astro.props as Props; │
│ │
│ const variants: [string, TimelineRow[]][] = │
│ [ │
│ ["frame-wide", layoutTimeline(entries, FRA │
│ ME_W)], │
│ ["frame-narrow", layoutTimeline(entries, M │
│ OBILE_FRAME_W)], │
│ ]; │
│ --- │
│ {variants.map(([variant, rows]) => │
│ rows.map((r) => ( │
│ <Pre class={`${variant} timeline-row`}>{ │
│ r.prefix}{ │
│ r.href ? <a class="timeline-link" href │
│ ={r.href}>{r.text}</a> │
│ : r.soft ? <span class="timeline-soft" │
│ >{r.text}</span> │
│ : r.text │
│ }</Pre> │
│ )) │
│ )} │
└──────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET