@arraypress/covers 0.0.0-stage → 1.0.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 (50) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +29 -0
  3. package/README.md +561 -2
  4. package/fonts/OFL.txt +93 -0
  5. package/fonts/inter-latin-400.woff +0 -0
  6. package/fonts/inter-latin-500.woff +0 -0
  7. package/fonts/inter-latin-600.woff +0 -0
  8. package/fonts/inter-latin-700.woff +0 -0
  9. package/package.json +96 -4
  10. package/recipes/aurora.json +132 -0
  11. package/recipes/bauhaus.json +113 -0
  12. package/recipes/bigType.json +103 -0
  13. package/recipes/contour.json +109 -0
  14. package/recipes/cutout.json +191 -0
  15. package/recipes/diagram.json +92 -0
  16. package/recipes/dither.json +170 -0
  17. package/recipes/duotone.json +75 -0
  18. package/recipes/gridTitle.json +136 -0
  19. package/recipes/iconTile.json +214 -0
  20. package/recipes/issue.json +221 -0
  21. package/recipes/mark.json +170 -0
  22. package/recipes/photo.json +156 -0
  23. package/recipes/riso.json +387 -0
  24. package/recipes/stripes.json +206 -0
  25. package/recipes/waveform.json +154 -0
  26. package/schema/recipe.schema.json +2292 -0
  27. package/src/astro.d.ts +31 -0
  28. package/src/astro.js +86 -0
  29. package/src/color.js +246 -0
  30. package/src/diagram.js +248 -0
  31. package/src/extract.js +90 -0
  32. package/src/flatten.js +234 -0
  33. package/src/fonts.js +200 -0
  34. package/src/geometry.js +187 -0
  35. package/src/grid.js +41 -0
  36. package/src/handmade.js +253 -0
  37. package/src/icons.js +157 -0
  38. package/src/index.d.ts +897 -0
  39. package/src/index.js +19 -0
  40. package/src/json-recipe.js +458 -0
  41. package/src/layer-options.js +37 -0
  42. package/src/layers.js +972 -0
  43. package/src/palette.js +185 -0
  44. package/src/png.js +77 -0
  45. package/src/print.js +658 -0
  46. package/src/recipes.js +78 -0
  47. package/src/render.js +462 -0
  48. package/src/rng.js +95 -0
  49. package/src/svg.js +69 -0
  50. package/src/text.js +230 -0
@@ -0,0 +1,191 @@
1
+ {
2
+ "$schema": "../schema/recipe.schema.json",
3
+ "name": "cutout",
4
+ "description": "A flat matte field (or a hand-cut panel on the page colour) with cut-paper shapes and a hand-drawn icon or node graph.",
5
+ "params": {
6
+ "panel": false,
7
+ "shapes": null,
8
+ "graph": false,
9
+ "stroke": null
10
+ },
11
+ "vars": {
12
+ "field": {
13
+ "tone": [
14
+ "@accent",
15
+ {
16
+ "l": [
17
+ 0.52,
18
+ 0.64
19
+ ],
20
+ "c": [
21
+ 0.05,
22
+ 0.11
23
+ ]
24
+ }
25
+ ]
26
+ },
27
+ "count": {
28
+ "if": {
29
+ "shapes": null
30
+ },
31
+ "then": {
32
+ "if": "panel",
33
+ "then": 0,
34
+ "else": 3
35
+ },
36
+ "else": "{shapes}"
37
+ },
38
+ "ink": {
39
+ "if": {
40
+ "stroke": "light"
41
+ },
42
+ "then": "#faf9f5",
43
+ "else": {
44
+ "if": {
45
+ "stroke": "dark"
46
+ },
47
+ "then": "#141413",
48
+ "else": {
49
+ "if": "panel",
50
+ "then": "#faf9f5",
51
+ "else": {
52
+ "if": "graph",
53
+ "then": "#141413",
54
+ "else": {
55
+ "if": {
56
+ "shapes": 0
57
+ },
58
+ "then": "#faf9f5",
59
+ "else": "#141413"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "type": {
66
+ "readable": [
67
+ {
68
+ "if": "panel",
69
+ "then": "@bg",
70
+ "else": "$field"
71
+ },
72
+ 4.5,
73
+ "white"
74
+ ]
75
+ }
76
+ },
77
+ "layers": [
78
+ {
79
+ "id": "bg",
80
+ "type": "solid",
81
+ "color": {
82
+ "if": "panel",
83
+ "then": "@bg",
84
+ "else": "$field"
85
+ }
86
+ },
87
+ {
88
+ "id": "panel",
89
+ "type": "paper",
90
+ "when": "panel",
91
+ "items": [
92
+ {
93
+ "kind": "rect",
94
+ "x": 0.5,
95
+ "y": 0.5,
96
+ "width": {
97
+ "mul": [
98
+ "@width",
99
+ 0.64
100
+ ]
101
+ },
102
+ "height": {
103
+ "mul": [
104
+ "@height",
105
+ 0.6
106
+ ]
107
+ }
108
+ }
109
+ ],
110
+ "region": {
111
+ "x": 0,
112
+ "y": 0,
113
+ "width": 1,
114
+ "height": 1
115
+ },
116
+ "color": "$field",
117
+ "wobble": 0.3
118
+ },
119
+ {
120
+ "id": "shapes",
121
+ "type": "paper",
122
+ "count": "$count",
123
+ "region": {
124
+ "x": 0.24,
125
+ "y": 0.22,
126
+ "width": 0.52,
127
+ "height": 0.56
128
+ }
129
+ },
130
+ {
131
+ "id": "icon",
132
+ "type": "scribble",
133
+ "when": {
134
+ "not": "graph"
135
+ },
136
+ "icon": "{icon}",
137
+ "color": "$ink",
138
+ "size": {
139
+ "if": "panel",
140
+ "then": "34vmin",
141
+ "else": "44vmin"
142
+ },
143
+ "stroke": "1.6vmin"
144
+ },
145
+ {
146
+ "id": "graph",
147
+ "type": "scribble",
148
+ "when": "graph",
149
+ "graph": true,
150
+ "color": "$ink",
151
+ "size": "52vmin",
152
+ "stroke": "1.7vmin"
153
+ },
154
+ {
155
+ "id": "grain",
156
+ "type": "grain",
157
+ "amount": 0.035
158
+ },
159
+ {
160
+ "id": "title",
161
+ "type": "text",
162
+ "when": "title",
163
+ "content": "{title}",
164
+ "anchor": "bottom-left",
165
+ "weight": 500,
166
+ "size": {
167
+ "mul": [
168
+ "@u",
169
+ 0.066
170
+ ]
171
+ },
172
+ "minSize": {
173
+ "mul": [
174
+ "@u",
175
+ 0.048
176
+ ]
177
+ },
178
+ "lineHeight": 1.08,
179
+ "letterSpacing": -0.025,
180
+ "maxLines": 3,
181
+ "label": {
182
+ "if": "label",
183
+ "then": {
184
+ "color": "$type",
185
+ "content": "{label}"
186
+ }
187
+ },
188
+ "color": "$type"
189
+ }
190
+ ]
191
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "../schema/recipe.schema.json",
3
+ "name": "diagram",
4
+ "description": "White line-art over the gradient field: one icon, or nodes in outlined tiles joined by arrows, with a dotted grid that breaks around them (the engineering-blog look).",
5
+ "params": {
6
+ "nodes": null,
7
+ "layout": null,
8
+ "arrows": null
9
+ },
10
+ "layers": [
11
+ {
12
+ "id": "bg",
13
+ "type": "solid"
14
+ },
15
+ {
16
+ "id": "mesh",
17
+ "type": "mesh",
18
+ "count": 4,
19
+ "blur": "11vmax",
20
+ "size": [
21
+ 0.45,
22
+ 0.8
23
+ ],
24
+ "streak": 1.8,
25
+ "tone": {
26
+ "l": [
27
+ 0.4,
28
+ 0.6
29
+ ],
30
+ "c": [
31
+ 0.14,
32
+ 0.24
33
+ ]
34
+ },
35
+ "fold": {
36
+ "pick": [
37
+ false,
38
+ false,
39
+ {
40
+ "sheen": 0
41
+ }
42
+ ]
43
+ },
44
+ "hueSpan": 60
45
+ },
46
+ {
47
+ "id": "diagram",
48
+ "type": "diagram",
49
+ "icon": "{icon}",
50
+ "nodes": "{nodes}",
51
+ "layout": "{layout}",
52
+ "arrows": "{arrows}",
53
+ "grid": true
54
+ },
55
+ {
56
+ "id": "grain",
57
+ "type": "grain",
58
+ "amount": 0.07
59
+ },
60
+ {
61
+ "id": "title",
62
+ "type": "text",
63
+ "when": "title",
64
+ "content": "{title}",
65
+ "anchor": "bottom-left",
66
+ "weight": 500,
67
+ "size": {
68
+ "mul": [
69
+ "@u",
70
+ 0.066
71
+ ]
72
+ },
73
+ "minSize": {
74
+ "mul": [
75
+ "@u",
76
+ 0.048
77
+ ]
78
+ },
79
+ "lineHeight": 1.08,
80
+ "letterSpacing": -0.025,
81
+ "maxLines": 3,
82
+ "label": {
83
+ "if": "label",
84
+ "then": {
85
+ "color": "#ffffff",
86
+ "content": "{label}"
87
+ }
88
+ },
89
+ "color": "#ffffff"
90
+ }
91
+ ]
92
+ }
@@ -0,0 +1,170 @@
1
+ {
2
+ "$schema": "../schema/recipe.schema.json",
3
+ "name": "dither",
4
+ "description": "A soft field (noise, a gradient, or a lit sphere / arch / circle) rendered 1-bit at a visible pixel size: Bayer 4\u00d74 / 8\u00d78 or blue-ish noise, in two colours or three.",
5
+ "params": {
6
+ "matrix": "bayer4",
7
+ "cell": "0.9vmin",
8
+ "source": null,
9
+ "shape": null,
10
+ "three": false
11
+ },
12
+ "vars": {
13
+ "ink": {
14
+ "tone": [
15
+ "@accent",
16
+ {
17
+ "if": {
18
+ "mode": "dark"
19
+ },
20
+ "then": {
21
+ "l": [
22
+ 0.62,
23
+ 0.85
24
+ ],
25
+ "c": [
26
+ 0.1,
27
+ 0.22
28
+ ]
29
+ },
30
+ "else": {
31
+ "l": [
32
+ 0.3,
33
+ 0.55
34
+ ],
35
+ "c": [
36
+ 0.1,
37
+ 0.24
38
+ ]
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ "colors": {
44
+ "if": "three",
45
+ "then": [
46
+ "@bg",
47
+ {
48
+ "tone": [
49
+ "@colors.1",
50
+ {
51
+ "l": [
52
+ 0.55,
53
+ 0.75
54
+ ],
55
+ "c": [
56
+ 0.1,
57
+ 0.2
58
+ ]
59
+ }
60
+ ]
61
+ },
62
+ "$ink"
63
+ ],
64
+ "else": [
65
+ "@bg",
66
+ "$ink"
67
+ ]
68
+ }
69
+ },
70
+ "output": {
71
+ "lossless": true
72
+ },
73
+ "layers": [
74
+ {
75
+ "id": "dither",
76
+ "type": "dither",
77
+ "colors": "$colors",
78
+ "source": {
79
+ "if": "source",
80
+ "then": "{source}",
81
+ "else": {
82
+ "pick": [
83
+ "field",
84
+ "linear",
85
+ "radial"
86
+ ]
87
+ }
88
+ },
89
+ "shape": {
90
+ "if": "shape",
91
+ "then": "{shape}",
92
+ "else": {
93
+ "pick": [
94
+ "sphere",
95
+ "none",
96
+ "circle",
97
+ "arch",
98
+ "sphere"
99
+ ]
100
+ }
101
+ },
102
+ "matrix": "{matrix}",
103
+ "cell": "{cell}",
104
+ "center": {
105
+ "x": {
106
+ "range": [
107
+ 0.4,
108
+ 0.6
109
+ ]
110
+ },
111
+ "y": {
112
+ "range": [
113
+ 0.38,
114
+ 0.55
115
+ ]
116
+ }
117
+ },
118
+ "size": "28vmin"
119
+ },
120
+ {
121
+ "id": "title",
122
+ "type": "text",
123
+ "when": "title",
124
+ "content": "{title}",
125
+ "anchor": "bottom-left",
126
+ "weight": 500,
127
+ "size": {
128
+ "mul": [
129
+ "@u",
130
+ 0.062
131
+ ]
132
+ },
133
+ "minSize": {
134
+ "mul": [
135
+ "@u",
136
+ 0.046
137
+ ]
138
+ },
139
+ "lineHeight": 1.08,
140
+ "letterSpacing": -0.025,
141
+ "maxLines": 3,
142
+ "label": {
143
+ "if": "label",
144
+ "then": {
145
+ "color": "@text",
146
+ "content": "{label}"
147
+ }
148
+ },
149
+ "color": "@text",
150
+ "background": {
151
+ "color": "@bg",
152
+ "radius": 0,
153
+ "padding": [
154
+ {
155
+ "mul": [
156
+ "@u",
157
+ 0.03
158
+ ]
159
+ },
160
+ {
161
+ "mul": [
162
+ "@u",
163
+ 0.035
164
+ ]
165
+ }
166
+ ]
167
+ }
168
+ }
169
+ ]
170
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "../schema/recipe.schema.json",
3
+ "name": "duotone",
4
+ "description": "A photo mapped to the palette's shadow and highlight colours, with grain, and a title over a scrim when given.",
5
+ "requires": [
6
+ "image"
7
+ ],
8
+ "vars": {
9
+ "shadow": {
10
+ "if": {
11
+ "mode": "dark"
12
+ },
13
+ "then": "@bg",
14
+ "else": "@text"
15
+ }
16
+ },
17
+ "layers": [
18
+ {
19
+ "id": "image",
20
+ "type": "image",
21
+ "src": "{image}",
22
+ "duotone": true
23
+ },
24
+ {
25
+ "id": "scrim",
26
+ "type": "linear",
27
+ "when": "title",
28
+ "angle": 180,
29
+ "colors": [
30
+ "$shadow",
31
+ "$shadow"
32
+ ],
33
+ "opacities": [
34
+ 0,
35
+ 0.62
36
+ ]
37
+ },
38
+ {
39
+ "id": "grain",
40
+ "type": "grain",
41
+ "amount": 0.07
42
+ },
43
+ {
44
+ "id": "title",
45
+ "type": "text",
46
+ "when": "title",
47
+ "content": "{title}",
48
+ "anchor": "bottom-left",
49
+ "weight": 500,
50
+ "size": {
51
+ "mul": [
52
+ "@u",
53
+ 0.066
54
+ ]
55
+ },
56
+ "minSize": {
57
+ "mul": [
58
+ "@u",
59
+ 0.048
60
+ ]
61
+ },
62
+ "lineHeight": 1.08,
63
+ "letterSpacing": -0.025,
64
+ "maxLines": 3,
65
+ "label": {
66
+ "if": "label",
67
+ "then": {
68
+ "color": "#e9e9e9",
69
+ "content": "{label}"
70
+ }
71
+ },
72
+ "color": "#ffffff"
73
+ }
74
+ ]
75
+ }
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "../schema/recipe.schema.json",
3
+ "name": "gridTitle",
4
+ "description": "The aurora field under a dotted grid (four cells each way), grain, and an optional headline lower left.",
5
+ "layers": [
6
+ {
7
+ "id": "bg",
8
+ "type": "solid"
9
+ },
10
+ {
11
+ "id": "mesh",
12
+ "type": "mesh",
13
+ "count": 4,
14
+ "blur": "11vmax",
15
+ "size": [
16
+ 0.45,
17
+ 0.8
18
+ ],
19
+ "streak": 1.8,
20
+ "tone": {
21
+ "if": "title",
22
+ "then": {
23
+ "if": {
24
+ "mode": "dark"
25
+ },
26
+ "then": {
27
+ "l": [
28
+ 0.34,
29
+ 0.5
30
+ ],
31
+ "c": [
32
+ 0.12,
33
+ 0.22
34
+ ]
35
+ },
36
+ "else": {
37
+ "l": [
38
+ 0.66,
39
+ 0.82
40
+ ],
41
+ "c": [
42
+ 0.13,
43
+ 0.2
44
+ ]
45
+ }
46
+ },
47
+ "else": {
48
+ "l": [
49
+ 0.55,
50
+ 0.85
51
+ ],
52
+ "c": [
53
+ 0.12,
54
+ 0.22
55
+ ]
56
+ }
57
+ },
58
+ "fold": {
59
+ "if": "title",
60
+ "then": false,
61
+ "else": {
62
+ "pick": [
63
+ false,
64
+ false,
65
+ true
66
+ ]
67
+ }
68
+ },
69
+ "streaks": {
70
+ "if": "title",
71
+ "then": 0,
72
+ "else": {
73
+ "pick": [
74
+ 0,
75
+ 0,
76
+ 0,
77
+ 6
78
+ ]
79
+ }
80
+ },
81
+ "hues": {
82
+ "pick": [
83
+ 2,
84
+ 2,
85
+ 3
86
+ ]
87
+ },
88
+ "hueSpan": 60
89
+ },
90
+ {
91
+ "id": "grid",
92
+ "type": "pattern",
93
+ "kind": "grid",
94
+ "divisions": 4,
95
+ "stroke": "0.3vmin",
96
+ "dash": "dotted",
97
+ "color": "#ffffff",
98
+ "opacity": 0.6
99
+ },
100
+ {
101
+ "id": "grain",
102
+ "type": "grain",
103
+ "amount": 0.08
104
+ },
105
+ {
106
+ "id": "title",
107
+ "type": "text",
108
+ "when": "title",
109
+ "content": "{title}",
110
+ "anchor": "bottom-left",
111
+ "weight": 500,
112
+ "size": {
113
+ "mul": [
114
+ "@u",
115
+ 0.066
116
+ ]
117
+ },
118
+ "minSize": {
119
+ "mul": [
120
+ "@u",
121
+ 0.048
122
+ ]
123
+ },
124
+ "lineHeight": 1.08,
125
+ "letterSpacing": -0.025,
126
+ "maxLines": 3,
127
+ "label": {
128
+ "if": "label",
129
+ "then": {
130
+ "color": "@text",
131
+ "content": "{label}"
132
+ }
133
+ }
134
+ }
135
+ ]
136
+ }