@heycys/gallery 0.1.2 → 0.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.
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/browser/editor/components/align.mjs +58 -0
- package/browser/editor/components/code/index.mjs +1 -1
- package/browser/editor/components/embed/page.mjs +1 -1
- package/browser/editor/components/file/page.mjs +4 -4
- package/browser/editor/components/heading/index.mjs +7 -6
- package/browser/editor/components/icons.mjs +3 -0
- package/browser/editor/components/image/index.mjs +2 -0
- package/browser/editor/components/image/page.mjs +172 -90
- package/browser/editor/components/installed/index.mjs +6 -2
- package/browser/editor/components/installed/page.mjs +80 -13
- package/browser/editor/components/media/icons.mjs +13 -8
- package/browser/editor/components/media/page.mjs +5 -3
- package/browser/editor/components/media/toolbar.mjs +12 -3
- package/browser/editor/components/paragraph/index.mjs +4 -3
- package/browser/editor/components/registry.mjs +17 -5
- package/browser/editor/components/table/index.mjs +4 -2
- package/browser/editor/page/after/index.mjs +288 -0
- package/browser/editor/page/align.mjs +91 -0
- package/browser/editor/page/beside.mjs +5 -6
- package/browser/editor/page/block-menu/index.mjs +6 -3
- package/browser/editor/page/blocks.mjs +3 -1
- package/browser/editor/page/board/hint.mjs +64 -27
- package/browser/editor/page/board/index.mjs +160 -71
- package/browser/editor/page/board/motion.mjs +177 -0
- package/browser/editor/page/board/settings.mjs +4 -3
- package/browser/editor/page/clipboard/index.mjs +10 -3
- package/browser/editor/page/clipboard/own/blocks.mjs +3 -4
- package/browser/editor/page/clipboard/own/describe.mjs +6 -2
- package/browser/editor/page/commit.mjs +2 -2
- package/browser/editor/page/core.mjs +3 -1
- package/browser/editor/page/custom-page.mjs +15 -11
- package/browser/editor/page/editor.mjs +31 -14
- package/browser/editor/page/history.mjs +19 -4
- package/browser/editor/page/insert/index.mjs +20 -22
- package/browser/editor/page/menu.mjs +15 -7
- package/browser/editor/page/page-objects.mjs +3 -7
- package/browser/editor/page/present-links.mjs +5 -4
- package/browser/editor/page/present-shell.mjs +63 -0
- package/browser/editor/page/selection/index.mjs +10 -2
- package/browser/editor/page/table/binding.mjs +87 -0
- package/browser/editor/page/table/icons.mjs +0 -2
- package/browser/editor/page/table/index.mjs +10 -14
- package/browser/editor/page/table/views.mjs +5 -52
- package/browser/editor/page/table/widths.mjs +82 -10
- package/browser/editor/page/typing/index.mjs +44 -12
- package/browser/editor/page/typing/leave.mjs +19 -5
- package/browser/shared/block-packs.mjs +23 -8
- package/browser/shared/component-catalog.mjs +15 -8
- package/browser/shared/component-source.mjs +3 -1
- package/browser/shared/components/heading.mjs +2 -1
- package/browser/shared/components/installed.mjs +1 -1
- package/browser/shared/components/page.mjs +2 -0
- package/browser/shared/components/paragraph.mjs +8 -1
- package/browser/shared/components/table.mjs +1 -0
- package/browser/shared/emoji/line-icons.mjs +37 -0
- package/browser/shared/http.mjs +9 -0
- package/browser/shared/i18n/en.mjs +40 -17
- package/browser/shared/outline.mjs +30 -2
- package/browser/shared/pack-manifest.mjs +12 -1
- package/browser/shared/pages.mjs +169 -57
- package/browser/shared/pinyin.mjs +92 -0
- package/browser/shared/present-step.mjs +17 -0
- package/browser/shared/sidebar-head.mjs +70 -0
- package/browser/shared/web-links.mjs +5 -0
- package/dist/chunk-2OHANJ6Q.mjs +2 -0
- package/dist/{chunk-QOUEFUCH.mjs → chunk-3MBRL2PM.mjs} +1 -1
- package/dist/{chunk-NWR2LT5B.mjs → chunk-4OKWZY5E.mjs} +1 -1
- package/dist/{chunk-RMECZA2K.mjs → chunk-5K44HLTZ.mjs} +1 -1
- package/dist/{chunk-NFMCP2HI.mjs → chunk-5XA2ZBAE.mjs} +2 -2
- package/dist/{chunk-OUUP3WKT.mjs → chunk-67N2QJYT.mjs} +1 -1
- package/dist/chunk-6KBYRA2C.mjs +2 -0
- package/dist/{chunk-SX4LJYT6.mjs → chunk-6N3PX4XX.mjs} +1 -1
- package/dist/{chunk-RFDZXFJF.mjs → chunk-7JDX4E65.mjs} +1 -1
- package/dist/chunk-7M2BQQGZ.mjs +2 -0
- package/dist/{chunk-ZUNVAXLH.mjs → chunk-7OG26PGF.mjs} +1 -1
- package/dist/{chunk-B4P2CM2J.mjs → chunk-AHN3NFKJ.mjs} +1 -1
- package/dist/chunk-ALZ6ZENZ.mjs +3 -0
- package/dist/{chunk-UGWYKHBL.mjs → chunk-AR5D57ZD.mjs} +2 -2
- package/dist/{chunk-W3BGBJQW.mjs → chunk-BFJGHSQN.mjs} +1 -1
- package/dist/{chunk-HLYV7RIH.mjs → chunk-CMA72MAG.mjs} +1 -1
- package/dist/{chunk-D4CKRD3V.mjs → chunk-DAZL73VK.mjs} +2 -2
- package/dist/{chunk-6VTU6KEO.mjs → chunk-DJISHPUL.mjs} +1 -1
- package/dist/{chunk-BPL64HGA.mjs → chunk-EAIFITAV.mjs} +1 -1
- package/dist/chunk-EP25HDAJ.mjs +2 -0
- package/dist/{chunk-6EZ7FNIK.mjs → chunk-F4ZA6JRZ.mjs} +1 -1
- package/dist/{chunk-3KJHLHUO.mjs → chunk-F6HVDZR4.mjs} +1 -1
- package/dist/{chunk-3NJACR4W.mjs → chunk-FDMAXMQA.mjs} +1 -1
- package/dist/chunk-FETSREUN.mjs +5 -0
- package/dist/{chunk-RKPWLGZ3.mjs → chunk-GHOYKMQ3.mjs} +1 -1
- package/dist/chunk-HDWTZ763.mjs +12 -0
- package/dist/{chunk-VTKNEYT3.mjs → chunk-HPOI4ZX7.mjs} +1 -1
- package/dist/{chunk-OW5NWPOJ.mjs → chunk-HXG7EOPJ.mjs} +1 -1
- package/dist/{chunk-V6RIYQZZ.mjs → chunk-ITOH5EGO.mjs} +1 -1
- package/dist/{chunk-ZWPMCK7P.mjs → chunk-IV64FFI4.mjs} +1 -1
- package/dist/chunk-J43Z6LSS.mjs +2 -0
- package/dist/chunk-J5PUIV3Y.mjs +4 -0
- package/dist/{chunk-KTKHRC6H.mjs → chunk-JA7G53PC.mjs} +1 -1
- package/dist/{chunk-NWFBE2YA.mjs → chunk-JLTZF4LA.mjs} +1 -1
- package/dist/{chunk-GY3FAUVM.mjs → chunk-JZT7I2OJ.mjs} +1 -1
- package/dist/{chunk-QKXMPUXC.mjs → chunk-K5XATEOO.mjs} +1 -1
- package/dist/chunk-L2SUIS5S.mjs +2 -0
- package/dist/{chunk-TEZAWDSQ.mjs → chunk-LM4XFQHZ.mjs} +1 -1
- package/dist/{chunk-5ZJA7CXT.mjs → chunk-MN7BZL4R.mjs} +1 -1
- package/dist/chunk-MTYYHM2G.mjs +15 -0
- package/dist/{chunk-HMYTM3GT.mjs → chunk-MXUBKDRO.mjs} +1 -1
- package/dist/{chunk-MHW7ZKOU.mjs → chunk-OEXWRJME.mjs} +1 -1
- package/dist/{chunk-CRJEG7MT.mjs → chunk-OFHXGWOX.mjs} +1 -1
- package/dist/chunk-ORID3AE7.mjs +166 -0
- package/dist/{chunk-32ZUEFZ7.mjs → chunk-PGDE24N5.mjs} +1 -1
- package/dist/{chunk-UNOYVIYR.mjs → chunk-POTA2FV4.mjs} +1 -1
- package/dist/{chunk-N7AZZLGT.mjs → chunk-QE5RG76S.mjs} +18 -17
- package/dist/{chunk-N76HWBA3.mjs → chunk-R2ZDLJYT.mjs} +1 -1
- package/dist/chunk-SWUTTZCN.mjs +2 -0
- package/dist/{chunk-POQSE4C2.mjs → chunk-TR7TWGHB.mjs} +1 -1
- package/dist/chunk-U5XL7D6A.mjs +3 -0
- package/dist/{chunk-PVER7LSC.mjs → chunk-U7NZI6N4.mjs} +2 -2
- package/dist/{chunk-Q47PLKIJ.mjs → chunk-UGWMMEJ5.mjs} +1 -1
- package/dist/chunk-UJQJKNGK.mjs +2 -0
- package/dist/chunk-UYVCQK3H.mjs +22 -0
- package/dist/{chunk-FJYN7RTH.mjs → chunk-VFX2KNHP.mjs} +1 -1
- package/dist/{chunk-UBBRTJ2R.mjs → chunk-VS7JIGJW.mjs} +1 -1
- package/dist/{chunk-NVRNLK25.mjs → chunk-W7665ZEC.mjs} +2 -2
- package/dist/{chunk-NG375ILQ.mjs → chunk-WQDQWCX5.mjs} +1 -1
- package/dist/chunk-YLPSMDIS.mjs +5 -0
- package/dist/{chunk-VXACTLO3.mjs → chunk-YNAWBAYN.mjs} +1 -1
- package/dist/{chunk-ZB4H7ZN4.mjs → chunk-YROX2O22.mjs} +1 -1
- package/dist/{chunk-YQGT4AB2.mjs → chunk-ZDLPUOAG.mjs} +1 -1
- package/dist/chunk-ZQS6H473.mjs +16 -0
- package/dist/{chunk-OJKMINIU.mjs → chunk-ZWWC4KLF.mjs} +15 -15
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +5 -5
- package/kit/code.js +15 -15
- package/kit/report.css +120 -41
- package/kit/runtime.js +45 -7
- package/kit/tables.js +2 -0
- package/kit/ui.js +2 -0
- package/package.json +1 -1
- package/packs/gallery/chart-view/kit.js +3 -3
- package/packs/gallery/chart-view/writing.md +1 -1
- package/packs/gallery/countdown/component.json +1 -1
- package/packs/gallery/countdown/kit.js +89 -29
- package/packs/gallery/countdown/preview.svg +1 -1
- package/packs/gallery/countdown/style.css +88 -100
- package/packs/gallery/countdown/writing.md +2 -2
- package/packs/gallery/habit/component.json +3 -3
- package/packs/gallery/habit/kit.js +114 -75
- package/packs/gallery/habit/preview.svg +1 -1
- package/packs/gallery/habit/style.css +133 -205
- package/packs/gallery/habit/writing.md +2 -2
- package/packs/gallery/heatmap/component.json +2 -2
- package/packs/gallery/heatmap/kit.js +335 -173
- package/packs/gallery/heatmap/preview.svg +1 -1
- package/packs/gallery/heatmap/style.css +158 -170
- package/packs/gallery/heatmap/writing.md +2 -2
- package/packs/gallery/kanban/kit.js +3 -3
- package/packs/gallery/kanban/writing.md +1 -1
- package/packs/gallery/metric/kit.js +3 -3
- package/packs/gallery/metric/writing.md +1 -1
- package/packs/gallery/note/component.json +3 -3
- package/packs/gallery/note/kit.js +40 -13
- package/packs/gallery/note/preview.svg +1 -1
- package/packs/gallery/note/style.css +51 -30
- package/packs/gallery/note/writing.md +2 -2
- package/packs/gallery/recent/component.json +2 -2
- package/packs/gallery/recent/kit.js +141 -86
- package/packs/gallery/recent/preview.svg +1 -1
- package/packs/gallery/recent/style.css +53 -126
- package/packs/gallery/recent/writing.md +2 -2
- package/packs/gallery/static/component.json +2 -2
- package/packs/gallery/static/preview.svg +1 -1
- package/packs/gallery/static/style.css +99 -66
- package/packs/gallery/static/writing.md +2 -2
- package/packs/gallery/stats/component.json +3 -3
- package/packs/gallery/stats/kit.js +253 -72
- package/packs/gallery/stats/preview.svg +1 -1
- package/packs/gallery/stats/style.css +64 -142
- package/packs/gallery/stats/writing.md +2 -2
- package/packs/gallery/today/component.json +2 -2
- package/packs/gallery/today/kit.js +62 -27
- package/packs/gallery/today/preview.svg +1 -1
- package/packs/gallery/today/style.css +101 -72
- package/packs/gallery/today/writing.md +2 -2
- package/packs/gallery/todos/component.json +1 -1
- package/packs/gallery/todos/kit.js +218 -71
- package/packs/gallery/todos/preview.svg +1 -1
- package/packs/gallery/todos/style.css +170 -223
- package/packs/gallery/todos/writing.md +1 -1
- package/packs/gallery/weather/component.json +2 -2
- package/packs/gallery/weather/kit.js +165 -90
- package/packs/gallery/weather/preview.svg +1 -1
- package/packs/gallery/weather/style.css +100 -218
- package/packs/gallery/weather/writing.md +1 -1
- package/packs/gallery-soft/countdown/component.json +18 -0
- package/packs/gallery-soft/countdown/example.html +3 -0
- package/packs/gallery-soft/countdown/kit.js +206 -0
- package/packs/gallery-soft/countdown/preview.svg +1 -0
- package/packs/gallery-soft/countdown/style.css +211 -0
- package/packs/gallery-soft/countdown/template.html +3 -0
- package/packs/gallery-soft/countdown/writing.md +24 -0
- package/packs/gallery-soft/habit/component.json +14 -0
- package/packs/gallery-soft/habit/example.html +3 -0
- package/packs/gallery-soft/habit/kit.js +366 -0
- package/packs/gallery-soft/habit/preview.svg +1 -0
- package/packs/gallery-soft/habit/style.css +251 -0
- package/packs/gallery-soft/habit/template.html +3 -0
- package/packs/gallery-soft/habit/writing.md +23 -0
- package/packs/gallery-soft/heatmap/component.json +18 -0
- package/packs/gallery-soft/heatmap/example.html +3 -0
- package/packs/gallery-soft/heatmap/kit.js +498 -0
- package/packs/gallery-soft/heatmap/preview.svg +1 -0
- package/packs/gallery-soft/heatmap/style.css +181 -0
- package/packs/gallery-soft/heatmap/template.html +3 -0
- package/packs/gallery-soft/heatmap/writing.md +23 -0
- package/packs/gallery-soft/note/component.json +14 -0
- package/packs/gallery-soft/note/example.html +3 -0
- package/packs/gallery-soft/note/kit.js +162 -0
- package/packs/gallery-soft/note/preview.svg +1 -0
- package/packs/gallery-soft/note/style.css +148 -0
- package/packs/gallery-soft/note/template.html +3 -0
- package/packs/gallery-soft/note/writing.md +20 -0
- package/packs/gallery-soft/recent/component.json +13 -0
- package/packs/gallery-soft/recent/example.html +1 -0
- package/packs/gallery-soft/recent/kit.js +335 -0
- package/packs/gallery-soft/recent/preview.svg +1 -0
- package/packs/gallery-soft/recent/style.css +160 -0
- package/packs/gallery-soft/recent/template.html +1 -0
- package/packs/gallery-soft/recent/writing.md +17 -0
- package/packs/gallery-soft/static/component.json +13 -0
- package/packs/gallery-soft/static/example.html +12 -0
- package/packs/gallery-soft/static/preview.svg +1 -0
- package/packs/gallery-soft/static/style.css +186 -0
- package/packs/gallery-soft/static/template.html +1 -0
- package/packs/gallery-soft/static/writing.md +20 -0
- package/packs/gallery-soft/stats/component.json +13 -0
- package/packs/gallery-soft/stats/example.html +1 -0
- package/packs/gallery-soft/stats/kit.js +341 -0
- package/packs/gallery-soft/stats/preview.svg +1 -0
- package/packs/gallery-soft/stats/style.css +119 -0
- package/packs/gallery-soft/stats/template.html +1 -0
- package/packs/gallery-soft/stats/writing.md +13 -0
- package/packs/gallery-soft/today/component.json +12 -0
- package/packs/gallery-soft/today/example.html +1 -0
- package/packs/gallery-soft/today/kit.js +222 -0
- package/packs/gallery-soft/today/preview.svg +1 -0
- package/packs/gallery-soft/today/style.css +178 -0
- package/packs/gallery-soft/today/template.html +1 -0
- package/packs/gallery-soft/today/writing.md +16 -0
- package/packs/gallery-soft/todos/component.json +19 -0
- package/packs/gallery-soft/todos/example.html +3 -0
- package/packs/gallery-soft/todos/kit.js +527 -0
- package/packs/gallery-soft/todos/preview.svg +1 -0
- package/packs/gallery-soft/todos/style.css +212 -0
- package/packs/gallery-soft/todos/template.html +3 -0
- package/packs/gallery-soft/todos/writing.md +32 -0
- package/packs/gallery-soft/weather/component.json +19 -0
- package/packs/gallery-soft/weather/example.html +3 -0
- package/packs/gallery-soft/weather/kit.js +411 -0
- package/packs/gallery-soft/weather/preview.svg +1 -0
- package/packs/gallery-soft/weather/style.css +185 -0
- package/packs/gallery-soft/weather/template.html +3 -0
- package/packs/gallery-soft/weather/writing.md +28 -0
- package/release.json +9 -9
- package/skill/SKILL.md +12 -12
- package/skill/references/building-blocks.md +4 -4
- package/skill/references/pages-and-data.md +13 -9
- package/skill/references/writing-html.md +2 -0
- package/web/assets/index-BM_K-Auu.css +1 -0
- package/web/assets/index-DRslOBiv.js +15 -0
- package/web/index.html +2 -2
- package/dist/chunk-2NRBY6AJ.mjs +0 -2
- package/dist/chunk-35NQ4PLQ.mjs +0 -2
- package/dist/chunk-4AV456RQ.mjs +0 -2
- package/dist/chunk-5XYHDBJ5.mjs +0 -2
- package/dist/chunk-6A53MZYZ.mjs +0 -2
- package/dist/chunk-6EXH3ORZ.mjs +0 -166
- package/dist/chunk-BVEFGE4B.mjs +0 -2
- package/dist/chunk-D4EURAX4.mjs +0 -4
- package/dist/chunk-DQCE7TJY.mjs +0 -5
- package/dist/chunk-FWNRPMCJ.mjs +0 -12
- package/dist/chunk-FWW4CSAZ.mjs +0 -2
- package/dist/chunk-JVHHHGEA.mjs +0 -3
- package/dist/chunk-PZDLJJTJ.mjs +0 -3
- package/dist/chunk-SXHBYZST.mjs +0 -16
- package/dist/chunk-UFNYFFKO.mjs +0 -20
- package/dist/chunk-UKSHDZZ6.mjs +0 -2
- package/dist/chunk-VJPFVNNW.mjs +0 -15
- package/dist/chunk-VS3ZMVGX.mjs +0 -5
- package/web/assets/index-BK2e_07w.js +0 -13
- package/web/assets/index-CWFI83mF.css +0 -1
|
@@ -1,258 +1,140 @@
|
|
|
1
|
-
/* Every selector starts at the instance and goes down
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
temperature is the cards' hero size. What it says while there is nothing to show is the cards' empty face: a quiet
|
|
13
|
-
picture (a place's pin) in a soft disc over a muted line, where to set the city under it, in the middle. The sun and
|
|
14
|
-
the rain have colors of their own, light and dark. */
|
|
1
|
+
/* Every selector starts at the instance and goes down a step at a time (>), so that nothing here
|
|
2
|
+
reaches the rest of the page. The pack's design B, in the kit's card tokens, laid out by the card's cells
|
|
3
|
+
(the face's data-layout): "wide" (4 × 2) the head (the chip, a pin, the city, when, faint), the sky's
|
|
4
|
+
picture (50px) beside the temperature (46px, the hero) and the sky's words over today's lowest and
|
|
5
|
+
highest, and at the bottom how it feels, the humidity and the wind, each after a small picture; "narrow"
|
|
6
|
+
(2 × 2) the picture (40px) and the temperature (40px) at the bottom and one line under them; "tall" (4 ×
|
|
7
|
+
4) the picture larger (60px) and, at the bottom over a hairline, the next five days, each a row of its
|
|
8
|
+
weekday, its sky (22px), its lowest (faint), a bar of its span on the scale of all of them (the cold
|
|
9
|
+
blue to the warm orange) and its highest (600). The pictures have their own colors (the sun's orange, a
|
|
10
|
+
cloud's gray, the rain's blue), in light and dark. A state with nothing to show is the cards' empty face
|
|
11
|
+
under the head. Light and dark. */
|
|
15
12
|
[data-doc-component="gallery/weather"] {
|
|
16
|
-
|
|
17
|
-
--gallery-weather-
|
|
18
|
-
--gallery-weather-
|
|
19
|
-
--gallery-weather-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
color: var(--gallery-text);
|
|
29
|
-
}
|
|
30
|
-
> .gallery-weather-face > p { margin: 0; }
|
|
13
|
+
--gallery-weather-sun: light-dark(#f3a935, #f4b045);
|
|
14
|
+
--gallery-weather-cloud: light-dark(#dde2e9, #68717e);
|
|
15
|
+
--gallery-weather-cloud-2: light-dark(#c4cbd5, #4a515b);
|
|
16
|
+
--gallery-weather-rain: light-dark(#5e90d8, #70a1e2);
|
|
17
|
+
--gallery-weather-cool: light-dark(#88b2e3, #6b9bd7);
|
|
18
|
+
--gallery-weather-hot: light-dark(#f3b45a, #efa94a);
|
|
19
|
+
font-family: var(--gallery-font);
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
color: var(--gallery-text);
|
|
23
|
+
> .gallery-weather-face { display: flex; flex-direction: column; box-sizing: border-box; min-height: 0; }
|
|
31
24
|
> .gallery-weather-face > .gallery-weather-head {
|
|
32
25
|
display: flex;
|
|
33
26
|
align-items: center;
|
|
34
27
|
gap: 8px;
|
|
35
28
|
flex: none;
|
|
29
|
+
height: 20px;
|
|
36
30
|
min-width: 0;
|
|
31
|
+
margin: 0;
|
|
37
32
|
padding-inline-end: var(--gallery-grip-room, 0px);
|
|
38
|
-
font-size: var(--gallery-title-size);
|
|
39
|
-
line-height: var(--gallery-title-line);
|
|
40
33
|
}
|
|
41
34
|
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip {
|
|
42
35
|
flex: none;
|
|
43
|
-
display:
|
|
44
|
-
|
|
45
|
-
justify-content: center;
|
|
36
|
+
display: grid;
|
|
37
|
+
place-items: center;
|
|
46
38
|
width: var(--gallery-chip-size);
|
|
47
39
|
height: var(--gallery-chip-size);
|
|
48
40
|
border-radius: var(--gallery-chip-radius);
|
|
49
|
-
background: var(--gallery-
|
|
50
|
-
color: var(--gallery-
|
|
41
|
+
background: var(--gallery-fill);
|
|
42
|
+
color: var(--gallery-muted);
|
|
51
43
|
}
|
|
52
|
-
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip > svg { width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
|
|
44
|
+
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip > svg { display: block; width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
|
|
53
45
|
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-city {
|
|
54
|
-
flex: 1 1 auto;
|
|
55
46
|
min-width: 0;
|
|
56
47
|
overflow: hidden;
|
|
57
48
|
white-space: nowrap;
|
|
58
49
|
text-overflow: ellipsis;
|
|
50
|
+
font-size: var(--gallery-title-size);
|
|
51
|
+
line-height: var(--gallery-title-line);
|
|
59
52
|
font-weight: 600;
|
|
60
|
-
color: var(--gallery-text
|
|
61
|
-
}
|
|
62
|
-
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-at {
|
|
63
|
-
flex: none;
|
|
64
|
-
margin-inline-end: calc(-1 * var(--gallery-grip-room, 0px)); opacity: calc(1 - var(--gallery-grip-shown, 0)); transition: opacity .12s ease-out;
|
|
65
|
-
font-size: var(--gallery-meta-size);
|
|
66
|
-
color: var(--doc-muted);
|
|
67
|
-
white-space: nowrap;
|
|
68
|
-
}
|
|
69
|
-
> .gallery-weather-face > .gallery-weather-now {
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: 12px;
|
|
73
|
-
min-width: 0;
|
|
74
|
-
margin-top: auto;
|
|
75
|
-
}
|
|
76
|
-
/* The weather now and its more line, together in the middle of the room under the head. */
|
|
77
|
-
> .gallery-weather-face > .gallery-weather-more { margin-bottom: auto; }
|
|
78
|
-
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture {
|
|
79
|
-
flex: none;
|
|
80
|
-
width: clamp(40px, 13cqi, 52px);
|
|
81
|
-
height: clamp(40px, 13cqi, 52px);
|
|
53
|
+
color: var(--gallery-text);
|
|
82
54
|
}
|
|
55
|
+
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-at { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: var(--gallery-meta-size); color: var(--gallery-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
56
|
+
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-at > .gallery-weather-stale { display: inline-flex; color: var(--gallery-warm); }
|
|
57
|
+
> .gallery-weather-face > .gallery-weather-head > .gallery-weather-at > .gallery-weather-stale > svg { width: 12px; height: 12px; stroke-width: 2; }
|
|
58
|
+
> .gallery-weather-face > .gallery-weather-now { display: flex; align-items: center; gap: 10px; flex: none; margin-top: 10px; }
|
|
59
|
+
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture { flex: none; width: 50px; height: 50px; overflow: visible; }
|
|
83
60
|
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-temperature {
|
|
84
|
-
|
|
85
|
-
font-size: var(--gallery-hero-size);
|
|
61
|
+
font-size: 46px;
|
|
86
62
|
line-height: 1;
|
|
87
|
-
font-weight:
|
|
88
|
-
letter-spacing:
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
letter-spacing: -.04em;
|
|
65
|
+
font-variant-numeric: lining-nums;
|
|
89
66
|
color: var(--gallery-text-strong);
|
|
90
|
-
font-variant-numeric: tabular-nums;
|
|
91
67
|
}
|
|
92
|
-
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words {
|
|
68
|
+
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words { display: flex; flex-direction: column; gap: 2px; margin-left: 6px; min-width: 0; }
|
|
69
|
+
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--gallery-text); white-space: nowrap; }
|
|
70
|
+
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range { font-size: 12.5px; line-height: 16px; color: var(--gallery-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
71
|
+
> .gallery-weather-face > .gallery-weather-line { display: none; }
|
|
72
|
+
> .gallery-weather-face > .gallery-weather-more { display: flex; gap: 14px; flex: none; margin: auto 0 0; font-size: 12px; line-height: 16px; color: var(--gallery-muted); white-space: nowrap; overflow: hidden; }
|
|
73
|
+
> .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece { display: inline-flex; align-items: center; gap: 4px; }
|
|
74
|
+
> .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece > svg { flex: none; width: 13px; height: 13px; color: var(--gallery-faint); }
|
|
75
|
+
> .gallery-weather-face > .gallery-weather-days { display: none; }
|
|
76
|
+
/* The pictures' own colors. */
|
|
77
|
+
> .gallery-weather-face svg .gallery-weather-sun { fill: var(--gallery-weather-sun); stroke: var(--gallery-weather-sun); }
|
|
78
|
+
> .gallery-weather-face svg .gallery-weather-sun > circle { stroke: none; }
|
|
79
|
+
> .gallery-weather-face svg .gallery-weather-moon { fill: var(--gallery-weather-sun); }
|
|
80
|
+
> .gallery-weather-face svg .gallery-weather-cloud { fill: var(--gallery-weather-cloud); }
|
|
81
|
+
> .gallery-weather-face svg .gallery-weather-cloud-2 { fill: var(--gallery-weather-cloud-2); }
|
|
82
|
+
> .gallery-weather-face svg :is(.gallery-weather-rain, .gallery-weather-mist) { stroke: var(--gallery-weather-rain); }
|
|
83
|
+
> .gallery-weather-face svg .gallery-weather-mist { stroke: var(--gallery-weather-cloud-2); }
|
|
84
|
+
> .gallery-weather-face svg .gallery-weather-snow { fill: var(--gallery-weather-cool); }
|
|
85
|
+
> .gallery-weather-face svg .gallery-weather-bolt { fill: var(--gallery-weather-sun); }
|
|
86
|
+
|
|
87
|
+
/* A narrow card: the picture and the temperature at the bottom, one line under them. */
|
|
88
|
+
/* Its head the city alone, but for the sign of an answer kept from before the network went (its time in its title), so that yesterday's weather never reads as now's. */
|
|
89
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-head > .gallery-weather-at:not(:has(> .gallery-weather-stale)) { display: none; }
|
|
90
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-head > .gallery-weather-at > .gallery-weather-when { display: none; }
|
|
91
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now { margin-top: auto; gap: 4px; }
|
|
92
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-picture { width: 40px; height: 40px; }
|
|
93
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-temperature { font-size: 40px; }
|
|
94
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-words,
|
|
95
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-more { display: none; }
|
|
96
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line { display: block; margin: 6px 0 0; font-size: 12.5px; line-height: 16px; color: var(--gallery-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
|
|
97
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line > b { font-weight: 600; color: var(--gallery-text); }
|
|
98
|
+
> .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line > .gallery-weather-dot { margin: 0 5px; color: var(--gallery-faintest); }
|
|
99
|
+
/* A tall card: the five days ahead at the bottom. */
|
|
100
|
+
> .gallery-weather-face[data-layout="tall"] > .gallery-weather-now { margin-top: 14px; }
|
|
101
|
+
> .gallery-weather-face[data-layout="tall"] > .gallery-weather-now > .gallery-weather-picture { width: 60px; height: 60px; }
|
|
102
|
+
> .gallery-weather-face[data-layout="tall"] > .gallery-weather-more { margin-top: 12px; }
|
|
103
|
+
> .gallery-weather-face[data-layout="tall"] > .gallery-weather-days {
|
|
93
104
|
display: flex;
|
|
94
105
|
flex-direction: column;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
line-height: 1.35;
|
|
99
|
-
}
|
|
100
|
-
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > * {
|
|
101
|
-
overflow: hidden;
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
text-overflow: ellipsis;
|
|
104
|
-
}
|
|
105
|
-
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-weight: 500; }
|
|
106
|
-
> .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range {
|
|
107
|
-
font-size: 13px;
|
|
108
|
-
color: var(--doc-muted);
|
|
109
|
-
font-variant-numeric: tabular-nums;
|
|
110
|
-
}
|
|
111
|
-
/* How it feels, the humidity, the wind: muted, a dot between them, a piece never broken. */
|
|
112
|
-
> .gallery-weather-face > .gallery-weather-more {
|
|
113
|
-
display: flex;
|
|
114
|
-
flex-wrap: wrap;
|
|
115
|
-
align-items: center;
|
|
116
|
-
gap: 2px 0;
|
|
117
|
-
font-size: var(--gallery-meta-size);
|
|
118
|
-
line-height: 1.5;
|
|
119
|
-
color: var(--doc-muted);
|
|
120
|
-
font-variant-numeric: tabular-nums;
|
|
121
|
-
}
|
|
122
|
-
> .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece { white-space: nowrap; }
|
|
123
|
-
> .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece + .gallery-weather-piece::before {
|
|
124
|
-
content: "";
|
|
125
|
-
display: inline-block;
|
|
126
|
-
width: 3px;
|
|
127
|
-
height: 3px;
|
|
128
|
-
margin: 0 8px;
|
|
129
|
-
border-radius: 50%;
|
|
130
|
-
background: currentColor;
|
|
131
|
-
opacity: .6;
|
|
132
|
-
vertical-align: middle;
|
|
133
|
-
}
|
|
134
|
-
> .gallery-weather-face > .gallery-weather-days {
|
|
135
|
-
display: none;
|
|
136
|
-
margin: 0;
|
|
137
|
-
padding: 8px 0 0;
|
|
106
|
+
margin: auto 0 0;
|
|
107
|
+
padding: 6px 0 0;
|
|
108
|
+
border-top: 1px solid var(--gallery-hair);
|
|
138
109
|
list-style: none;
|
|
139
|
-
border-top: 1px solid var(--doc-grid);
|
|
140
110
|
}
|
|
141
111
|
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day {
|
|
142
112
|
display: grid;
|
|
143
|
-
grid-template-columns:
|
|
144
|
-
align-items: center;
|
|
145
|
-
gap: 10px;
|
|
146
|
-
padding: 3px 0;
|
|
147
|
-
font-size: 13px;
|
|
148
|
-
line-height: 1.4;
|
|
149
|
-
}
|
|
150
|
-
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-picture { width: 20px; height: 20px; }
|
|
151
|
-
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range {
|
|
152
|
-
display: grid;
|
|
153
|
-
grid-template-columns: 2.6em minmax(0, 1fr) 2.6em;
|
|
113
|
+
grid-template-columns: 34px 24px 30px 1fr 30px;
|
|
154
114
|
align-items: center;
|
|
155
|
-
gap:
|
|
115
|
+
gap: 6px;
|
|
116
|
+
height: 26px;
|
|
117
|
+
font-size: 12.5px;
|
|
156
118
|
font-variant-numeric: tabular-nums;
|
|
157
119
|
}
|
|
158
|
-
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-
|
|
159
|
-
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range > .gallery-weather-bar > .gallery-weather-fill {
|
|
120
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-weekday { color: var(--gallery-text); }
|
|
121
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-picture { width: 22px; height: 22px; overflow: visible; }
|
|
122
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-low { color: var(--gallery-faint); text-align: right; }
|
|
123
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-high { color: var(--gallery-text); font-weight: 600; }
|
|
124
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-bar { position: relative; height: 5px; border-radius: 3px; background: var(--gallery-fill); }
|
|
125
|
+
> .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-bar > .gallery-weather-fill {
|
|
166
126
|
position: absolute;
|
|
167
127
|
top: 0;
|
|
168
128
|
bottom: 0;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
> .gallery-weather-face > .gallery-weather-note {
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-direction: column;
|
|
180
|
-
align-items: center;
|
|
181
|
-
gap: 8px;
|
|
182
|
-
margin-top: auto;
|
|
183
|
-
padding: 0 8px;
|
|
184
|
-
font-size: 13px;
|
|
185
|
-
line-height: 1.45;
|
|
186
|
-
color: var(--doc-muted);
|
|
187
|
-
text-align: center;
|
|
188
|
-
}
|
|
189
|
-
> .gallery-weather-face > .gallery-weather-note::before {
|
|
190
|
-
content: "";
|
|
191
|
-
flex: none;
|
|
192
|
-
width: 44px;
|
|
193
|
-
height: 44px;
|
|
194
|
-
margin-bottom: 2px;
|
|
195
|
-
background: currentColor;
|
|
196
|
-
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11a3 3 0 1 0 6 0 3 3 0 0 0-6 0'/%3E%3Cpath d='M17.66 16.66 13.41 20.9a2 2 0 0 1-2.83 0l-4.24-4.24a8 8 0 1 1 11.32 0z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
|
|
197
|
-
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11a3 3 0 1 0 6 0 3 3 0 0 0-6 0'/%3E%3Cpath d='M17.66 16.66 13.41 20.9a2 2 0 0 1-2.83 0l-4.24-4.24a8 8 0 1 1 11.32 0z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
|
|
198
|
-
}
|
|
199
|
-
> .gallery-weather-face > .gallery-weather-note:last-child { margin-bottom: auto; }
|
|
200
|
-
> .gallery-weather-face > .gallery-weather-hint {
|
|
201
|
-
margin: -4px 0 auto;
|
|
202
|
-
font-size: var(--gallery-meta-size);
|
|
203
|
-
color: var(--doc-muted);
|
|
204
|
-
text-align: center;
|
|
205
|
-
opacity: .8;
|
|
206
|
-
}
|
|
207
|
-
.gallery-weather-picture { fill: var(--gallery-weather-cloud); }
|
|
208
|
-
.gallery-weather-picture .gallery-weather-sun { fill: var(--gallery-weather-sun); stroke: var(--gallery-weather-sun); }
|
|
209
|
-
.gallery-weather-picture g.gallery-weather-sun { fill: none; }
|
|
210
|
-
.gallery-weather-picture .gallery-weather-moon { fill: var(--gallery-weather-sun); }
|
|
211
|
-
.gallery-weather-picture .gallery-weather-rain,
|
|
212
|
-
.gallery-weather-picture .gallery-weather-cloud-line { stroke: var(--gallery-weather-rain); }
|
|
213
|
-
.gallery-weather-picture .gallery-weather-cloud-line { stroke: var(--gallery-weather-cloud); }
|
|
214
|
-
.gallery-weather-picture .gallery-weather-snow { fill: var(--gallery-weather-rain); }
|
|
215
|
-
.gallery-weather-picture .gallery-weather-bolt { fill: var(--gallery-weather-sun); }
|
|
216
|
-
}
|
|
217
|
-
/* A narrow card (2 wide): the picture at the left of the temperature and, under the temperature (from its
|
|
218
|
-
left, not the picture's), the sky's words and the range on one muted line, a dot between; no more line;
|
|
219
|
-
narrower still, no range. */
|
|
220
|
-
@container (max-width: 260px) {
|
|
221
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { display: none; }
|
|
222
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now {
|
|
223
|
-
display: grid;
|
|
224
|
-
grid-template-columns: auto minmax(0, 1fr);
|
|
225
|
-
grid-template-areas: "picture temperature" "picture words";
|
|
226
|
-
align-items: center;
|
|
227
|
-
gap: 2px 10px;
|
|
228
|
-
margin-bottom: auto;
|
|
229
|
-
}
|
|
230
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture { grid-area: picture; }
|
|
231
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-temperature { grid-area: temperature; }
|
|
232
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words { grid-area: words; flex-direction: row; gap: 0; font-size: 13px; color: var(--doc-muted); }
|
|
233
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-weight: 400; }
|
|
234
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range::before { content: "·"; margin: 0 5px; }
|
|
235
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at { display: none; }
|
|
236
|
-
}
|
|
237
|
-
@container (max-width: 200px) {
|
|
238
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range { display: none; }
|
|
239
|
-
}
|
|
240
|
-
/* A low card: no more line. */
|
|
241
|
-
@container (max-height: 104px) {
|
|
242
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { display: none; }
|
|
243
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now { margin-bottom: auto; }
|
|
244
|
-
}
|
|
245
|
-
/* A tall card (4 high, or 2 high on a wide window but for its last row's room): the weather now under the
|
|
246
|
-
head, the days ahead right after its more line, their rows sharing the room left (each 44px at the most),
|
|
247
|
-
what is still left at the bottom. */
|
|
248
|
-
@container (min-height: 240px) {
|
|
249
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now { margin-top: 4px; }
|
|
250
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { margin-bottom: 0; }
|
|
251
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-days { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-top: 4px; }
|
|
252
|
-
[data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day { flex: 1 1 0; max-height: 44px; min-height: 0; }
|
|
129
|
+
border-radius: 3px;
|
|
130
|
+
background-image: linear-gradient(90deg, var(--gallery-weather-cool), var(--gallery-weather-hot));
|
|
131
|
+
}
|
|
132
|
+
/* Nothing to show yet: the cards' empty face under the head. */
|
|
133
|
+
> .gallery-weather-face > .gallery-weather-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 0; }
|
|
134
|
+
> .gallery-weather-face > .gallery-weather-empty > p { margin: 0; }
|
|
135
|
+
> .gallery-weather-face > .gallery-weather-empty > .gallery-weather-note { font-size: 13.5px; line-height: 20px; font-weight: 600; color: var(--gallery-text); }
|
|
136
|
+
> .gallery-weather-face > .gallery-weather-empty > .gallery-weather-hint { font-size: 12px; line-height: 18px; color: var(--gallery-faint); }
|
|
253
137
|
}
|
|
254
|
-
/* On a custom page the face
|
|
255
|
-
is around it (a document, as gallery block check shows it) it is as high as a 4 x 2 card's face, for the
|
|
256
|
-
instance is a container of its height too and would otherwise have none. */
|
|
257
|
-
[data-doc-component="gallery/weather"] { height: 11em; }
|
|
138
|
+
/* On a custom page the face fills the card the board frames. */
|
|
258
139
|
.gallery-card > [data-doc-component="gallery/weather"] { height: 100%; }
|
|
140
|
+
.gallery-card > [data-doc-component="gallery/weather"] > .gallery-weather-face { height: 100%; }
|
|
@@ -23,4 +23,4 @@ Put it on a custom page as a card of its board, `<section class="gallery-card" d
|
|
|
23
23
|
|
|
24
24
|
## How it looks
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
In Gallery 风格's look (the kit's card tokens, light and dark): a head of a small gray chip and a title, its end clear of the card's grip; one hero; the rest small and gray; the accent on the data and on today alone. Its head is a pin's chip, the city and when it was fetched (更新于 09:05; with no network, an answer kept from before says when, after a sign). The sky's picture, in its own colors (the sun's orange, a cloud's gray, the rain's blue), stands beside the temperature, the hero, and the sky's words over today's lowest and highest; at the bottom how it feels, the humidity and the wind, each after a small picture. A 2 × 2 card keeps the picture, the temperature and one line; a 4 × 4 card adds the next five days at the bottom, each its weekday, its sky, its lowest and highest at either end of a bar on the scale of all of them, cold blue to warm orange. Until the reader allows it online, or with no city, a city it cannot find or no network, the card says so under its head, and what to do faint under that.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery-soft/countdown",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": { "zh": "倒计时", "en": "Countdown" },
|
|
6
|
+
"description": { "zh": "离某一天还有几天,宽卡片旁边放一页小日历;到了那天说就是今天,过了说已过几天", "en": "How many days until a date, a page of a calendar beside it on a wide card: today on the day, and the days since after it" },
|
|
7
|
+
"words": "daojishi daoshu countdown days until 倒计时 倒数日 纪念日 日子",
|
|
8
|
+
"parts": {
|
|
9
|
+
"settings": { "at": ":scope > script", "edit": "data" }
|
|
10
|
+
},
|
|
11
|
+
"runtime": { "generated": [":scope > .gallery-soft-countdown-face"] },
|
|
12
|
+
"places": ["page"],
|
|
13
|
+
"card": { "sizes": [[2, 2], [4, 2]], "resize": true },
|
|
14
|
+
"settings": [
|
|
15
|
+
{ "key": "title", "label": { "zh": "名称", "en": "Name" }, "type": "text", "default": "" },
|
|
16
|
+
{ "key": "date", "label": { "zh": "日期", "en": "Date" }, "type": "date", "required": true }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// gallery-soft/countdown (倒计时, 柔光风格): Gallery 风格's gallery/countdown in the soft look, the same logic.
|
|
2
|
+
// The days between today, by the reader's clock, and the date its settings name: how many are left before
|
|
3
|
+
// it, 就是今天 on the day itself, how many have gone since after it. Its two settings, `title` (the name of the
|
|
4
|
+
// day) and `date` (YYYY-MM-DD), are the card's form (on a custom page the grip at the card's top right ›
|
|
5
|
+
// 设置…), kept in the data part `settings`, a script of JSON, which the board writes and this block only
|
|
6
|
+
// reads: it writes nothing. Drawn from that part on every `source` (the form, an Agent's write, an undo)
|
|
7
|
+
// and again as a day begins (the kit's `clock`, "day"), so that the count moves at midnight. A date it
|
|
8
|
+
// cannot read, or none, shows the cards' empty face, a calendar in a soft disc over 还没有设日期 and where
|
|
9
|
+
// to set one; the words are the page's language (the UI's where Gallery says it, else the page's lang).
|
|
10
|
+
//
|
|
11
|
+
// Its face, laid out by its card's size (`context.size`, read again on `layout`; data-w, data-h, data-pad):
|
|
12
|
+
// a head of an hourglass's chip and the day's name (春节, or 倒计时 where it has none); the count the hero,
|
|
13
|
+
// large, 还有 (or 已过) before it and 天 after it, muted; on the day 就是今天 in the accent; under it the date
|
|
14
|
+
// (2月6日 周六 on a 2 × 2 card, 2027年2月6日 星期六 on a wider one, which sets a small page of a calendar
|
|
15
|
+
// beside the count, the month on a band of the accent over the day). The face says by `data-kind` which of
|
|
16
|
+
// left, today, since or none it shows.
|
|
17
|
+
|
|
18
|
+
const WORDS = {
|
|
19
|
+
zh: {
|
|
20
|
+
left: "还有",
|
|
21
|
+
since: "已过",
|
|
22
|
+
today: "就是今天",
|
|
23
|
+
unit: () => "天",
|
|
24
|
+
countdown: "倒计时",
|
|
25
|
+
pick: "还没有设日期",
|
|
26
|
+
where: "右上角手柄 › 设置…",
|
|
27
|
+
whereShort: "手柄 › 设置…",
|
|
28
|
+
weekdays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
|
29
|
+
short: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
30
|
+
date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${year}年${month}月${day}日`, weekday],
|
|
31
|
+
dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${month}月${day}日`, weekday],
|
|
32
|
+
month: (/** @type {number} */ month) => `${month}月`,
|
|
33
|
+
},
|
|
34
|
+
en: {
|
|
35
|
+
left: "In",
|
|
36
|
+
since: "",
|
|
37
|
+
today: "Today",
|
|
38
|
+
unit: (/** @type {number} */ count, /** @type {boolean} */ since = false) => `${count === 1 ? "day" : "days"}${since ? " ago" : ""}`,
|
|
39
|
+
countdown: "Countdown",
|
|
40
|
+
pick: "No date yet",
|
|
41
|
+
where: "The grip at the top right › Settings…",
|
|
42
|
+
whereShort: "Grip › Settings…",
|
|
43
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
44
|
+
short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
45
|
+
date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][month - 1]} ${day}, ${year}`],
|
|
46
|
+
dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1]} ${day}`],
|
|
47
|
+
month: (/** @type {number} */ month) => ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
52
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
53
|
+
const ui = root.getAttribute("data-ge-language");
|
|
54
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A date written YYYY-MM-DD as { year, month, day }, or null for anything else (no such day too:
|
|
59
|
+
* 2027-02-30).
|
|
60
|
+
* @param {unknown} written
|
|
61
|
+
*/
|
|
62
|
+
function dateOf(written) {
|
|
63
|
+
const found = typeof written === "string" ? /^(\d{4})-(\d{2})-(\d{2})$/.exec(written) : null;
|
|
64
|
+
if (!found) return null;
|
|
65
|
+
const [year, month, day] = found.slice(1).map(Number);
|
|
66
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
67
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day ? { year, month, day } : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Where `now` (the reader's clock) stands to the date `written` (YYYY-MM-DD): { kind: "left", days }
|
|
72
|
+
* before it, { kind: "today", days: 0 } on it, { kind: "since", days } after it, by whole days of the
|
|
73
|
+
* calendar (counted in UTC from each day's date, so that a change of the clocks in between changes
|
|
74
|
+
* nothing); { kind: "none" } for a date it cannot read.
|
|
75
|
+
* @param {unknown} written
|
|
76
|
+
* @param {Date} now
|
|
77
|
+
* @returns {{ kind: "left" | "since" | "today", days: number } | { kind: "none" }}
|
|
78
|
+
*/
|
|
79
|
+
function countdownOf(written, now) {
|
|
80
|
+
const date = dateOf(written);
|
|
81
|
+
if (!date) return { kind: "none" };
|
|
82
|
+
const days = Math.round((Date.UTC(date.year, date.month - 1, date.day) - Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())) / 86_400_000);
|
|
83
|
+
if (days === 0) return { kind: "today", days: 0 };
|
|
84
|
+
return days > 0 ? { kind: "left", days } : { kind: "since", days: -days };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* What the card says, in `language`, of its `settings` (context.readJSON's, {} where none is set yet)
|
|
89
|
+
* at `now`: its head (the day's name, or 倒计时), the words before the count (还有, 已过) and its unit after it
|
|
90
|
+
* ("" with no count), its count (null on the day and with no date), the words standing there instead
|
|
91
|
+
* (`big`: 就是今天, or with no date 还没有设日期), the date (a list of words a line breaks between and never
|
|
92
|
+
* inside: the date and its weekday) long and short, or with no date where to set one (`where`, `whereShort`),
|
|
93
|
+
* and the calendar's page (its month and day; null with no date).
|
|
94
|
+
* @param {any} settings
|
|
95
|
+
* @param {Date} now
|
|
96
|
+
* @param {"zh" | "en"} language
|
|
97
|
+
*/
|
|
98
|
+
function faceOf(settings, now, language) {
|
|
99
|
+
const words = WORDS[language];
|
|
100
|
+
const date = dateOf(settings?.date);
|
|
101
|
+
const named = typeof settings?.title === "string" ? settings.title.trim() : "";
|
|
102
|
+
const count = countdownOf(settings?.date, now);
|
|
103
|
+
const head = named || words.countdown;
|
|
104
|
+
if (!date || count.kind === "none") return { head, label: "", count: null, unit: "", big: words.pick, foot: [words.where], footShort: [words.whereShort], page: null };
|
|
105
|
+
const weekday = new Date(Date.UTC(date.year, date.month - 1, date.day)).getUTCDay();
|
|
106
|
+
const foot = words.date(date.year, date.month, date.day, words.weekdays[weekday]);
|
|
107
|
+
const footShort = words.dateShort(date.month, date.day, words.short[weekday]);
|
|
108
|
+
const page = { month: words.month(date.month), day: String(date.day) };
|
|
109
|
+
if (count.kind === "today") return { head, label: "", count: null, unit: "", big: words.today, foot, footShort, page };
|
|
110
|
+
return { head, label: count.kind === "left" ? words.left : words.since, count: String(count.days), unit: words.unit(count.days, count.kind === "since"), big: "", foot, footShort, page };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The size the face is laid out by: its card's cells (`context.size`), or `fallback` (the manifest's first
|
|
115
|
+
* size) where no card is; and the frame's padding for it, as the soft cards pad theirs: "xs" on a card one
|
|
116
|
+
* cell high, "s" on a small one (2 × 2 and less), "l" on one 3 cells high or more, else "m".
|
|
117
|
+
* @param {DocComponentSize | null | undefined} size
|
|
118
|
+
* @param {[number, number]} fallback
|
|
119
|
+
*/
|
|
120
|
+
function sizeOf(size, fallback) {
|
|
121
|
+
const w = size?.w ?? fallback[0];
|
|
122
|
+
const h = size?.h ?? fallback[1];
|
|
123
|
+
return { w, h, pad: h === 1 ? "xs" : w <= 2 && h <= 2 ? "s" : h >= 3 ? "l" : "m" };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* An element of the face, of `kind` (its class).
|
|
128
|
+
* @template {keyof HTMLElementTagNameMap} K
|
|
129
|
+
* @param {K} tag
|
|
130
|
+
* @param {string} kind
|
|
131
|
+
* @param {string} [text]
|
|
132
|
+
*/
|
|
133
|
+
function made(tag, kind, text) {
|
|
134
|
+
const node = document.createElement(tag);
|
|
135
|
+
node.className = `gallery-soft-countdown-${kind}`;
|
|
136
|
+
if (text !== undefined) node.textContent = text;
|
|
137
|
+
return node;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Words as pieces a line breaks between and never inside. @param {string[]} pieces */
|
|
141
|
+
const piecesOf = (pieces) => pieces.flatMap((words, index) => {
|
|
142
|
+
const piece = made("span", "piece", words);
|
|
143
|
+
return index === 0 ? [piece] : [" ", piece];
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
DocKit.component({
|
|
147
|
+
id: "gallery-soft/countdown",
|
|
148
|
+
on: ["source", "clock", "layout"],
|
|
149
|
+
mount(host, context) {
|
|
150
|
+
const language = languageOf(document.documentElement);
|
|
151
|
+
const face = made("div", "face");
|
|
152
|
+
host.append(face);
|
|
153
|
+
const draw = (/** @type {string} */ reason = "", /** @type {unknown} */ detail = null) => {
|
|
154
|
+
if (reason === "clock" && detail !== "day") return; // a minute moves no count
|
|
155
|
+
const settings = context.readJSON("settings");
|
|
156
|
+
if (settings === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
|
|
157
|
+
if (settings === null || typeof settings !== "object" || Array.isArray(settings)) return context.fail(new Error("its settings are no object: { \"title\": \"…\", \"date\": \"YYYY-MM-DD\" }"));
|
|
158
|
+
const { w, h, pad } = sizeOf(context.size, [2, 2]);
|
|
159
|
+
const small = w <= 2;
|
|
160
|
+
const at = new Date();
|
|
161
|
+
const now = faceOf(settings, at, language);
|
|
162
|
+
const kind = countdownOf(settings.date, at).kind;
|
|
163
|
+
Object.assign(face.dataset, { kind, w: String(w), h: String(h), pad });
|
|
164
|
+
const head = made("div", "head");
|
|
165
|
+
const chip = made("span", "chip");
|
|
166
|
+
chip.setAttribute("aria-hidden", "true");
|
|
167
|
+
chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M7 3.5h10M7 20.5h10"/><path d="M8 3.5v2.4c0 1.4.7 2.6 1.8 3.4L12 11l2.2-1.7A4.2 4.2 0 0 0 16 5.9V3.5"/><path d="M8 20.5v-2.4c0-1.4.7-2.6 1.8-3.4L12 13l2.2 1.7a4.2 4.2 0 0 1 1.8 3.4v2.4"/></svg>';
|
|
168
|
+
const named = made("span", "name", now.head);
|
|
169
|
+
named.title = now.head;
|
|
170
|
+
head.append(chip, named);
|
|
171
|
+
if (kind === "none") {
|
|
172
|
+
// The cards' empty face: a calendar in a soft disc, what is missing, where to set it.
|
|
173
|
+
const empty = made("div", "empty");
|
|
174
|
+
const disc = made("span", "disc");
|
|
175
|
+
disc.setAttribute("aria-hidden", "true");
|
|
176
|
+
disc.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5.5" width="16" height="14.5" rx="2.4"/><path d="M8 3.5v4M16 3.5v4M4 10.5h16"/></svg>';
|
|
177
|
+
empty.append(disc, made("p", "line", now.big), made("p", "how", (small ? now.footShort : now.foot).join(" ")));
|
|
178
|
+
face.replaceChildren(head, empty);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
// The count: 还有 before it, 天 after it; on the day, its words.
|
|
182
|
+
const figure = made("p", "count");
|
|
183
|
+
if (now.count === null) {
|
|
184
|
+
figure.classList.add("gallery-soft-countdown-words");
|
|
185
|
+
figure.textContent = now.big;
|
|
186
|
+
} else {
|
|
187
|
+
figure.append(...(now.label ? [made("span", "label", now.label)] : []), made("span", "number", now.count), made("span", "unit", now.unit));
|
|
188
|
+
}
|
|
189
|
+
const date = made("p", "date");
|
|
190
|
+
date.append(...piecesOf(small ? now.footShort : now.foot));
|
|
191
|
+
const body = made("div", "body");
|
|
192
|
+
const grow = made("div", "grow");
|
|
193
|
+
grow.append(figure, date);
|
|
194
|
+
body.append(grow);
|
|
195
|
+
if (!small && now.page) {
|
|
196
|
+
const page = made("div", "page");
|
|
197
|
+
page.setAttribute("aria-hidden", "true");
|
|
198
|
+
page.append(made("span", "month", now.page.month), made("span", "day", now.page.day));
|
|
199
|
+
body.append(page);
|
|
200
|
+
}
|
|
201
|
+
face.replaceChildren(head, body);
|
|
202
|
+
};
|
|
203
|
+
draw();
|
|
204
|
+
return { update: draw };
|
|
205
|
+
},
|
|
206
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><defs><linearGradient id="w" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3e7ac6" stop-opacity=".07"/><stop offset=".52" stop-color="#3e7ac6" stop-opacity="0"/></linearGradient></defs><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="14" fill="#ffffff" stroke="#e8e7e4"/><rect x="17" y="13" width="206" height="94" rx="13.5" fill="url(#w)"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#ecf3fb"/><rect x="34" y="30" width="6" height="2" rx="1" fill="#3e7ac6"/><rect x="50" y="28" width="26" height="6" rx="3" fill="#37352f"/><rect x="30" y="58" width="18" height="7" rx="3.5" fill="#8d8c88"/><rect x="52" y="50" width="44" height="22" rx="11" fill="#1f1f1f"/><rect x="100" y="64" width="10" height="7" rx="3.5" fill="#8d8c88"/><rect x="30" y="82" width="70" height="5" rx="2.5" fill="#c4c2bd"/><rect x="168" y="46" width="38" height="44" rx="8" fill="#fff" stroke="#e6e5e2"/><path d="M168 54a8 8 0 0 1 8-8h22a8 8 0 0 1 8 8v4h-38z" fill="#3e7ac6"/><rect x="178" y="67" width="18" height="14" rx="7" fill="#1f1f1f"/></svg>
|