forge
Explore
Log in

Don't you dare go Hollow

hezarfen_landing

Clone
★ 0

0 watching0 forksTypeScript581.6 KiB94b1804Burak Boduroğlu2 months ago15 commits

edu.tsx223 lines, 7.3 KiBHistoryRawDownload
1import { For } from "solid-js";
2
3/**
4 * Education illustrations, drawn on a pixel grid.
5 *
6 * Every shape is an axis-aligned rectangle on a 4-unit grid with
7 * `shape-rendering: crispEdges`, so the drawings match the pixel icons rather
8 * than sitting beside them as a second, smoother style. Structure takes
9 * `currentColor`; only what the drawing is *about* takes the brand, so a
10 * panel never turns into a block of colour.
11 *
12 * They stand in where the product has no screen to show: a classroom, a
13 * weekly plan, a recorded lesson, a missing page. Where a real screen exists the page uses a
14 * screenshot instead (`ProductShot`), so none of these pretends to be the
15 * product's interface.
16 */
17type Props = { class?: string };
18
19const brand = "var(--dz-brand, #00add8)";
20const brandDeep = "var(--dz-brand-deep, #5dc9e2)";
21
22/** A 4-sided pixel border, drawn as four bars so the corners stay square. */
23function Frame(props: { x: number; y: number; w: number; h: number; t?: number; fill?: string }) {
24 const t = props.t ?? 4;
25 return (
26 <g fill={props.fill ?? "currentColor"}>
27 <rect x={props.x} y={props.y} width={props.w} height={t} />
28 <rect x={props.x} y={props.y + props.h - t} width={props.w} height={t} />
29 <rect x={props.x} y={props.y} width={t} height={props.h} />
30 <rect x={props.x + props.w - t} y={props.y} width={t} height={props.h} />
31 </g>
32 );
33}
34
35/**
36 * A board with the class's progress on it, a desk, a book stack and a piece of
37 * chalk. The bars are the one thing in brand — the data is the subject of the
38 * whole page.
39 */
40export function ClassroomIllustration(props: Props) {
41 const bars = [
42 { x: 52, h: 24, fill: brandDeep },
43 { x: 80, h: 40, fill: brandDeep },
44 { x: 108, h: 56, fill: brand },
45 { x: 136, h: 76, fill: brand },
46 ];
47
48 return (
49 <svg
50 viewBox="0 0 260 200"
51 fill="none"
52 role="img"
53 aria-label="Tahtada yükselen kazanım grafiği"
54 shape-rendering="crispEdges"
55 class={props.class}
56 >
57 {/* Board */}
58 <Frame x={24} y={16} w={196} h={124} />
59 {/* Chalk baseline and the bars standing on it */}
60 <rect x={40} y={124} width={164} height={4} fill="currentColor" opacity="0.5" />
61 <For each={bars}>
62 {bar => <rect x={bar.x} y={124 - bar.h} width={20} height={bar.h} fill={bar.fill} />}
63 </For>
64 {/* Written lines, top left: the lesson the bars came from */}
65 <g fill="currentColor" opacity="0.45">
66 <rect x={40} y={32} width={56} height={4} />
67 <rect x={40} y={44} width={36} height={4} />
68 </g>
69 {/* Desk */}
70 <g fill="currentColor">
71 <rect x={12} y={152} width={236} height={6} />
72 <rect x={36} y={158} width={6} height={26} />
73 <rect x={218} y={158} width={6} height={26} />
74 </g>
75 {/* Book stack on the desk */}
76 <g>
77 <rect x={60} y={140} width={48} height={6} fill={brand} />
78 <rect x={64} y={146} width={40} height={6} fill="currentColor" opacity="0.55" />
79 </g>
80 {/* Chalk */}
81 <rect x={168} y={142} width={26} height={6} fill="currentColor" opacity="0.75" />
82 </svg>
83 );
84}
85
86/**
87 * Hezarfen Zekâ: a week of study, laid out as a grid and filled in by what
88 * the data says. The arrow is the plan updating itself when new data lands.
89 */
90export function StudyPlanIllustration(props: Props) {
91 const cells = [
92 [1, 0, 2, 0, 1],
93 [0, 2, 0, 1, 0],
94 [2, 0, 1, 0, 2],
95 ];
96
97 return (
98 <svg
99 viewBox="0 0 260 200"
100 fill="none"
101 role="img"
102 aria-label="Haftalık kişisel çalışma programı"
103 shape-rendering="crispEdges"
104 class={props.class}
105 >
106 <Frame x={20} y={20} w={220} h={160} />
107 {/* Day headers */}
108 <For each={[0, 1, 2, 3, 4]}>
109 {day => <rect x={40 + day * 38} y={36} width={22} height={5} fill="currentColor" opacity="0.45" />}
110 </For>
111 {/* Plan cells: filled where there is work to do */}
112 <For each={cells}>
113 {(row, r) => (
114 <For each={row}>
115 {(cell, c) => (
116 <rect
117 x={40 + c() * 38}
118 y={56 + r() * 36}
119 width={26}
120 height={22}
121 fill={cell === 2 ? brand : cell === 1 ? brandDeep : "currentColor"}
122 opacity={cell === 0 ? 0.18 : 1}
123 />
124 )}
125 </For>
126 )}
127 </For>
128 {/* The plan climbing as new data arrives */}
129 <g fill={brand}>
130 <rect x={40} y={166} width={14} height={4} />
131 <rect x={54} y={160} width={14} height={4} />
132 <rect x={68} y={154} width={14} height={4} />
133 <rect x={82} y={148} width={14} height={4} />
134 <rect x={96} y={142} width={14} height={4} />
135 <rect x={104} y={134} width={6} height={8} />
136 <rect x={110} y={138} width={6} height={6} />
137 </g>
138 </svg>
139 );
140}
141
142/**
143 * Ses Atölyesi: a lesson page turning into sound, with the pause the content
144 * stops at to ask a question.
145 */
146export function AudioLessonIllustration(props: Props) {
147 const wave = [16, 28, 44, 24, 52, 36, 20, 40, 28, 16];
148
149 return (
150 <svg
151 viewBox="0 0 260 200"
152 fill="none"
153 role="img"
154 aria-label="Ders PDF'inden hazırlanan sesli ders"
155 shape-rendering="crispEdges"
156 class={props.class}
157 >
158 {/* The source page */}
159 <Frame x={20} y={28} w={84} h={116} />
160 <g fill="currentColor" opacity="0.4">
161 <rect x={34} y={48} width={48} height={5} />
162 <rect x={34} y={62} width={56} height={5} />
163 <rect x={34} y={76} width={40} height={5} />
164 <rect x={34} y={90} width={52} height={5} />
165 </g>
166 <rect x={34} y={112} width={30} height={8} fill={brandDeep} />
167
168 {/* Headphone arc, stepped rather than curved */}
169 <g fill="currentColor">
170 <rect x={148} y={36} width={56} height={6} />
171 <rect x={140} y={42} width={8} height={8} />
172 <rect x={204} y={42} width={8} height={8} />
173 <rect x={136} y={50} width={12} height={28} />
174 <rect x={204} y={50} width={12} height={28} />
175 </g>
176
177 {/* Waveform: the produced lesson */}
178 <For each={wave}>
179 {(height, i) => (
180 <rect
181 x={128 + i() * 12}
182 y={120 - height / 2}
183 width={6}
184 height={height}
185 fill={i() === 4 ? brand : brandDeep}
186 opacity={i() === 4 ? 1 : 0.55}
187 />
188 )}
189 </For>
190 {/* The DUR-CEVAPLA pause sitting in the middle of the take */}
191 <g fill={brand}>
192 <rect x={172} y={136} width={6} height={16} />
193 <rect x={182} y={136} width={6} height={16} />
194 </g>
195 </svg>
196 );
197}
198
199/** 404: a page that is not where it was. */
200export function MissingPageIllustration(props: Props) {
201 return (
202 <svg
203 viewBox="0 0 160 160"
204 fill="none"
205 role="img"
206 aria-label="Bulunamayan sayfa çizimi"
207 shape-rendering="crispEdges"
208 class={props.class}
209 >
210 <Frame x={28} y={20} w={104} h={120} />
211 <g fill="currentColor" opacity="0.35">
212 <rect x={44} y={44} width={56} height={6} />
213 <rect x={44} y={60} width={40} height={6} />
214 </g>
215 <g fill={brand}>
216 <rect x={60} y={84} width={24} height={8} />
217 <rect x={76} y={92} width={8} height={12} />
218 <rect x={68} y={104} width={16} height={8} />
219 <rect x={68} y={120} width={16} height={8} />
220 </g>
221 </svg>
222 );
223}