Adds apps/video, a standalone Remotion package (not part of the pnpm workspace, so it never reaches the web build or the Docker image). It renders six looping films, one per service, in German and English, as 4:5 for LinkedIn and 16:9 for YouTube and ads, together with the text to post and an overview page. Each film is one continuous shot: close on something abstract, the camera pulls back to show what it really is, the form changes, and the picture folds back into its opening. The slide deck code from the earlier attempts is still in the package and no longer used. Also adds the Google Ads concept, brings the relaunch concept in line with the site as built, and a project skill that describes how to make further films. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
/** Something that hops from stop to stop in an arc, round and round. A pure function of time. */
|
|
|
|
export type Point = { readonly x: number; readonly y: number };
|
|
|
|
const easeInOut = (t: number): number => (t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2);
|
|
const wrap = (index: number, length: number): number => ((index % length) + length) % length;
|
|
|
|
/**
|
|
* Where the hopper is at `time`. It rests on `stops[0]` at time 0, reaches the next stop every
|
|
* `framesPerHop`, and returns from the last stop to the first. The arc of a hop rises by
|
|
* `arcRatio` times the distance covered. Negative times are fine.
|
|
*/
|
|
export const hopAt = (time: number, stops: readonly Point[], framesPerHop: number, arcRatio: number): Point => {
|
|
const hop = Math.floor(time / framesPerHop);
|
|
const from = stops[wrap(hop, stops.length)];
|
|
const to = stops[wrap(hop + 1, stops.length)];
|
|
if (!from || !to) throw new Error("hopAt needs at least one stop");
|
|
const t = easeInOut(time / framesPerHop - hop);
|
|
const distance = Math.hypot(to.x - from.x, to.y - from.y);
|
|
return {
|
|
x: from.x + (to.x - from.x) * t,
|
|
y: from.y + (to.y - from.y) * t - Math.sin(Math.PI * t) * distance * arcRatio,
|
|
};
|
|
};
|