hezarfen_landing
Clone
https://git.tahinli.com/archive/hezarfen_landing.git
0 watching0 forksTypeScript581.6 KiB94b1804Burak Boduroğlu2 months ago15 commits
| 1 | import { For } from "solid-js"; |
| 2 | import Reveal from "../Reveal"; |
| 3 | import { PixelCheck } from "../icons/pixel"; |
| 4 | import { t } from "~/i18n"; |
| 5 | |
| 6 | /** |
| 7 | * The animated pipeline: four stages, connected, with the loop back to |
| 8 | * analysis drawn underneath. |
| 9 | * |
| 10 | * The motion carries meaning rather than decoration — a dot travelling a |
| 11 | * connector is a record moving between stages, and the little drawing inside |
| 12 | * each stage animates the thing that stage does: marks landing, bars rising, |
| 13 | * an approval tick, cells filling. Everything is CSS keyframes on `hz-flow-*` |
| 14 | * classes, so `prefers-reduced-motion` switches the whole thing off in one |
| 15 | * rule and the page still reads as a diagram. |
| 16 | */ |
| 17 | export default function Pipeline() { |
| 18 | return ( |
| 19 | <div class="hz-flow" aria-label={t.how.flowLabel}> |
| 20 | <For each={t.how.stages}> |
| 21 | {(stage, i) => ( |
| 22 | <Reveal index={i()} class="hz-flow-item"> |
| 23 | <article class="hz-flow-card"> |
| 24 | <header> |
| 25 | <span class="hz-step-num">{stage.num}</span> |
| 26 | <h3 class="hz-h3">{stage.title}</h3> |
| 27 | <p class="hz-flow-sub">{stage.subtitle}</p> |
| 28 | </header> |
| 29 | |
| 30 | <div class="hz-flow-art" aria-hidden="true"> |
| 31 | <StageArt index={i()} /> |
| 32 | </div> |
| 33 | |
| 34 | <p class="hz-small">{stage.description}</p> |
| 35 | |
| 36 | <ul class="hz-checks"> |
| 37 | <For each={stage.bullets}> |
| 38 | {bullet => ( |
| 39 | <li> |
| 40 | <PixelCheck aria-hidden="true" /> |
| 41 | {bullet} |
| 42 | </li> |
| 43 | )} |
| 44 | </For> |
| 45 | </ul> |
| 46 | </article> |
| 47 | |
| 48 | {/* The connector belongs to the stage on its left, so the last |
| 49 | stage simply does not draw one. */} |
| 50 | <span class="hz-flow-link" aria-hidden="true" classList={{ "is-last": i() === 3 }}> |
| 51 | <i class="hz-flow-dot" /> |
| 52 | <i class="hz-flow-dot hz-flow-dot-b" /> |
| 53 | </span> |
| 54 | </Reveal> |
| 55 | )} |
| 56 | </For> |
| 57 | |
| 58 | {/* The feedback loop: usage becomes data again. */} |
| 59 | <div class="hz-flow-loop" aria-hidden="true"> |
| 60 | <span class="hz-flow-loop-line" /> |
| 61 | <span class="hz-flow-loop-label">{t.how.flowNote}</span> |
| 62 | </div> |
| 63 | </div> |
| 64 | ); |
| 65 | } |
| 66 | |
| 67 | /** The small drawing inside a stage card: one per stage, in order. */ |
| 68 | function StageArt(props: { index: number }) { |
| 69 | const grid = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; |
| 70 | |
| 71 | return ( |
| 72 | <svg viewBox="0 0 220 120" fill="none" shape-rendering="crispEdges" class="hz-illustration"> |
| 73 | {/* 01 — collection: answers landing on the sheet, option by option */} |
| 74 | {props.index === 0 && ( |
| 75 | <g> |
| 76 | <rect x={16} y={12} width={188} height={96} stroke="currentColor" stroke-width="2" /> |
| 77 | <For each={[0, 1, 2, 3]}> |
| 78 | {row => ( |
| 79 | <g> |
| 80 | <rect x={30} y={28 + row * 20} width={44} height={8} fill="currentColor" opacity="0.22" /> |
| 81 | <For each={[0, 1, 2, 3]}> |
| 82 | {col => ( |
| 83 | <rect |
| 84 | x={88 + col * 28} |
| 85 | y={26 + row * 20} |
| 86 | width={18} |
| 87 | height={12} |
| 88 | class={col === (row + 2) % 4 ? "hz-flow-mark" : undefined} |
| 89 | fill={col === (row + 2) % 4 ? "var(--brand)" : "currentColor"} |
| 90 | opacity={col === (row + 2) % 4 ? 1 : 0.14} |
| 91 | style={{ "animation-delay": `${row * 0.22}s` }} |
| 92 | /> |
| 93 | )} |
| 94 | </For> |
| 95 | </g> |
| 96 | )} |
| 97 | </For> |
| 98 | </g> |
| 99 | )} |
| 100 | |
| 101 | {/* 02 — analysis: topic mastery rising out of that sheet */} |
| 102 | {props.index === 1 && ( |
| 103 | <g> |
| 104 | <rect x={16} y={100} width={188} height={2} fill="currentColor" opacity="0.4" /> |
| 105 | <For each={[34, 56, 44, 72, 60, 88]}> |
| 106 | {(height, i) => ( |
| 107 | <rect |
| 108 | x={24 + i() * 31} |
| 109 | y={100 - height} |
| 110 | width={20} |
| 111 | height={height} |
| 112 | class="hz-flow-bar" |
| 113 | fill={i() >= 4 ? "var(--brand)" : "var(--brand-deep, #5dc9e2)"} |
| 114 | opacity={i() >= 4 ? 1 : 0.55} |
| 115 | style={{ "animation-delay": `${i() * 0.12}s` }} |
| 116 | /> |
| 117 | )} |
| 118 | </For> |
| 119 | </g> |
| 120 | )} |
| 121 | |
| 122 | {/* 03 — the plan, and the tick that lets it out */} |
| 123 | {props.index === 2 && ( |
| 124 | <g> |
| 125 | <rect x={16} y={12} width={132} height={96} stroke="currentColor" stroke-width="2" /> |
| 126 | <For each={[0, 1, 2, 3]}> |
| 127 | {row => ( |
| 128 | <g> |
| 129 | <rect x={30} y={26 + row * 20} width={60} height={9} fill="currentColor" opacity="0.18" /> |
| 130 | <rect |
| 131 | x={98} |
| 132 | y={26 + row * 20} |
| 133 | width={36} |
| 134 | height={9} |
| 135 | fill="var(--brand-deep, #5dc9e2)" |
| 136 | opacity="0.55" |
| 137 | /> |
| 138 | </g> |
| 139 | )} |
| 140 | </For> |
| 141 | <g class="hz-flow-stamp"> |
| 142 | <rect x={158} y={44} width={44} height={34} fill="var(--brand)" /> |
| 143 | <path |
| 144 | d="M167 61 l6 7 l12 -14" |
| 145 | stroke="#fff" |
| 146 | stroke-width="4" |
| 147 | fill="none" |
| 148 | shape-rendering="geometricPrecision" |
| 149 | /> |
| 150 | </g> |
| 151 | </g> |
| 152 | )} |
| 153 | |
| 154 | {/* 04 — four screens, each showing its own slice */} |
| 155 | {props.index === 3 && ( |
| 156 | <g> |
| 157 | <For each={grid}> |
| 158 | {(_, i) => { |
| 159 | const col = i() % 4; |
| 160 | const row = Math.floor(i() / 4); |
| 161 | // Only the lit cells animate: the keyframe ends on `opacity: 1`, |
| 162 | // so running it on a recessive cell would darken it to solid. |
| 163 | const lit = (col + row) % 3 === 0; |
| 164 | return ( |
| 165 | <rect |
| 166 | x={20 + col * 48} |
| 167 | y={18 + row * 34} |
| 168 | width={40} |
| 169 | height={26} |
| 170 | class={lit ? "hz-flow-cell" : undefined} |
| 171 | fill={lit ? "var(--brand)" : "currentColor"} |
| 172 | opacity={lit ? 1 : 0.14} |
| 173 | style={lit ? { "animation-delay": `${i() * 0.06}s` } : undefined} |
| 174 | /> |
| 175 | ); |
| 176 | }} |
| 177 | </For> |
| 178 | </g> |
| 179 | )} |
| 180 | </svg> |
| 181 | ); |
| 182 | } |