# Design This file fixes the timing and the motion. The font, and how the code is organised, are up to you. ## The timeline In frames, at 30 a second. `hold` is the `hold_seconds` input times 30, rounded to a whole frame. | | With a subtitle | Without | | --- | --- | --- | | Title arrives | 0 to 18 | 0 to 18 | | Subtitle arrives | 6 to 24 | | | Hold | 24 to `24 + hold` | 18 to `18 + hold` | | Both leave | the next 12 frames | the next 12 frames | | Length | `36 + hold` | `30 + hold` | At the defaults that is 96 frames, 3.2 seconds. Frames are numbered from 0, so the last frame is number 95. "Arrives 0 to 18" means the line is at its start in frame 0 and at rest from frame 18 on. The middle of the hold is frame `24 + hold / 2` with a subtitle and `18 + hold / 2` without, rounded down. ## The curves ``` ease_out(t) = 1 - (1 - t) * (1 - t) * (1 - t) ease_in(t) = t * t * t ``` For a line that starts arriving at frame `s`, at frame `f`: ``` t = (f - s) / 18, held between 0 and 1 opacity = ease_out(t) rise = 40 * (1 - ease_out(t)) pixels below its resting place ``` For the title, which starts at frame 0: | Frame | t | Opacity | Pixels below rest | | --- | --- | --- | --- | | 0 | 0 | 0 | 40 | | 3 | 0.166667 | 0.421296 | 23.148 | | 6 | 0.333333 | 0.703704 | 11.852 | | 9 | 0.5 | 0.875 | 5 | | 12 | 0.666667 | 0.962963 | 1.481 | | 18 | 1 | 1 | 0 | For leaving, with `e` the first frame of leaving: ``` t = (f - e + 1) / 12 opacity = 1 - ease_in(t) ``` The twelfth frame of leaving is the last frame of the piece. There `t` is 1 and the frame is empty. ## Contrast Contrast is measured as the web's accessibility guidelines do: each colour's relative luminance from its linear red, green and blue, then the lighter plus 0.05 over the darker plus 0.05. | Background | Foreground | Contrast | Allowed | | --- | --- | --- | --- | | `#17202b` | `#f4f6f3` | about 15.1 to 1 | yes | | `#777777` | `#888888` | about 1.3 to 1 | no | | `#000000` | `#ffffff` | 21 to 1 | yes | ## How to check a render - Read the size, the frame rate and the frame count from the file with a tool made for it, such as `ffprobe`. - Pull single frames out as PNG and read their pixels. - The top edge of the title is the first row, from the top, that holds a pixel differing from `background` by more than 8 levels in any channel. - Encoding changes pixels a little. Compare colours with the allowance each requirement gives, and hash frames taken from the renderer before encoding for R7. ## Named here - The middle of a title is character `(length - 1) / 2`, rounded down. Of two spaces equally near, the earlier is the break. - A still equals its frame when the mean difference per channel is under 4 and the largest is under 40, on a scale of 0 to 255. ## What this spec leaves to you Where this spec names something, use that name, so that two builds of it agree. Where it does not, the choice is yours. List what you chose in the README.