@jant/core 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/bin/lib/site-snapshot.js +10 -0
  2. package/dist/{app-Gt7_skt6.js → app-CbOZ2Irh.js} +8704 -5180
  3. package/dist/client/.vite/manifest.json +125 -85
  4. package/dist/client/_assets/chunks/{confirm-D7GrwsCN.js → confirm-CMe01lne.js} +1 -1
  5. package/dist/client/_assets/chunks/{create-editor-5Y49x7h5.js → create-editor-hWapNE40.js} +26 -26
  6. package/dist/client/_assets/chunks/footnote-rail-9zwl6jtV.js +2 -0
  7. package/dist/client/_assets/chunks/{jant-locale-picker-DL6mIOT5.js → jant-locale-picker-2L4rkDaz.js} +1 -1
  8. package/dist/client/_assets/chunks/lit-Bw_voPoW.js +2 -0
  9. package/dist/client/_assets/chunks/preload-helper-Czpn1I53.js +1 -0
  10. package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +1 -0
  11. package/dist/client/_assets/chunks/{settings-paths-h6RjIe3C.js → settings-paths-BBVT8zKj.js} +1 -1
  12. package/dist/client/_assets/chunks/slug-format-BuCPjSrB.js +1 -0
  13. package/dist/client/_assets/chunks/sortable-list-DJXwkaOv.js +2 -0
  14. package/dist/client/_assets/chunks/types-DrYFqJH2.js +1 -0
  15. package/dist/client/_assets/chunks/{unsafe-html-B5ZEXaxg.js → unsafe-html-CWos3v6N.js} +1 -1
  16. package/dist/client/_assets/chunks/unsafe-svg-CUrgo4Xg.js +1 -0
  17. package/dist/client/_assets/client-BO8GOFfT.js +354 -0
  18. package/dist/client/_assets/client-D8Rrsd73.css +2 -0
  19. package/dist/client/_assets/client-auth-CsUGM718.js +859 -0
  20. package/dist/client/_assets/client-author-QPm1whbO.css +2 -0
  21. package/dist/client/_assets/client-compose-BB4U7Wz0.js +2004 -0
  22. package/dist/client/_assets/{client-manage-C1eDB1Rc.js → client-manage-CI9-eh-8.js} +176 -176
  23. package/dist/client/_assets/{client-settings-DIM44Zqh.js → client-settings-BnGPuqwc.js} +166 -166
  24. package/dist/client/_assets/client-share-0DICJjAc.css +1 -0
  25. package/dist/client/_assets/client-share-C59mOLJ1.js +149 -0
  26. package/dist/index.js +1 -1
  27. package/dist/node.js +3 -2
  28. package/package.json +2 -1
  29. package/src/app.tsx +9 -0
  30. package/src/client/components/compose-types.ts +1 -0
  31. package/src/client/components/jant-compose-dialog.ts +1 -0
  32. package/src/client/components/jant-compose-editor.ts +30 -0
  33. package/src/client/components/jant-compose-fullscreen.ts +1 -0
  34. package/src/client/components/jant-post-menu.ts +80 -13
  35. package/src/client/components/jant-share-dialog.ts +422 -0
  36. package/src/client/components/jant-share-menu.ts +188 -0
  37. package/src/client/compose-bridge.ts +61 -1
  38. package/src/client/feed-video-player.ts +6 -0
  39. package/src/client/lazy-entries.ts +21 -1
  40. package/src/client/post-menu-shared.ts +100 -0
  41. package/src/client/share-capture.ts +443 -0
  42. package/src/client/share-launch.ts +133 -0
  43. package/src/client/tiptap/bubble-menu.ts +25 -2
  44. package/src/client/tiptap/create-editor.ts +2 -0
  45. package/src/client/tiptap/extensions.ts +4 -0
  46. package/src/client/video-processor.ts +106 -52
  47. package/src/client/view-confirm.ts +108 -0
  48. package/src/client-share.ts +8 -0
  49. package/src/client.ts +2 -0
  50. package/src/db/migrations/0035_brainy_next_avengers.sql +9 -0
  51. package/src/db/migrations/0036_gorgeous_smasher.sql +7 -0
  52. package/src/db/migrations/meta/0035_snapshot.json +2877 -0
  53. package/src/db/migrations/meta/0036_snapshot.json +2924 -0
  54. package/src/db/migrations/meta/_journal.json +14 -0
  55. package/src/db/migrations/pg/0033_cute_magdalene.sql +10 -0
  56. package/src/db/migrations/pg/0034_material_agent_brand.sql +8 -0
  57. package/src/db/migrations/pg/meta/0033_snapshot.json +3719 -0
  58. package/src/db/migrations/pg/meta/0034_snapshot.json +3766 -0
  59. package/src/db/migrations/pg/meta/_journal.json +14 -0
  60. package/src/db/pg/schema.ts +40 -0
  61. package/src/db/schema.ts +61 -0
  62. package/src/i18n/locales/public/en.po +5 -0
  63. package/src/i18n/locales/public/en.ts +1 -1
  64. package/src/i18n/locales/public/zh-Hans.po +5 -0
  65. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  66. package/src/i18n/locales/public/zh-Hant.po +5 -0
  67. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  68. package/src/i18n/locales/settings/en.po +149 -0
  69. package/src/i18n/locales/settings/en.ts +1 -1
  70. package/src/i18n/locales/settings/zh-Hans.po +149 -0
  71. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  72. package/src/i18n/locales/settings/zh-Hant.po +149 -0
  73. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  74. package/src/lib/discover.ts +31 -0
  75. package/src/lib/env.ts +20 -0
  76. package/src/lib/github-app-state.ts +1 -1
  77. package/src/lib/github-app.ts +183 -1
  78. package/src/lib/markdown-manager.ts +129 -1
  79. package/src/lib/post-meta.ts +13 -3
  80. package/src/lib/referrer-aliases.ts +311 -0
  81. package/src/lib/render.tsx +10 -0
  82. package/src/lib/resolve-config.ts +14 -0
  83. package/src/lib/share-card.ts +653 -0
  84. package/src/lib/summary.ts +152 -54
  85. package/src/lib/tiptap-render.ts +1 -0
  86. package/src/lib/upload.ts +21 -1
  87. package/src/lib/version.ts +2 -0
  88. package/src/lib/video-playback.ts +55 -0
  89. package/src/lib/view-buffer.ts +201 -0
  90. package/src/lib/view-counting.ts +539 -0
  91. package/src/lib/view-token.ts +177 -0
  92. package/src/lib/view.ts +13 -1
  93. package/src/middleware/view-counter.ts +140 -0
  94. package/src/node/runtime.ts +4 -0
  95. package/src/preset.css +31 -14
  96. package/src/routes/api/media.ts +21 -3
  97. package/src/routes/auth/setup.tsx +37 -1
  98. package/src/routes/dash/settings.tsx +433 -168
  99. package/src/routes/pages/archive.tsx +1 -0
  100. package/src/routes/pages/collection.tsx +6 -0
  101. package/src/routes/pages/collections.tsx +1 -0
  102. package/src/routes/pages/featured.tsx +1 -0
  103. package/src/routes/pages/home.tsx +1 -0
  104. package/src/routes/pages/page.tsx +3 -0
  105. package/src/routes/pages/partials.tsx +23 -0
  106. package/src/routes/pages/smart-collection.tsx +2 -0
  107. package/src/routes/pages/subscribe.tsx +1 -0
  108. package/src/routes/view-confirm.ts +63 -0
  109. package/src/services/export-theme/assets/client-site.js +1 -1
  110. package/src/services/export-theme/styles/main.css +39 -21
  111. package/src/services/export.ts +2 -0
  112. package/src/services/index.ts +17 -0
  113. package/src/services/mcp.ts +31 -1
  114. package/src/services/media.ts +63 -0
  115. package/src/services/stats.ts +1130 -0
  116. package/src/style-share.css +16 -0
  117. package/src/styles/components-author.css +177 -0
  118. package/src/styles/components.css +25 -3
  119. package/src/styles/share.css +1103 -0
  120. package/src/styles/tokens.css +65 -30
  121. package/src/styles/ui.css +62 -13
  122. package/src/types/app-context.ts +9 -0
  123. package/src/types/bindings.ts +5 -0
  124. package/src/types/config.ts +54 -0
  125. package/src/types/views.ts +6 -0
  126. package/src/ui/compose/ComposeDialog.tsx +6 -0
  127. package/src/ui/dash/settings/SettingsRootContent.tsx +24 -6
  128. package/src/ui/dash/settings/StatsContent.tsx +855 -0
  129. package/src/ui/font-themes.ts +39 -6
  130. package/src/ui/layouts/BaseLayout.tsx +11 -2
  131. package/src/ui/layouts/SiteLayout.tsx +9 -3
  132. package/src/ui/share/ShareCard.tsx +298 -0
  133. package/src/ui/shared/Icon.tsx +23 -3
  134. package/src/ui/shared/MediaGallery.tsx +31 -4
  135. package/src/ui/shared/PostFooter.tsx +20 -4
  136. package/src/ui/shared/icon-collector.ts +28 -0
  137. package/src/ui/shared/post-article-attributes.ts +3 -0
  138. package/dist/client/_assets/chunks/footnote-rail-BJwswtVQ.js +0 -1
  139. package/dist/client/_assets/chunks/lit-DW8VmJAT.js +0 -2
  140. package/dist/client/_assets/chunks/slug-format-Dsi0e9Xn.js +0 -1
  141. package/dist/client/_assets/chunks/sortable-list-DWNKv782.js +0 -2
  142. package/dist/client/_assets/chunks/types-D5iF3H1a.js +0 -1
  143. package/dist/client/_assets/chunks/unsafe-svg-DTZZEvLU.js +0 -2
  144. package/dist/client/_assets/client-BaqmpPQ-.css +0 -2
  145. package/dist/client/_assets/client-C6melOtG.js +0 -296
  146. package/dist/client/_assets/client-auth-Ccq8kSqq.js +0 -828
  147. package/dist/client/_assets/client-author-CGVvrNZ8.css +0 -2
  148. package/dist/client/_assets/client-compose-oxzPb3SS.js +0 -2004
@@ -0,0 +1,1103 @@
1
+ /*
2
+ * "Share as image": the dialog and the card it captures.
3
+ *
4
+ * Its own stylesheet, `client-share.css`, linked by `client/share-launch.ts`
5
+ * when a post menu that offers sharing opens, for a reader as for the
6
+ * author. Too rarely used for the render-blocking `client.css`, and readers
7
+ * never load `client-author.css`.
8
+ */
9
+
10
+ @layer components {
11
+ /*
12
+ * Share card: the post as "Share as image" paints it — a sheet of paper on
13
+ * a mat tinted from the theme, 540 px wide, captured at 2x. The mat is what
14
+ * makes it read as a mounted card on the white of a chat or a feed, where a
15
+ * full-bleed page would have no edge.
16
+ *
17
+ * A picture of fixed width, so its type is in px rather than on the
18
+ * reading scale, which shrinks on narrow screens and would make the same
19
+ * post a different picture on every device. Colors and font families come
20
+ * from the theme: the mat is the theme's accent mixed into the page, the
21
+ * paper is the page (lifted in dark mode, where a shadow would not show,
22
+ * and edged instead).
23
+ */
24
+ .share-card,
25
+ .share-dialog-print {
26
+ --share-card-mat: color-mix(
27
+ in oklch,
28
+ var(--site-accent) 24%,
29
+ var(--site-page-bg)
30
+ );
31
+ --share-card-paper: var(--site-raised-bg);
32
+ --share-card-paper-edge: transparent;
33
+ --share-card-paper-shadow:
34
+ 0 1px 2px rgb(0 0 0 / 0.05), 0 18px 40px -18px rgb(0 0 0 / 0.35);
35
+ }
36
+
37
+ .share-card {
38
+ box-sizing: border-box;
39
+ width: 540px;
40
+ padding: 40px 34px;
41
+ background: var(--share-card-mat);
42
+ color: var(--site-text-primary);
43
+ font-family: var(--font-body);
44
+ -webkit-font-smoothing: antialiased;
45
+ overflow-wrap: anywhere;
46
+ }
47
+
48
+ /* Dark: a little accent in a deep mat, paper lifted above it. */
49
+ @media (prefers-color-scheme: dark) {
50
+ :root:not([data-theme-mode="light"]) :is(.share-card, .share-dialog-print) {
51
+ --share-card-mat: color-mix(
52
+ in oklch,
53
+ var(--site-accent) 8%,
54
+ var(--site-page-bg)
55
+ );
56
+ --share-card-paper-edge: var(--site-raised-border);
57
+ --share-card-paper-shadow: none;
58
+ }
59
+ }
60
+
61
+ :root[data-theme-mode="dark"] :is(.share-card, .share-dialog-print) {
62
+ --share-card-mat: color-mix(
63
+ in oklch,
64
+ var(--site-accent) 8%,
65
+ var(--site-page-bg)
66
+ );
67
+ --share-card-paper-edge: var(--site-raised-border);
68
+ --share-card-paper-shadow: none;
69
+ }
70
+
71
+ .share-card-paper {
72
+ overflow: hidden;
73
+ border: 1px solid var(--share-card-paper-edge);
74
+ border-radius: 16px;
75
+ background: var(--share-card-paper);
76
+ box-shadow: var(--share-card-paper-shadow);
77
+ }
78
+
79
+ .share-card-inner {
80
+ padding: 30px 32px 24px;
81
+ }
82
+
83
+ .share-card-images + .share-card-inner {
84
+ padding-top: 24px;
85
+ }
86
+
87
+ /* Images run across the top of the paper. One keeps its own shape, as
88
+ the post shows it, cut from the bottom only when it is taller than 4:5
89
+ so the text still has room; two stand side by side; three are one wide
90
+ over two; four are two by two, the last counting any more. */
91
+ .share-card-images {
92
+ display: grid;
93
+ grid-template-columns: 1fr 1fr;
94
+ gap: 3px;
95
+ }
96
+
97
+ .share-card-images[data-count="1"] {
98
+ grid-template-columns: 1fr;
99
+ container-type: inline-size;
100
+ }
101
+
102
+ .share-card-image {
103
+ position: relative;
104
+ aspect-ratio: 1;
105
+ overflow: hidden;
106
+ background: var(--site-subtle-bg);
107
+ }
108
+
109
+ .share-card-images[data-count="1"] .share-card-image {
110
+ aspect-ratio: auto;
111
+ }
112
+
113
+ /* Its width and height attributes, or the loaded image, give the shape. */
114
+ .share-card-images[data-count="1"] img {
115
+ height: auto;
116
+ max-height: 125cqi;
117
+ object-position: top;
118
+ }
119
+
120
+ .share-card-images[data-count="2"] .share-card-image {
121
+ aspect-ratio: 4 / 5;
122
+ }
123
+
124
+ .share-card-images[data-count="3"] .share-card-image:first-child {
125
+ grid-column: 1 / -1;
126
+ aspect-ratio: 2;
127
+ }
128
+
129
+ .share-card-image img {
130
+ display: block;
131
+ width: 100%;
132
+ height: 100%;
133
+ object-fit: cover;
134
+ }
135
+
136
+ .share-card-play {
137
+ position: absolute;
138
+ inset: 0;
139
+ display: grid;
140
+ place-items: center;
141
+ width: 56px;
142
+ height: 56px;
143
+ margin: auto;
144
+ border-radius: 50%;
145
+ background: color-mix(in srgb, var(--foreground) 45%, transparent);
146
+ color: var(--background);
147
+ }
148
+
149
+ .share-card-play svg {
150
+ width: 24px;
151
+ height: 24px;
152
+ margin-left: 3px;
153
+ }
154
+
155
+ .share-card-more-images {
156
+ position: absolute;
157
+ inset: 0;
158
+ display: grid;
159
+ place-items: center;
160
+ background: color-mix(in srgb, var(--foreground) 55%, transparent);
161
+ color: var(--background);
162
+ font-size: 28px;
163
+ font-weight: var(--fw-semibold);
164
+ }
165
+
166
+ .share-card-date {
167
+ font-family: var(--font-ui);
168
+ font-size: 12.5px;
169
+ font-weight: var(--fw-medium);
170
+ line-height: 1.4;
171
+ letter-spacing: 0.04em;
172
+ color: var(--site-text-secondary);
173
+ }
174
+
175
+ .share-card-title {
176
+ margin: 14px 0 16px;
177
+ font-family: var(--font-heading);
178
+ font-size: 30px;
179
+ font-weight: var(--type-heading-weight);
180
+ line-height: 1.3;
181
+ color: var(--site-reading-title);
182
+ }
183
+
184
+ .share-card-body {
185
+ font-size: 17.5px;
186
+ line-height: 1.85;
187
+ color: var(--site-reading-body);
188
+ }
189
+
190
+ /* CJK wants the open leading; Latin text reads better a little closer. */
191
+ .share-card:not(:lang(zh), :lang(ja), :lang(ko)) .share-card-body {
192
+ line-height: 1.7;
193
+ }
194
+
195
+ .share-card-date + .share-card-body {
196
+ margin-top: 14px;
197
+ }
198
+
199
+ .share-card-body > :first-child {
200
+ margin-top: 0;
201
+ }
202
+
203
+ .share-card-body > :last-child {
204
+ margin-bottom: 0;
205
+ }
206
+
207
+ .share-card-body :is(p, ul, ol, pre, table) {
208
+ margin: 0 0 14px;
209
+ }
210
+
211
+ .share-card-body :is(ul, ol) {
212
+ padding-left: 1.3em;
213
+ }
214
+
215
+ .share-card-body ul {
216
+ list-style: disc;
217
+ }
218
+
219
+ .share-card-body ol {
220
+ list-style: decimal;
221
+ }
222
+
223
+ /* An item's spacing stays inside the list. snapdom fixes each item's
224
+ height in its copy, so a margin that collapses out through an item's
225
+ edge on the page would be gone from the picture. */
226
+ .share-card-body li > * {
227
+ margin-bottom: 8px;
228
+ }
229
+
230
+ .share-card-body li > :last-child {
231
+ margin-bottom: 0;
232
+ }
233
+
234
+ .share-card-body li + li {
235
+ margin-top: 8px;
236
+ }
237
+
238
+ .share-card-body :is(h1, h2, h3, h4, h5, h6) {
239
+ margin: 22px 0 8px;
240
+ font-family: var(--font-heading);
241
+ font-size: 20px;
242
+ font-weight: var(--type-heading-weight);
243
+ line-height: 1.4;
244
+ color: var(--site-reading-heading);
245
+ }
246
+
247
+ .share-card-body blockquote {
248
+ margin: 16px 0;
249
+ padding-left: 14px;
250
+ border-left: 2px solid var(--site-divider);
251
+ font-family: var(--font-blockquote);
252
+ color: var(--site-reading-quote);
253
+ }
254
+
255
+ .share-card-body a {
256
+ color: inherit;
257
+ text-decoration: underline;
258
+ text-decoration-color: var(--site-divider);
259
+ text-underline-offset: 3px;
260
+ }
261
+
262
+ .share-card-body :is(code, pre) {
263
+ font-family: var(--font-mono);
264
+ font-size: 0.9em;
265
+ }
266
+
267
+ .share-card-body pre {
268
+ padding: 12px 14px;
269
+ border-radius: var(--media-radius);
270
+ background: var(--site-subtle-bg);
271
+ white-space: pre-wrap;
272
+ }
273
+
274
+ /* Footnotes point at notes the card does not carry. */
275
+ .share-card-body :is(.footnote-ref, .footnote-endnotes) {
276
+ display: none;
277
+ }
278
+
279
+ /* The summary stops short of the post: its last two lines fade into the
280
+ paper, as at a cut, and the way on is the QR code. A short summary fades
281
+ its lower half, so a line or two stays readable. */
282
+ .share-card-body.has-more {
283
+ position: relative;
284
+ }
285
+
286
+ .share-card-body.has-more::after {
287
+ content: "";
288
+ position: absolute;
289
+ right: 0;
290
+ bottom: 0;
291
+ left: 0;
292
+ height: min(2lh, 50%);
293
+ background: linear-gradient(
294
+ to bottom,
295
+ transparent,
296
+ var(--share-card-paper)
297
+ );
298
+ }
299
+
300
+ /* A body the capture cut brings its own fade. */
301
+ .share-card-body.is-cut::after {
302
+ content: none;
303
+ }
304
+
305
+ /* The same, for a post with no words to fade. */
306
+ .share-card-more {
307
+ margin-top: 6px;
308
+ font-family: var(--font-heading);
309
+ font-size: 18px;
310
+ line-height: 1;
311
+ letter-spacing: 0.2em;
312
+ color: var(--site-text-secondary);
313
+ }
314
+
315
+ .share-card-link {
316
+ margin-top: 18px;
317
+ }
318
+
319
+ .share-card-link-domain {
320
+ display: flex;
321
+ align-items: center;
322
+ gap: 7px;
323
+ font-family: var(--font-ui);
324
+ font-size: 13.5px;
325
+ font-weight: var(--fw-medium);
326
+ line-height: 1.4;
327
+ color: var(--site-text-secondary);
328
+ }
329
+
330
+ .share-card-link-domain svg {
331
+ flex: none;
332
+ width: 14px;
333
+ height: 14px;
334
+ }
335
+
336
+ .share-card-link-title {
337
+ margin: 10px 0 0;
338
+ font-family: var(--font-heading);
339
+ font-size: 32px;
340
+ font-weight: var(--type-heading-weight);
341
+ line-height: 1.25;
342
+ color: var(--site-reading-title);
343
+ }
344
+
345
+ .share-card-link + .share-card-body {
346
+ margin-top: 16px;
347
+ }
348
+
349
+ .share-card-quote {
350
+ margin: 20px 0 0;
351
+ }
352
+
353
+ .share-card-quote-mark {
354
+ width: 36px;
355
+ color: color-mix(in oklch, var(--site-accent) 30%, var(--share-card-paper));
356
+ }
357
+
358
+ /* Set by length: a line gets room to be large, a paragraph stays even. */
359
+ .share-card-quote-text {
360
+ margin: 16px 0 0;
361
+ font-family: var(--font-serif);
362
+ font-size: 25px;
363
+ line-height: 1.75;
364
+ letter-spacing: 0.01em;
365
+ white-space: pre-line;
366
+ color: var(--site-reading-title);
367
+ }
368
+
369
+ .share-card-quote-text[data-size="short"] {
370
+ font-size: 29px;
371
+ line-height: 1.65;
372
+ }
373
+
374
+ .share-card-quote-text[data-size="long"] {
375
+ font-size: 21px;
376
+ line-height: 1.85;
377
+ }
378
+
379
+ .share-card-quote-source {
380
+ display: flex;
381
+ align-items: center;
382
+ gap: 10px;
383
+ margin-top: 18px;
384
+ font-family: var(--font-ui);
385
+ font-size: 14px;
386
+ line-height: 1.4;
387
+ color: var(--site-text-secondary);
388
+ }
389
+
390
+ .share-card-quote-source::before {
391
+ content: "";
392
+ flex: none;
393
+ width: 18px;
394
+ height: 1px;
395
+ background: currentColor;
396
+ opacity: 0.6;
397
+ }
398
+
399
+ /* The author's own words under a quote: quieter than what they quote. */
400
+ .share-card-quote + .share-card-body {
401
+ margin-top: 26px;
402
+ font-size: 16px;
403
+ line-height: 1.8;
404
+ color: var(--site-text-secondary);
405
+ }
406
+
407
+ /* Files a picture cannot show, listed like a reading list: a slip with
408
+ the format on it, the name, and how much there is. */
409
+ .share-card-files {
410
+ display: grid;
411
+ gap: 10px;
412
+ margin: 22px 0 0;
413
+ padding: 0;
414
+ list-style: none;
415
+ }
416
+
417
+ .share-card-file {
418
+ display: flex;
419
+ align-items: center;
420
+ gap: 14px;
421
+ padding: 12px 14px;
422
+ border-radius: 12px;
423
+ background: var(--site-subtle-bg);
424
+ }
425
+
426
+ .share-card-file-format {
427
+ display: grid;
428
+ flex: none;
429
+ place-items: center;
430
+ width: 40px;
431
+ height: 50px;
432
+ border: 1px solid var(--site-column-outline);
433
+ border-radius: 5px;
434
+ background: var(--share-card-paper);
435
+ color: color-mix(
436
+ in oklch,
437
+ var(--site-accent) 70%,
438
+ var(--site-text-primary)
439
+ );
440
+ font-family: var(--font-ui);
441
+ font-size: 10.5px;
442
+ font-weight: var(--fw-semibold);
443
+ letter-spacing: 0.06em;
444
+ }
445
+
446
+ .share-card-file-text {
447
+ display: grid;
448
+ gap: 2px;
449
+ min-width: 0;
450
+ }
451
+
452
+ .share-card-file-title {
453
+ display: -webkit-box;
454
+ overflow: hidden;
455
+ -webkit-box-orient: vertical;
456
+ -webkit-line-clamp: 2;
457
+ font-size: 15.5px;
458
+ font-weight: var(--fw-medium);
459
+ line-height: 1.4;
460
+ color: var(--site-text-primary);
461
+ }
462
+
463
+ /* An attached text is titled by its opening words; set them as words. */
464
+ .share-card-file[data-kind="text"] .share-card-file-title {
465
+ font-family: var(--font-serif);
466
+ font-weight: normal;
467
+ }
468
+
469
+ .share-card-file-meta {
470
+ font-family: var(--font-ui);
471
+ font-size: 12.5px;
472
+ line-height: 1.4;
473
+ color: var(--site-text-secondary);
474
+ }
475
+
476
+ .share-card-file-more {
477
+ padding-left: 4px;
478
+ font-family: var(--font-ui);
479
+ font-size: 13px;
480
+ color: var(--site-text-secondary);
481
+ }
482
+
483
+ /* A post in its Thread, on the rail the timeline draws through a Thread:
484
+ the Thread's first post in a line or two, the posts between folded to
485
+ a few dots on the rail, the post itself with the accent dot, and one
486
+ line of the post after, the rail running on past it.
487
+ The rail is drawn per post, so it can stop at the shared post's dot when
488
+ nothing follows; each post sets where its dot sits, on its first line.
489
+ The context fades its words, not the rail. */
490
+ .share-card-thread {
491
+ /* A step past the timeline's threadline: in a picture the rail is all
492
+ that says these posts are one Thread, and on the lifted dark paper
493
+ the plain line all but disappears. */
494
+ --share-card-rail-color: color-mix(
495
+ in oklch,
496
+ var(--site-threadline),
497
+ var(--site-text-secondary) 30%
498
+ );
499
+ --share-card-rail-x: 4px;
500
+ --share-card-rail-width: 1.5px;
501
+ --share-card-dot-size: 7px;
502
+ }
503
+
504
+ .share-card-thread-item {
505
+ --share-card-dot-y: 11px;
506
+ /* How far the rail stays clear of a dot, on either side. */
507
+ --share-card-dot-clearance: calc(var(--share-card-dot-size) / 2 + 4px);
508
+
509
+ position: relative;
510
+ padding-left: 26px;
511
+ }
512
+
513
+ /* The rail breaks around the dot rather than running under a halo: the
514
+ capture can't use box-shadow (see `.share-card-host[data-capturing]`).
515
+ `--share-card-rail-dot-at` is where the dot sits on this rail. */
516
+ .share-card-thread-item::after {
517
+ --share-card-rail-dot-at: var(--share-card-dot-y);
518
+
519
+ content: "";
520
+ position: absolute;
521
+ top: 0;
522
+ bottom: 0;
523
+ left: calc(var(--share-card-rail-x) - var(--share-card-rail-width) / 2);
524
+ width: var(--share-card-rail-width);
525
+ background: linear-gradient(
526
+ to bottom,
527
+ var(--share-card-rail-color) 0
528
+ calc(var(--share-card-rail-dot-at) - var(--share-card-dot-clearance)),
529
+ transparent 0
530
+ calc(var(--share-card-rail-dot-at) + var(--share-card-dot-clearance)),
531
+ var(--share-card-rail-color) 0
532
+ );
533
+ }
534
+
535
+ .share-card-thread-item:first-child::after {
536
+ --share-card-rail-dot-at: 0px;
537
+
538
+ top: var(--share-card-dot-y);
539
+ }
540
+
541
+ .share-card-thread-item:last-child::after {
542
+ bottom: calc(100% - var(--share-card-dot-y));
543
+ }
544
+
545
+ .share-card-thread-item::before {
546
+ content: "";
547
+ position: absolute;
548
+ z-index: 1;
549
+ top: calc(var(--share-card-dot-y) - var(--share-card-dot-size) / 2);
550
+ left: calc(var(--share-card-rail-x) - var(--share-card-dot-size) / 2);
551
+ width: var(--share-card-dot-size);
552
+ height: var(--share-card-dot-size);
553
+ border-radius: 50%;
554
+ background: var(--share-card-rail-color);
555
+ }
556
+
557
+ /* The shared post: the accent dot, ringed, as the timeline marks the post
558
+ a view is about. The ring is a border, 2px clear of the dot. */
559
+ .share-card-thread-current {
560
+ --share-card-dot-y: 8.75px;
561
+ --share-card-dot-clearance: calc(var(--share-card-dot-size) / 2 + 6px);
562
+ }
563
+
564
+ .share-card-thread-current::before {
565
+ top: calc(var(--share-card-dot-y) - var(--share-card-dot-size) / 2 - 4px);
566
+ left: calc(var(--share-card-rail-x) - var(--share-card-dot-size) / 2 - 4px);
567
+ width: calc(var(--share-card-dot-size) + 8px);
568
+ height: calc(var(--share-card-dot-size) + 8px);
569
+ padding: 2px;
570
+ border: 2px solid var(--site-thread-dot-ring);
571
+ background: color-mix(
572
+ in srgb,
573
+ var(--site-accent) 90%,
574
+ var(--share-card-rail-color)
575
+ );
576
+ background-clip: content-box;
577
+ }
578
+
579
+ .share-card-thread-current .share-card-images {
580
+ margin-top: 20px;
581
+ overflow: hidden;
582
+ border-radius: 10px;
583
+ }
584
+
585
+ .share-card-thread-position {
586
+ margin-left: 10px;
587
+ color: color-mix(in srgb, var(--site-text-secondary) 75%, transparent);
588
+ }
589
+
590
+ .share-card-context {
591
+ min-height: 25px;
592
+ }
593
+
594
+ /* Quieter than the shared post, but read at a glance: the fading is left
595
+ to the rail's two ends, never laid over the words. */
596
+ .share-card-context > * {
597
+ opacity: 0.6;
598
+ }
599
+
600
+ .share-card-context-title,
601
+ .share-card-context-body,
602
+ .share-card-context-source {
603
+ display: block;
604
+ overflow: hidden;
605
+ white-space: nowrap;
606
+ text-overflow: ellipsis;
607
+ }
608
+
609
+ /* A title set apart from the words under it, the way a post leads with
610
+ one: the heading face, a step larger, a little air before the text. */
611
+ .share-card-context-title {
612
+ font-family: var(--font-heading);
613
+ font-size: 16.5px;
614
+ font-weight: var(--type-heading-weight);
615
+ line-height: 25px;
616
+ }
617
+
618
+ .share-card-context-body {
619
+ font-size: 14.5px;
620
+ line-height: 25px;
621
+ }
622
+
623
+ .share-card-context-title + .share-card-context-body {
624
+ margin-top: 6px;
625
+ }
626
+
627
+ /* A quote reads as one: its words in the quote face behind a rule, as
628
+ the site sets a blockquote, and who said it under them, as the quote
629
+ card does. */
630
+ .share-card-context[data-format="quote"] .share-card-context-body {
631
+ padding-left: 12px;
632
+ border-left: 2px solid var(--share-card-rail-color);
633
+ font-family: var(--font-blockquote);
634
+ }
635
+
636
+ .share-card-context-source {
637
+ margin-top: 6px;
638
+ font-family: var(--font-ui);
639
+ font-size: 12.5px;
640
+ line-height: 18px;
641
+ color: var(--site-text-secondary);
642
+ }
643
+
644
+ .share-card-context-source::before {
645
+ content: "";
646
+ display: inline-block;
647
+ width: 14px;
648
+ height: 1px;
649
+ margin-right: 8px;
650
+ vertical-align: middle;
651
+ background: currentColor;
652
+ opacity: 0.6;
653
+ }
654
+
655
+ /* A wordless post shows its images, as the timeline's context does: a
656
+ row of tiles big enough to see what they are, one alone at 4:3. */
657
+ .share-card-context-images {
658
+ display: flex;
659
+ gap: 6px;
660
+ }
661
+
662
+ .share-card-context-image {
663
+ position: relative;
664
+ flex: none;
665
+ width: 120px;
666
+ height: 120px;
667
+ overflow: hidden;
668
+ border-radius: 10px;
669
+ }
670
+
671
+ .share-card-context-images[data-count="1"] .share-card-context-image {
672
+ width: 160px;
673
+ }
674
+
675
+ .share-card-context-image img {
676
+ display: block;
677
+ width: 100%;
678
+ height: 100%;
679
+ object-fit: cover;
680
+ }
681
+
682
+ .share-card-context-image .share-card-play {
683
+ width: 34px;
684
+ height: 34px;
685
+ }
686
+
687
+ .share-card-context-image .share-card-play svg {
688
+ width: 15px;
689
+ height: 15px;
690
+ margin-left: 2px;
691
+ }
692
+
693
+ .share-card-context-image .share-card-more-images {
694
+ font-size: 20px;
695
+ }
696
+
697
+ /* The post after stays a glimpse. */
698
+ .share-card-context.is-next .share-card-context-image {
699
+ width: 64px;
700
+ height: 64px;
701
+ border-radius: 8px;
702
+ }
703
+
704
+ .share-card-context.is-next
705
+ .share-card-context-images[data-count="1"]
706
+ .share-card-context-image {
707
+ width: 85px;
708
+ }
709
+
710
+ .share-card[data-thread] .share-card-inner {
711
+ padding-top: 22px;
712
+ }
713
+
714
+ /* The Thread's first post in up to three lines, its title and the start
715
+ of its words, or a quote and its source: what the Thread is about. The
716
+ rail comes in out of the paper above it, as it does above the
717
+ timeline's faded context. */
718
+ .share-card-context.is-root {
719
+ --share-card-dot-y: 26.5px;
720
+
721
+ padding-top: 14px;
722
+ padding-bottom: 20px;
723
+ }
724
+
725
+ .share-card-context.is-root
726
+ :is(.share-card-context-title, .share-card-context-body) {
727
+ display: -webkit-box;
728
+ -webkit-box-orient: vertical;
729
+ -webkit-line-clamp: 1;
730
+ white-space: normal;
731
+ }
732
+
733
+ .share-card-context.is-root .share-card-context-body {
734
+ -webkit-line-clamp: 3;
735
+ }
736
+
737
+ .share-card-context.is-root
738
+ .share-card-context-title
739
+ + .share-card-context-body,
740
+ .share-card-context.is-root.has-source .share-card-context-body {
741
+ -webkit-line-clamp: 2;
742
+ }
743
+
744
+ /* The posts between the first and the shared one, folded: the rail turns
745
+ to a few dots, as at a gap in the timeline. How many is beside the
746
+ date, so the gap carries no words. */
747
+ .share-card-thread-gap {
748
+ height: 26px;
749
+ margin-top: -8px;
750
+ }
751
+
752
+ .share-card-thread-gap::before {
753
+ display: none;
754
+ }
755
+
756
+ .share-card-thread-gap::after {
757
+ left: calc(var(--share-card-rail-x) - 1.5px);
758
+ width: 3px;
759
+ background: radial-gradient(
760
+ circle,
761
+ var(--share-card-rail-color) 1.25px,
762
+ transparent 1.5px
763
+ )
764
+ center top / 3px 6.5px repeat-y;
765
+ }
766
+
767
+ /* The post after in one line, its title if it has one: the Thread goes
768
+ on, so the rail runs out down the card. */
769
+ .share-card-context.is-next {
770
+ --share-card-dot-y: 32.5px;
771
+
772
+ padding-top: 20px;
773
+ padding-bottom: 18px;
774
+ }
775
+
776
+ .share-card-context.is-next
777
+ .share-card-context-title
778
+ + .share-card-context-body,
779
+ .share-card-context.is-next .share-card-context-source {
780
+ display: none;
781
+ }
782
+
783
+ .share-card-context.is-next::after {
784
+ bottom: 0;
785
+ background: linear-gradient(
786
+ to bottom,
787
+ var(--share-card-rail-color) 0
788
+ calc(var(--share-card-rail-dot-at) - var(--share-card-dot-clearance)),
789
+ transparent 0
790
+ calc(var(--share-card-rail-dot-at) + var(--share-card-dot-clearance)),
791
+ var(--share-card-rail-color) 0 calc(100% - 22px),
792
+ transparent
793
+ );
794
+ }
795
+
796
+ /* Whose site it is and how to get there, like the source line of a
797
+ reading app's quote card: the site on the left, the code on the right,
798
+ centred on one line. */
799
+ .share-card-foot {
800
+ display: flex;
801
+ align-items: center;
802
+ gap: 12px;
803
+ margin-top: 30px;
804
+ padding-top: 20px;
805
+ border-top: 1px solid var(--site-divider);
806
+ }
807
+
808
+ .share-card-avatar {
809
+ display: grid;
810
+ flex: none;
811
+ place-items: center;
812
+ width: 36px;
813
+ height: 36px;
814
+ border-radius: var(--avatar-radius);
815
+ object-fit: cover;
816
+ background: var(--site-subtle-bg);
817
+ color: var(--site-text-secondary);
818
+ font-family: var(--font-site-title);
819
+ font-size: 16px;
820
+ line-height: 1;
821
+ }
822
+
823
+ .share-card-source {
824
+ display: grid;
825
+ flex: 1;
826
+ gap: 1px;
827
+ min-width: 0;
828
+ }
829
+
830
+ .share-card-site {
831
+ font-family: var(--font-site-title);
832
+ font-size: 15.5px;
833
+ font-weight: var(--fw-medium);
834
+ line-height: 1.3;
835
+ color: var(--site-text-primary);
836
+ }
837
+
838
+ .share-card-address {
839
+ font-family: var(--font-ui);
840
+ font-size: 12px;
841
+ line-height: 1.4;
842
+ color: var(--site-text-secondary);
843
+ }
844
+
845
+ /* Scanners want dark modules on a light ground, in either mode, and a
846
+ quiet zone around them. 74 px here is 148 px in the image. */
847
+ .share-card-qr {
848
+ flex: none;
849
+ width: 74px;
850
+ height: 74px;
851
+ padding: 4px;
852
+ border-radius: 6px;
853
+ background: white;
854
+ }
855
+
856
+ .share-card-qr svg {
857
+ display: block;
858
+ width: 100%;
859
+ height: 100%;
860
+ }
861
+
862
+ /* Set by the capture when the summary is still taller than one screen:
863
+ the body stops between blocks and its last lines fade into the paper. */
864
+ .share-card-body.is-cut {
865
+ position: relative;
866
+ overflow: hidden;
867
+ }
868
+
869
+ .share-card-fade {
870
+ position: absolute;
871
+ right: 0;
872
+ bottom: 0;
873
+ left: 0;
874
+ height: 96px;
875
+ background: linear-gradient(
876
+ to bottom,
877
+ transparent,
878
+ var(--share-card-paper)
879
+ );
880
+ }
881
+
882
+ /* Where the card is laid out for the capture: in the page, so it takes the
883
+ page's theme and fonts, but far off screen. */
884
+ .share-card-host {
885
+ position: fixed;
886
+ top: 0;
887
+ left: -100000px;
888
+ pointer-events: none;
889
+ }
890
+
891
+ /* No shadows while snapdom paints the card. In Safari it draws a capture
892
+ holding any box-shadow or text-shadow at 1x and stretches it, so one
893
+ shadow anywhere — a theme's, a post's — softens the whole picture on an
894
+ iPhone. The paper's own shadow is painted back on the canvas
895
+ (`share-capture.ts`), where it is sharp at any scale. */
896
+ .share-card-host[data-capturing] *,
897
+ .share-card-host[data-capturing] *::before,
898
+ .share-card-host[data-capturing] *::after {
899
+ box-shadow: none !important;
900
+ text-shadow: none !important;
901
+ }
902
+
903
+ .share-dialog {
904
+ margin: 0;
905
+ }
906
+
907
+ .share-dialog > .share-dialog-panel {
908
+ max-width: 28rem;
909
+ }
910
+
911
+ .share-dialog-panel {
912
+ outline: none;
913
+ }
914
+
915
+ .share-dialog-panel > button[aria-label="Close"] {
916
+ cursor: pointer;
917
+ }
918
+
919
+ .share-dialog-preview {
920
+ display: grid;
921
+ max-height: min(62vh, 40rem);
922
+ overflow-y: auto;
923
+ }
924
+
925
+ .share-dialog-preview[data-status="error"] {
926
+ place-items: center;
927
+ gap: 0.75rem;
928
+ min-height: 12rem;
929
+ }
930
+
931
+ .share-dialog-status {
932
+ max-width: 30ch;
933
+ text-align: center;
934
+ color: var(--site-text-secondary);
935
+ font-size: var(--type-ui-hint);
936
+ }
937
+
938
+ /* The picture's frame. Until the card is laid out it holds a blank card
939
+ of the usual proportions; the laid-out card then shows faded, like a
940
+ print still developing, and the PNG brings it to full strength. The
941
+ outline separates the picture from a dialog of the same color. */
942
+ .share-dialog-print {
943
+ --share-dialog-sheen: rgb(255 255 255 / 0.4);
944
+
945
+ position: relative;
946
+ width: 100%;
947
+ aspect-ratio: 540 / 700;
948
+ overflow: hidden;
949
+ border-radius: var(--media-radius);
950
+ outline: 1px solid var(--site-column-outline);
951
+ outline-offset: -1px;
952
+ }
953
+
954
+ @media (prefers-color-scheme: dark) {
955
+ :root:not([data-theme-mode="light"]) .share-dialog-print {
956
+ --share-dialog-sheen: rgb(255 255 255 / 0.07);
957
+ }
958
+ }
959
+
960
+ :root[data-theme-mode="dark"] .share-dialog-print {
961
+ --share-dialog-sheen: rgb(255 255 255 / 0.07);
962
+ }
963
+
964
+ /* Shown only if laying out takes a moment, so a quick open never flashes
965
+ it. */
966
+ .share-dialog-blank {
967
+ position: absolute;
968
+ inset: 0;
969
+ background: var(--share-card-mat);
970
+ animation: share-dialog-fade-in 0.3s ease 0.15s both;
971
+ }
972
+
973
+ .share-dialog-blank::before {
974
+ content: "";
975
+ position: absolute;
976
+ inset: 5.7% 6.3%;
977
+ border-radius: 10px;
978
+ background: var(--share-card-paper);
979
+ }
980
+
981
+ .share-dialog-card {
982
+ position: absolute;
983
+ top: 0;
984
+ left: 0;
985
+ transform-origin: 0 0;
986
+ opacity: 0.5;
987
+ animation: share-dialog-develop 0.25s ease both;
988
+ }
989
+
990
+ .share-dialog-image {
991
+ display: block;
992
+ width: 100%;
993
+ height: auto;
994
+ animation: share-dialog-fix 0.35s ease both;
995
+ }
996
+
997
+ /* One slow band of light while the picture is painted. */
998
+ .share-dialog-print:is(
999
+ [data-status="loading"],
1000
+ [data-status="developing"]
1001
+ )::after {
1002
+ content: "";
1003
+ position: absolute;
1004
+ inset: 0;
1005
+ background: linear-gradient(
1006
+ 105deg,
1007
+ transparent 35%,
1008
+ var(--share-dialog-sheen) 50%,
1009
+ transparent 65%
1010
+ );
1011
+ background-size: 250% 100%;
1012
+ animation: share-dialog-sheen 1.6s ease-in-out infinite;
1013
+ pointer-events: none;
1014
+ }
1015
+
1016
+ @keyframes share-dialog-fade-in {
1017
+ from {
1018
+ opacity: 0;
1019
+ }
1020
+ }
1021
+
1022
+ @keyframes share-dialog-develop {
1023
+ from {
1024
+ opacity: 0;
1025
+ }
1026
+ }
1027
+
1028
+ @keyframes share-dialog-fix {
1029
+ from {
1030
+ opacity: 0.5;
1031
+ }
1032
+ }
1033
+
1034
+ @keyframes share-dialog-sheen {
1035
+ from {
1036
+ background-position: 100% 0;
1037
+ }
1038
+ to {
1039
+ background-position: -50% 0;
1040
+ }
1041
+ }
1042
+
1043
+ @media (prefers-reduced-motion: reduce) {
1044
+ .share-dialog-print::after {
1045
+ animation: none;
1046
+ background: none;
1047
+ }
1048
+ }
1049
+
1050
+ /* One line kept for the note, so the dialog does not jump when it
1051
+ changes. */
1052
+ .share-dialog-note {
1053
+ min-height: 1lh;
1054
+ margin-top: -0.5rem;
1055
+ text-align: center;
1056
+ color: var(--site-text-secondary);
1057
+ font-size: var(--type-ui-hint);
1058
+ }
1059
+
1060
+ /* A mouse has the buttons; the hint is for touch. */
1061
+ @media (hover: hover) and (pointer: fine) {
1062
+ .share-dialog-hint {
1063
+ display: none;
1064
+ }
1065
+ }
1066
+
1067
+ .share-dialog-actions {
1068
+ display: flex;
1069
+ flex-wrap: wrap;
1070
+ justify-content: flex-end;
1071
+ gap: 0.5rem;
1072
+ }
1073
+
1074
+ /* Wider screens close from the corner. */
1075
+ .share-dialog-close {
1076
+ display: none;
1077
+ }
1078
+
1079
+ /* A phone closes from the bottom, in reach of a thumb: the actions two to
1080
+ a row, Close and Download last, an odd one out across the whole row. */
1081
+ @media (max-width: 640px) {
1082
+ .share-dialog > .share-dialog-panel {
1083
+ max-width: calc(100% - 1.5rem);
1084
+ }
1085
+
1086
+ .share-dialog-panel > button[aria-label="Close"] {
1087
+ display: none;
1088
+ }
1089
+
1090
+ .share-dialog .share-dialog-actions {
1091
+ display: grid;
1092
+ grid-template-columns: 1fr 1fr;
1093
+ }
1094
+
1095
+ .share-dialog-actions > :first-child:nth-last-child(odd) {
1096
+ grid-column: 1 / -1;
1097
+ }
1098
+
1099
+ .share-dialog .share-dialog-close {
1100
+ display: inline-flex;
1101
+ }
1102
+ }
1103
+ }