# Animated title card ## What this builds A short piece of video: a title rises into place and fades in, a subtitle follows, both hold, and both fade out. It is made from code, so the words, the colours and the shape are the person's, and the result can be checked frame by frame against this spec. Read `spekkr.inputs.json` first. The words are `title` and `subtitle`. They stay for `hold_seconds` seconds. The colours are `background` and `foreground`. `format` is the shape, `tool` what renders it, and `show_subtitle` whether there is a second line. ## Out of scope - Sound. - Pictures, logos and video behind the text. - More than one card in a row. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The frame - 30 frames a second. The size follows `format`: 1920 by 1080, 1080 by 1920 or 1080 by 1080. - Every pixel that is not text is `background`. - Text stays inside a safe area that leaves a tenth of the width and of the height free on every side. Accept when: the rendered file has the right size and frame rate, and at the middle of the hold no pixel outside the safe area differs from `background`. ### R2. The timeline - The title arrives over 18 frames. If `show_subtitle` is on, the subtitle starts 6 frames after the title and takes 18 frames too. - Both hold for `hold_seconds` times 30 frames, counted from when the last of them has arrived. - Both leave together over 12 frames. - The length is the sum, as `design.md` lays out: 96 frames at the defaults. Accept when: the rendered file has exactly the number of frames in `design.md` for the person's inputs, and for `hold_seconds` of 1 and of 3.5. ### R3. Arriving - While arriving, a line's opacity goes from 0 to 1 and it rises 40 pixels into its resting place. - Both follow the same curve, ease-out cubic, given in `design.md` with its value at six frames. Accept when: the function that drives the motion gives every value in the table in `design.md`, and in the render the title's top edge at frames 9 and 18 is where the table puts it, within 1 pixel. ### R4. Leaving - While leaving, opacity goes from 1 to 0 by ease-in cubic. The lines do not move. - The last frame is `background` and nothing else. Accept when: the first frame and the last frame are a single colour, equal to `background` within 2 levels of each channel. ### R5. The words - The title is centred across the frame. It is as large as fits the safe area's width on one line, up to a tenth of the frame's height. If it would be smaller than half that, it breaks onto two lines at the space nearest its middle. - The subtitle is one line, 40% of the title's size, centred, below the title. If it does not fit, it is cut at a word with an ellipsis. - Title and subtitle together are centred up and down. - The font is one that ships with the project, so a render needs no network and looks the same on any machine. Accept when: at the middle of the hold the block of text is centred within 2 pixels both ways, a title of 60 characters is on two lines, and a subtitle of 200 characters ends in an ellipsis inside the safe area. ### R6. Colours - `background` and `foreground` are `#rrggbb`. Anything else is refused before rendering, with a message. - A pair whose contrast is under 4.5 to 1 is refused too: the words would be hard to read. Accept when: `#17202b` with `#f4f6f3` renders, `#777777` with `#888888` is refused, and `blue` is refused. ### R7. The same every time - Rendering twice from the same inputs gives the same pixels in every frame. Accept when: frames 0, 9, 18, the middle of the hold and the last frame have the same hashes across two renders. ### R8. Files - An MP4 with H.264 video and no sound, playable in a browser. - A PNG of the middle of the hold, to use as a still. - One command that makes both from the inputs. Accept when: a tool that reads video files reports H.264, the size, 30 frames a second and the frame count, and the still equals that frame of the video within the loss of the encoding. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to install the tool, how to render, and how to change the words.