|
1
|
import type { BaseSpec, GradientStop } from "../../types.js" |
|
2
|
|
|
3
|
export type PillSpec = { |
|
4
|
/** Total height, rim included. */ |
|
5
|
height: number |
|
6
|
/** Distance from the pill's edge to the logomark. */ |
|
7
|
paddingLeft: number |
|
8
|
/** Distance from the end of the version text to the pill's edge. */ |
|
9
|
paddingRight: number |
|
10
|
/** Vertical offset from the centre of the canvas. */ |
|
11
|
offsetY: number |
|
12
|
borderWidth: number |
|
13
|
borderGradient: GradientStop[] |
|
14
|
fillGradient: GradientStop[] |
|
15
|
} |
|
16
|
|
|
17
|
export type ReleaseContentSpec = { |
|
18
|
/** Visible height of the logomark. */ |
|
19
|
logoHeight: number |
|
20
|
/** Space between the logomark and the version text. */ |
|
21
|
gap: number |
|
22
|
fontSize: number |
|
23
|
fontWeight: number |
|
24
|
letterSpacing: number |
|
25
|
/** Nudge to optically centre the version text against the logomark. */ |
|
26
|
textOffsetY: number |
|
27
|
logoGradient: GradientStop[] |
|
28
|
textGradient: GradientStop[] |
|
29
|
} |
|
30
|
|
|
31
|
export type ReleaseSpec = BaseSpec & { |
|
32
|
pill: PillSpec |
|
33
|
content: ReleaseContentSpec |
|
34
|
} |
|
35
|
|
|
36
|
/** |
|
37
|
* Design spec for the release banner. |
|
38
|
* |
|
39
|
* Every number was measured off the v2.13.0 banner, which is the reference this |
|
40
|
* template reproduces: |
|
41
|
* https://gh-release-images.s3.eu-north-1.amazonaws.com/v-2-13-0.jpg |
|
42
|
* |
|
43
|
* Sizes are in pixels at the reference resolution of 3200x1672. Override |
|
44
|
* `width` and everything scales proportionally. |
|
45
|
*/ |
|
46
|
export const RELEASE_SPEC: ReleaseSpec = { |
|
47
|
width: 3200, |
|
48
|
height: 1672, |
|
49
|
|
|
50
|
background: "#18171C", |
|
51
|
|
|
52
|
pill: { |
|
53
|
height: 536, |
|
54
|
paddingLeft: 147, |
|
55
|
paddingRight: 193, |
|
56
|
// The pill sits a hair above the centre of the canvas. |
|
57
|
offsetY: -4.5, |
|
58
|
borderWidth: 2, |
|
59
|
// The rim is brightest along the top and fades out towards the bottom. |
|
60
|
borderGradient: [ |
|
61
|
[0, "rgba(255, 255, 255, 0.53)"], |
|
62
|
[0.55, "rgba(255, 255, 255, 0.42)"], |
|
63
|
[1, "rgba(255, 255, 255, 0)"], |
|
64
|
], |
|
65
|
// A lifted grey at the top, easing down into the page background. |
|
66
|
fillGradient: [ |
|
67
|
[0, "#4A494F"], |
|
68
|
[0.1, "#414046"], |
|
69
|
[0.25, "#313036"], |
|
70
|
[0.44, "#26252A"], |
|
71
|
[0.57, "#1E1D22"], |
|
72
|
[0.72, "#18171C"], |
|
73
|
[1, "#18171C"], |
|
74
|
], |
|
75
|
}, |
|
76
|
|
|
77
|
content: { |
|
78
|
logoHeight: 230, |
|
79
|
// Smaller than the gap you measure off the finished image, because the "v" |
|
80
|
// carries its own left side bearing. |
|
81
|
gap: 83, |
|
82
|
fontSize: 258, |
|
83
|
fontWeight: 400, |
|
84
|
letterSpacing: -3.5, |
|
85
|
// Flexbox centres the full line box, which includes descender space the |
|
86
|
// version string never uses. This pulls the digits back onto the logo's |
|
87
|
// optical centre. |
|
88
|
textOffsetY: 4, |
|
89
|
// Top-to-bottom sheen. The two are specified separately because the text's |
|
90
|
// line box is taller than the logo's, so a shared pair of stops would not |
|
91
|
// land alike. |
|
92
|
logoGradient: [ |
|
93
|
[0, "#FEFEFE"], |
|
94
|
[1, "#BDBDBF"], |
|
95
|
], |
|
96
|
textGradient: [ |
|
97
|
[0, "#FDFDFD"], |
|
98
|
[1, "#BBBBBB"], |
|
99
|
], |
|
100
|
}, |
|
101
|
} |
|
102
|
|
|
103
|
/** The offset at which the pill's fill has resolved to the page background. */ |
|
104
|
export const FILL_RESOLVES_AT = 0.72 |