Become a Pro / full-access-films · becomeapro.ai / commits / dc219e53
App source: current code new
written by Branchwell · dc219e5391ebe41a7beacd8a2fe698e1aa27522e
47 files changed
.gitignore added
| 1 | + # Generated or large media: rebuild with tools/make.py and tools/deliver.sh | |
| 2 | + film-*/ | |
| 3 | + assets/ | |
| 4 | + checks/ | |
| 5 | + video/assets/ | |
| 6 | + video/renders/ | |
| 7 | + video/node_modules/ | |
| 8 | + node_modules/ | |
| 9 | + *.log | |
| 10 | + *.mp4 | |
| 11 | + *.m4a | |
| 12 | + *.wav | |
| 13 | + .env | |
| 14 | + .DS_Store |
LOOK.md added
| 1 | + # Look: AI Resource Pro tutorial films | |
| 2 | + | |
| 3 | + **Device: the object is the explanation.** One particle field runs the whole film, and it rebuilds into whatever the voice is explaining. The film doesn't show a picture of quantization; the brain's own particles snap to a coarser grid while you watch. Memory limits, card sizes and quantization rows are built from the same particles, lined up with real labels. | |
| 4 | + | |
| 5 | + **Why this is on brand.** It's the airesourcepro.com home page in motion: the same outlined triangles, the same blue ramp, the same burst between shapes, ported from the site's shaders. | |
| 6 | + | |
| 7 | + ## Tokens | |
| 8 | + | |
| 9 | + | Role | Value | | |
| 10 | + | --- | --- | | |
| 11 | + | Ground | #0D1117 | | |
| 12 | + | Ink | #F8FAFC | | |
| 13 | + | Quiet text | #A3ADBB | | |
| 14 | + | Card | #121922 with 2 px #2B3644 border | | |
| 15 | + | Accent | #7CC4F2 for one word or row per shot | | |
| 16 | + | Particle ramp | deep blue, #46AAE9, #BFE3FA, white | | |
| 17 | + | Display | Funnel Display 600 | | |
| 18 | + | Body | Geist 500 | | |
| 19 | + | Mono | Geist Mono 400 to 600 | | |
| 20 | + | Logotype | Poppins lockup from youtube/, never retyped | | |
| 21 | + | |
| 22 | + No purple, no yellow. Real footage keeps its own colors, including ComfyUI's. | |
| 23 | + | |
| 24 | + ## Rules | |
| 25 | + | |
| 26 | + - Hero of each shot fills at least 40% of the frame. | |
| 27 | + - Left margin 150 px. Key text stays inside the 5% safe area. | |
| 28 | + - Prompts sit on an opaque card at 44 px mono, with the part you'd change in sky blue. | |
| 29 | + - Real footage is never decorated: clips, the robot comparison and ComfyUI stay as captured, and only punch-ins and rings go over them. | |
| 30 | + - A label appears when the voice names the thing, and it holds dead still. | |
| 31 | + | |
| 32 | + ## Transitions, each with a cause | |
| 33 | + | |
| 34 | + 1. Particle burst with a blur swap on the words: the idea changes. | |
| 35 | + 2. Object becomes world: a small window opens from the particles to real footage. | |
| 36 | + 3. Carry across: the GPU stays in frame while the words change, for a change of topic that keeps its subject. | |
| 37 | + 4. Punch-in, or a hard cut on a result: a detail or an answer. |
claude.json added
| 1 | + [ | |
| 2 | + { | |
| 3 | + "id": "c01", | |
| 4 | + "text": "Claude Code can edit your project, drive Chrome and click through apps on your Mac. By default, it stops and asks a lot. Letting it run is where the time savings are, and it's also where a mistake gets expensive. So we'll climb one step at a time. You'll see each permission level, what it stops, and where I'd stop climbing." | |
| 5 | + }, | |
| 6 | + { | |
| 7 | + "id": "c02", | |
| 8 | + "text": "Step one is Manual. You review every action, which is right for code you don't know yet.", | |
| 9 | + "prev": "ing it run is where the time savings are, and it's also where a mistake gets expensive. So we'll climb one step at a time. You'll see each permission level, what it stops, and where I'd stop climbing." | |
| 10 | + }, | |
| 11 | + { | |
| 12 | + "id": "c03", | |
| 13 | + "text": "Step two is Auto, and this is where most people should stop. A classifier reviews actions, and by default it blocks things like downloading and running code, force pushes and production deploys.", | |
| 14 | + "prev": "Step one is Manual. You review every action, which is right for code you don't know yet." | |
| 15 | + }, | |
| 16 | + { | |
| 17 | + "id": "c04", | |
| 18 | + "text": "Step three is Bypass. It skips the prompts and the safety checks. Anthropic labels this for isolated containers and virtual machines only, and its warning adds no internet access. Take that seriously. People do run this way on their own machines, and I'm one of them, but it's a decision you make with your eyes open and not where you should start.", | |
| 19 | + "prev": "Step two is Auto, and this is where most people should stop. A classifier reviews actions, and by default it blocks things like downloading and running code, force pushes and production deploys." | |
| 20 | + }, | |
| 21 | + { | |
| 22 | + "id": "c05", | |
| 23 | + "text": "One more thing about prompts. Your prompt can be perfect and you can still get burned, because a hostile web page, document or on-screen message can steer the agent. So you control the machine, you scope the task, and you treat everything the agent reads as untrusted.", | |
| 24 | + "prev": "arning adds no internet access. Take that seriously. People do run this way on their own machines, and I'm one of them, but it's a decision you make with your eyes open and not where you should start." | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + "id": "c06", | |
| 28 | + "text": "Everything here happens in the desktop app. Choose your mode where you start a session. Bypass stays hidden until you turn on Allow bypass permissions mode in Settings. And you can't switch to bypass in a session that wasn't started with it enabled.", | |
| 29 | + "prev": " still get burned, because a hostile web page, document or on-screen message can steer the agent. So you control the machine, you scope the task, and you treat everything the agent reads as untrusted." | |
| 30 | + }, | |
| 31 | + { | |
| 32 | + "id": "c07", | |
| 33 | + "text": "While you're in Settings, these are the toggles I recommend. Connect new sessions to Remote Control, so every session can be continued from your phone. Let your phone and claude.ai start sessions here, so you can start work remotely. Those sessions can read, edit and run commands in your listed folders, so list only the folders you mean to.", | |
| 34 | + "prev": "e your mode where you start a session. Bypass stays hidden until you turn on Allow bypass permissions mode in Settings. And you can't switch to bypass in a session that wasn't started with it enabled." | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + "id": "c08", | |
| 38 | + "text": "Keep this computer awake for Remote Control, because a sleeping computer can't be reached until it wakes. Keep computer awake while Claude works, so long tasks can finish. Closing the laptop lid still sleeps it. Keep awake on battery power does the same on battery, at a battery cost.", | |
| 39 | + "prev": "ur phone. Let your phone and claude.ai start sessions here, so you can start work remotely. Those sessions can read, edit and run commands in your listed folders, so list only the folders you mean to." | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + "id": "c09", | |
| 43 | + "text": "Draw attention on notifications bounces the Dock icon when Claude needs you. Prompt suggestions offers a next prompt and adds a little to your usage. Dynamic workflows runs multiple agents in parallel, and it can use a lot of your usage limit quickly. And Switch models in Claude Code on this computer switches without asking when a message is flagged.", | |
| 44 | + "prev": "ached until it wakes. Keep computer awake while Claude works, so long tasks can finish. Closing the laptop lid still sleeps it. Keep awake on battery power does the same on battery, at a battery cost." | |
| 45 | + }, | |
| 46 | + { | |
| 47 | + "id": "c10", | |
| 48 | + "text": "Claude in Chrome lets Claude work in a real browser. Install the extension, sign in, then set it to Enabled by default so you don't have to turn it on each time.", | |
| 49 | + "prev": "namic workflows runs multiple agents in parallel, and it can use a lot of your usage limit quickly. And Switch models in Claude Code on this computer switches without asking when a message is flagged." | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "id": "c11", | |
| 53 | + "text": "Here's the test. Claude opens our local demo site and reads the heading, Trailhead Coffee. That proves the connection works end to end.", | |
| 54 | + "prev": "Claude in Chrome lets Claude work in a real browser. Install the extension, sign in, then set it to Enabled by default so you don't have to turn it on each time." | |
| 55 | + }, | |
| 56 | + { | |
| 57 | + "id": "c12", | |
| 58 | + "text": "Remember that this is your browser. If you're signed in to something, the agent can reach it too, so keep each task narrow.", | |
| 59 | + "prev": "Here's the test. Claude opens our local demo site and reads the heading, Trailhead Coffee. That proves the connection works end to end." | |
| 60 | + }, | |
| 61 | + { | |
| 62 | + "id": "c22", | |
| 63 | + "text": "So why use it? Think of anything you normally click through by hand because there's no API or MCP for it. Give it one narrow job in a cloud console like AWS or Azure, such as working through a long settings page and checking the result. It can fill in forms, upload files and pull data out of pages. When it hits a login page or a CAPTCHA, it pauses for you. And stay present for billing, credentials and security settings.", | |
| 64 | + "prev": "Remember that this is your browser. If you're signed in to something, the agent can reach it too, so keep each task narrow." | |
| 65 | + }, | |
| 66 | + { | |
| 67 | + "id": "c13", | |
| 68 | + "text": "Computer use goes further and controls apps on your Mac. In the desktop app, open Settings, then This computer, then System, and turn on computer use. It needs two macOS permissions: Accessibility, and Screen and System Audio Recording.", | |
| 69 | + "prev": "Remember that this is your browser. If you're signed in to something, the agent can reach it too, so keep each task narrow." | |
| 70 | + }, | |
| 71 | + { | |
| 72 | + "id": "c14", | |
| 73 | + "text": "Then you approve each app. Here Claude asks to use Calculator, and I allow it for this session. It clicks the buttons itself and gets 144.", | |
| 74 | + "prev": "ls apps on your Mac. In the desktop app, open Settings, then This computer, then System, and turn on computer use. It needs two macOS permissions: Accessibility, and Screen and System Audio Recording." | |
| 75 | + }, | |
| 76 | + { | |
| 77 | + "id": "c15", | |
| 78 | + "text": "That approval matters. Computer use runs on your real desktop, not in a sandbox. Browsers and trading platforms are view-only, and terminals and IDEs are click-only.", | |
| 79 | + "prev": "Then you approve each app. Here Claude asks to use Calculator, and I allow it for this session. It clicks the buttons itself and gets 144." | |
| 80 | + }, | |
| 81 | + { | |
| 82 | + "id": "c23", | |
| 83 | + "text": "So what is it for? Plenty of desktop software has no API or MCP, so Claude works the same interface you do. You could have it steer a timeline in Final Cut Pro, repeat an edit across files in Photoshop, change settings in an app, or move work between apps. Claude tries an MCP server, then the shell, then Chrome, and reaches for computer use when none of those apply.", | |
| 84 | + "prev": "That approval matters. Computer use runs on your real desktop, not in a sandbox. Browsers and trading platforms are view-only, and terminals and IDEs are click-only." | |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "id": "c16", | |
| 88 | + "text": "Three repairs cover most problems. If Chrome isn't detected, check the extension at chrome://extensions, reconnect it, then restart Claude and Chrome.", | |
| 89 | + "prev": "That approval matters. Computer use runs on your real desktop, not in a sandbox. Browsers and trading platforms are view-only, and terminals and IDEs are click-only." | |
| 90 | + }, | |
| 91 | + { | |
| 92 | + "id": "c17", | |
| 93 | + "text": "If the computer use permission keeps coming back, or it says permissions aren't enabled after you granted them, quit the app fully. A new permission often doesn't apply until a full restart. Then confirm both permissions in System Settings.", | |
| 94 | + "prev": "Three repairs cover most problems. If Chrome isn't detected, check the extension at chrome://extensions, reconnect it, then restart Claude and Chrome." | |
| 95 | + }, | |
| 96 | + { | |
| 97 | + "id": "c18", | |
| 98 | + "text": "If browser commands stop responding, look for an open dialog on the page. A dialog blocks browser events, so dismiss it and carry on.", | |
| 99 | + "prev": "ing back, or it says permissions aren't enabled after you granted them, quit the app fully. A new permission often doesn't apply until a full restart. Then confirm both permissions in System Settings." | |
| 100 | + }, | |
| 101 | + { | |
| 102 | + "id": "c19", | |
| 103 | + "text": "Three mistakes to avoid. In a terminal with bypass available, plan mode's blocks aren't enforced, so an edit attempted during planning can run without a prompt. Bypass also allows writes to protected paths, and allow rules have no effect there. And approving a terminal or IDE for computer use is the same as giving it shell access.", | |
| 104 | + "prev": "If browser commands stop responding, look for an open dialog on the page. A dialog blocks browser events, so dismiss it and carry on." | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + "id": "c20", | |
| 108 | + "text": "So add guardrails that hold. Deny rules block in every mode, including bypass, and so does a PreToolUse hook that denies. Use worktrees so unattended work stays apart from your main checkout.", | |
| 109 | + "prev": "ng can run without a prompt. Bypass also allows writes to protected paths, and allow rules have no effect there. And approving a terminal or IDE for computer use is the same as giving it shell access." | |
| 110 | + }, | |
| 111 | + { | |
| 112 | + "id": "c21", | |
| 113 | + "text": "Start on Auto, scope the task, treat what the agent reads as untrusted, and keep your deny rules in place. The full settings and repair lists are on the tutorial at airesourcepro.com, with links to Anthropic's docs.", | |
| 114 | + "prev": "So add guardrails that hold. Deny rules block in every mode, including bypass, and so does a PreToolUse hook that denies. Use worktrees so unattended work stays apart from your main checkout." | |
| 115 | + } | |
| 116 | + ] |
codex.json added
| 1 | + [ | |
| 2 | + { | |
| 3 | + "id": "a01", | |
| 4 | + "text": "Codex can now do more than edit code. It can open Chrome, click through Mac apps and work with far less supervision. All of that is switched on in the ChatGPT desktop app, and the top setting is one OpenAI itself lists as not recommended. So we'll climb one step at a time and stop where it makes sense." | |
| 5 | + }, | |
| 6 | + { | |
| 7 | + "id": "a02", | |
| 8 | + "text": "First, where to look. Codex now lives inside the ChatGPT desktop app. Switch to Codex, and you'll find the permissions control below the message box.", | |
| 9 | + "prev": " supervision. All of that is switched on in the ChatGPT desktop app, and the top setting is one OpenAI itself lists as not recommended. So we'll climb one step at a time and stop where it makes sense." | |
| 10 | + }, | |
| 11 | + { | |
| 12 | + "id": "a03", | |
| 13 | + "text": "Step one is Ask for approval. Work stays in your project, and leaving that boundary asks you first.", | |
| 14 | + "prev": "First, where to look. Codex now lives inside the ChatGPT desktop app. Switch to Codex, and you'll find the permissions control below the message box." | |
| 15 | + }, | |
| 16 | + { | |
| 17 | + "id": "a04", | |
| 18 | + "text": "Step two is Approve for me, and this is where I'd stop. It keeps the same sandbox, but eligible approval requests go through automatic review, and you're only asked about actions detected as potentially unsafe. The app notes that this may use more credits.", | |
| 19 | + "prev": "Step one is Ask for approval. Work stays in your project, and leaving that boundary asks you first." | |
| 20 | + }, | |
| 21 | + { | |
| 22 | + "id": "a05", | |
| 23 | + "text": "Step three is Full access: unrestricted access to the internet and any file on your computer, with no sandbox and no approvals. OpenAI lists it as not recommended, and says to loosen settings only for trusted repos or specific workflows.", | |
| 24 | + "prev": "It keeps the same sandbox, but eligible approval requests go through automatic review, and you're only asked about actions detected as potentially unsafe. The app notes that this may use more credits." | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + "id": "a06", | |
| 28 | + "text": "A good prompt doesn't fully protect you. A hostile page or document can steer the agent. So you control the machine, you scope the task, and you treat everything the agent reads as untrusted.", | |
| 29 | + "prev": "ed access to the internet and any file on your computer, with no sandbox and no approvals. OpenAI lists it as not recommended, and says to loosen settings only for trusted repos or specific workflows." | |
| 30 | + }, | |
| 31 | + { | |
| 32 | + "id": "a07", | |
| 33 | + "text": "If you don't see Approve for me, it wasn't in my menu either until I added one line to the Codex config file. It's on screen now. Quit the app, add it, and reopen.", | |
| 34 | + "prev": "A good prompt doesn't fully protect you. A hostile page or document can steer the agent. So you control the machine, you scope the task, and you treat everything the agent reads as untrusted." | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + "id": "a08", | |
| 38 | + "text": "Full access is hidden by default too. Press Command comma, open General, and find Permissions.", | |
| 39 | + "prev": "If you don't see Approve for me, it wasn't in my menu either until I added one line to the Codex config file. It's on screen now. Quit the app, add it, and reopen." | |
| 40 | + }, | |
| 41 | + { | |
| 42 | + "id": "a09", | |
| 43 | + "text": "Turn on Full access, and you get this warning. ChatGPT can access the internet and read and edit files without asking, including potentially destructive commands.", | |
| 44 | + "prev": "Full access is hidden by default too. Press Command comma, open General, and find Permissions." | |
| 45 | + }, | |
| 46 | + { | |
| 47 | + "id": "a10", | |
| 48 | + "text": "Confirming only adds it to the menu. It doesn't turn it on.", | |
| 49 | + "prev": "Turn on Full access, and you get this warning. ChatGPT can access the internet and read and edit files without asking, including potentially destructive commands." | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "id": "a11", | |
| 53 | + "text": "Here's the menu now, with Full access in red. I'm going to leave it alone and choose Approve for me.", | |
| 54 | + "prev": "Confirming only adds it to the menu. It doesn't turn it on." | |
| 55 | + }, | |
| 56 | + { | |
| 57 | + "id": "a12", | |
| 58 | + "text": "Then I'll ask Codex to add an Hours section to the site, and it finishes without stopping to ask.", | |
| 59 | + "prev": "Here's the menu now, with Full access in red. I'm going to leave it alone and choose Approve for me." | |
| 60 | + }, | |
| 61 | + { | |
| 62 | + "id": "a13", | |
| 63 | + "text": "There are two browsers here. Use @Browser for the built-in one. Use @Chrome when the work needs your real signed-in browser.", | |
| 64 | + "prev": "Then I'll ask Codex to add an Hours section to the site, and it finishes without stopping to ask." | |
| 65 | + }, | |
| 66 | + { | |
| 67 | + "id": "a14", | |
| 68 | + "text": "To set up Chrome, press Command comma, open Computer use, and click Install beside Google Chrome. Add the extension, sign in, and check that Chrome shows Manage.", | |
| 69 | + "prev": "There are two browsers here. Use @Browser for the built-in one. Use @Chrome when the work needs your real signed-in browser." | |
| 70 | + }, | |
| 71 | + { | |
| 72 | + "id": "a15", | |
| 73 | + "text": "Then test it. Codex opens the local demo site and reports the heading, Trailhead Coffee.", | |
| 74 | + "prev": "To set up Chrome, press Command comma, open Computer use, and click Install beside Google Chrome. Add the extension, sign in, and check that Chrome shows Manage." | |
| 75 | + }, | |
| 76 | + { | |
| 77 | + "id": "a16", | |
| 78 | + "text": "You can also allow or block individual sites. Allow for all sites removes the per-website prompt, and OpenAI marks it as elevated risk.", | |
| 79 | + "prev": "Then test it. Codex opens the local demo site and reports the heading, Trailhead Coffee." | |
| 80 | + }, | |
| 81 | + { | |
| 82 | + "id": "a27", | |
| 83 | + "text": "So why use it? Think of anything you normally click through by hand because there's no API or MCP for it. Give it one narrow job in a cloud console like AWS or Azure, such as working through a long settings page and checking the result. It can fill in forms and handle files, and Chrome's site permissions cover downloads and uploads. OpenAI says the built-in browser can't automate uploads, so use Chrome for those. And stay present for billing, credentials and security settings.", | |
| 84 | + "prev": "You can also allow or block individual sites. Allow for all sites removes the per-website prompt, and OpenAI marks it as elevated risk." | |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "id": "a17", | |
| 88 | + "text": "Computer use has its own page in Settings. Press Command comma, open Computer use, and turn on Any App. That's the switch that lets ChatGPT control the apps on your computer.", | |
| 89 | + "prev": "You can also allow or block individual sites. Allow for all sites removes the per-website prompt, and OpenAI marks it as elevated risk." | |
| 90 | + }, | |
| 91 | + { | |
| 92 | + "id": "a18", | |
| 93 | + "text": "macOS will ask for two permissions, Screen Recording and Accessibility, both for Codex Computer Use.", | |
| 94 | + "prev": "nd comma, open Computer use, and turn on Any App. That's the switch that lets ChatGPT control the apps on your computer." | |
| 95 | + }, | |
| 96 | + { | |
| 97 | + "id": "a19", | |
| 98 | + "text": "Then mention @Computer in your prompt. Codex asks to use Calculator. It clicks the buttons and gets 144.", | |
| 99 | + "prev": "macOS will ask for two permissions, Screen Recording and Accessibility, both for Codex Computer Use." | |
| 100 | + }, | |
| 101 | + { | |
| 102 | + "id": "a20", | |
| 103 | + "text": "Always allow carries into future tasks, so treat it as a standing permission and review that list now and then.", | |
| 104 | + "prev": "Then mention @Computer in your prompt. Codex asks to use Calculator. It clicks the buttons and gets 144." | |
| 105 | + }, | |
| 106 | + { | |
| 107 | + "id": "a28", | |
| 108 | + "text": "Computer use is for everything outside the browser. Plenty of desktop software has no API or MCP, so the agent works the same interface you do. You could have it steer a timeline in Final Cut Pro, repeat an edit across files in Photoshop, change settings in an app, or move work between apps. If an app has a plugin or MCP, use that first. Computer use is for everything else.", | |
| 109 | + "prev": "Always allow carries into future tasks, so treat it as a standing permission and review that list now and then." | |
| 110 | + }, | |
| 111 | + { | |
| 112 | + "id": "a21", | |
| 113 | + "text": "Now let's cover what to do when something breaks. Here's a failure I actually hit while recording this. Right after the install, Codex reported that Chrome's browser access host was unavailable. Quitting and reopening fixed it, and OpenAI's troubleshooting lists restarting the browser and then the desktop app. So if it can't reach Chrome, quit and reopen both.", | |
| 114 | + "prev": "Always allow carries into future tasks, so treat it as a standing permission and review that list now and then." | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + "id": "a22", | |
| 118 | + "text": "If Chrome still shows Install instead of Manage, go back to Settings, Computer use, and run the setup again.", | |
| 119 | + "prev": "ser access host was unavailable. Quitting and reopening fixed it, and OpenAI's troubleshooting lists restarting the browser and then the desktop app. So if it can't reach Chrome, quit and reopen both." | |
| 120 | + }, | |
| 121 | + { | |
| 122 | + "id": "a23", | |
| 123 | + "text": "If Codex can't see or control an app, open Privacy and Security in System Settings and check both permissions for Codex Computer Use.", | |
| 124 | + "prev": "If Chrome still shows Install instead of Manage, go back to Settings, Computer use, and run the setup again." | |
| 125 | + }, | |
| 126 | + { | |
| 127 | + "id": "a24", | |
| 128 | + "text": "Three things to watch. Under full access, web search moves to live results instead of cached ones, which raises your exposure to prompt injection. A site permission doesn't make that site's content trustworthy. And Computer Use acts outside your workspace, so keep each task narrow.", | |
| 129 | + "prev": "If Codex can't see or control an app, open Privacy and Security in System Settings and check both permissions for Codex Computer Use." | |
| 130 | + }, | |
| 131 | + { | |
| 132 | + "id": "a25", | |
| 133 | + "text": "For guardrails, put your standing rules in AGENTS.md, and allow, prompt or forbid specific commands instead of widening everything.", | |
| 134 | + "prev": " of cached ones, which raises your exposure to prompt injection. A site permission doesn't make that site's content trustworthy. And Computer Use acts outside your workspace, so keep each task narrow." | |
| 135 | + }, | |
| 136 | + { | |
| 137 | + "id": "a26", | |
| 138 | + "text": "Start on Approve for me, scope the task, treat what the agent reads as untrusted, and save Full access for work that truly needs it. The full lists are on the tutorial at airesourcepro.com, with links to OpenAI's docs.", | |
| 139 | + "prev": "For guardrails, put your standing rules in AGENTS.md, and allow, prompt or forbid specific commands instead of widening everything." | |
| 140 | + } | |
| 141 | + ] |
films/claude.py added
| 1 | + TITLE = "Claude Code Full Access" | |
| 2 | + SUB = "Permission modes, Chrome and computer use" | |
| 3 | + SUB_TOP = 510 | |
| 4 | + CREDIT = "Based on Anthropic's documentation. Tested in the Claude desktop app, November 2026." | |
| 5 | + SOURCES = {"cal": "11.02.27", "ch": "1.32.51", "set": "10.04.15", "sys": "10.57.28", "ext": "9.21.37", "men": "2.32.38"} | |
| 6 | + CROPS = {"cal": (580, 108, 929, 849), "ch": (236, 122, 1626, 875), "set": (525, 272, 1015, 705), "sys": (525, 180, 1015, 705), "ext": (950, 150, 920, 890), "men": (602, 320, 952, 661)} | |
| 7 | + A = "The ladder"; B = "Turn it on"; C = "Claude in Chrome"; D = "Computer use"; E = "When it breaks"; F = "Pitfalls and guardrails" | |
| 8 | + BEATS = [ | |
| 9 | + dict(id="c01", chap="Why this matters", layout="side", fit=False, shots=[("cal", 285.0, 303.0)], notes=[("drive chrome", "h", "Chrome. Your Mac. Fewer prompts."), ("climb one", "k", "One step at a time")]), | |
| 10 | + dict(id="c02", chap=A, layout="card", notes=[(0, "t", "1. Manual"), ("you review", "s", "You review every action. Right for code you don't know yet.")]), | |
| 11 | + dict(id="c03", chap=A, layout="card", shown=2, notes=[(0, "t", "1. Manual"), (0, "s", "You review every action. Right for code you don't know yet."), (0, "k", "2. Auto: stop here"), ("a classifier", "s", "A classifier reviews actions and blocks downloads that run code, force pushes and production deploys.")]), | |
| 12 | + dict(id="c04", chap=A, layout="card", shown=4, notes=[(0, "t", "1. Manual"), (0, "s", "You review every action. Right for code you don't know yet."), (0, "k", "2. Auto: stop here"), (0, "s", "A classifier reviews actions and blocks downloads that run code, force pushes and production deploys."), (0, "t", "3. Bypass"), ("anthropic labels", "s", "Anthropic: isolated containers and virtual machines only, with no internet access.")]), | |
| 13 | + dict(id="c05", chap=A, layout="card", notes=[(0, "h", "A good prompt isn't enough"), ("so you control", "t", "You control the machine"), ("you scope", "t", "You scope the task"), ("you treat", "k", "Everything it reads is untrusted")]), | |
| 14 | + dict(id="c06", chap=B, layout="side", shots=[("men", 1.8, 7.7), ("set", 24.0, 31.0, 0.5)], zooms=[("choose your", 1.4, 0.69, 0.75), (5.3, 1, 0.5, 0.5)], notes=[("choose your", "h", "Pick a mode as you start"), ("bypass stays", "t", "Bypass starts hidden"), ("allow bypass", "s", "Settings, Claude Code, Allow bypass permissions mode"), ("and you cant", "k", "Set it before the session starts")]), | |
| 15 | + dict(id="c07", chap=B, layout="side", shots=[("set", 12.0, 21.0, 0.5)], notes=[(0, "h", "Recommended toggles"), ("connect new", "t", "Connect new sessions to Remote Control"), ("let your phone", "t", "Let your phone and claude.ai start sessions"), ("list only", "k", "List only the folders you mean to")]), | |
| 16 | + dict(id="c08", chap=B, layout="side", shots=[("set", 21.0, 25.0, 0.5), ("set", 33.0, 40.0, 0.5)], notes=[(0, "t", "Keep this computer awake for Remote Control"), ("keep computer awake while", "t", "Keep computer awake while Claude works"), ("closing the", "s", "Closing the lid still sleeps it"), ("keep awake on", "s", "Keep awake on battery power costs battery")]), | |
| 17 | + dict(id="c09", chap=B, layout="side", shots=[("set", 30.0, 35.0, 0.6), ("set", 40.0, 45.0, 0.6), ("set", 48.0, 52.0, 0.6)], notes=[(0, "t", "Draw attention on notifications"), ("prompt suggestions", "t", "Prompt suggestions"), ("dynamic workflows", "t", "Dynamic workflows: heavy usage"), ("and switch", "t", "Switch models in Claude Code")]), | |
| 18 | + dict(id="c10", chap=C, layout="side", shots=[("ext", 30.0, 34.0), ("ext", 35.0, 39.5), ("ext", 135.0, 139.0)], notes=[(0, "h", "Claude in Chrome"), ("install the", "t", "Install the extension"), ("sign in", "t", "Sign in"), ("then set", "k", "Enabled by default")]), | |
| 19 | + dict(id="c11", chap=C, layout="wide", fit=True, shots=[("ch", 3.0, 5.5), ("ch", 12.0, 21.0, 4.5), ("ch", 33.0, 34.5), ("ch", 21.5, 25.0)], zooms=[(7.3, 1.4, 0.72, 0.3)], notes=[(0, "t", "Reads the heading: Trailhead Coffee")]), | |
| 20 | + dict(id="c12", chap=C, layout="card", notes=[(0, "h", "This is your browser"), ("if youre signed", "t", "Signed in? The agent can reach it too."), ("so keep", "k", "Keep each task narrow")]), | |
| 21 | + dict(id="c22", chap=C, layout="card", notes=[(0, "h", "Why use it"), ("anything you", "t", "Anything with no API or MCP"), ("cloud console", "t", "Long settings pages in AWS or Azure"), ("fill in forms", "t", "Forms, uploads, data from pages"), ("when it hits", "s", "It pauses at logins and CAPTCHAs"), ("stay present", "k", "Stay present for billing, credentials and security")]), | |
| 22 | + dict(id="c13", chap=D, layout="side", shots=[("sys", 25.0, 29.5), ("sys", 30.0, 33.0), ("sys", 34.0, 40.0), ("sys", 46.0, 50.0)], notes=[(0, "h", "Computer use"), ("open settings", "s", "Settings, This computer, System"), ("accessibility", "t", "Accessibility"), ("screen and system", "t", "Screen and System Audio Recording")]), | |
| 23 | + dict(id="c14", chap=D, layout="side", fit=False, shots=[("cal", 216.0, 219.5), ("cal", 288.0, 303.0, 3.5)], notes=[(0, "h", "Approve each app"), ("gets 144", "k", "12 × 12 = 144")]), | |
| 24 | + dict(id="c15", chap=D, layout="card", notes=[(0, "h", "Not a sandbox"), ("computer use runs", "t", "It runs on your real desktop"), ("browsers and", "s", "Browsers and trading platforms: view-only"), ("terminals and", "s", "Terminals and IDEs: click-only")]), | |
| 25 | + dict(id="c23", chap=D, layout="card", notes=[(0, "h", "What it's for"), ("plenty of", "t", "Desktop software with no API or MCP"), ("steer a timeline", "t", "Steer a timeline in Final Cut Pro"), ("repeat an edit", "t", "Repeat an edit in Photoshop"), ("change settings", "t", "Change settings, move work between apps"), ("claude tries", "k", "MCP, shell and Chrome come first")]), | |
| 26 | + dict(id="c16", chap=E, layout="card", notes=[(0, "h", "Chrome isn't detected"), ("check the extension", "c", "chrome://extensions"), ("reconnect it", "t", "Reconnect it, restart Claude and Chrome")]), | |
| 27 | + dict(id="c17", chap=E, layout="card", notes=[(0, "h", "Permissions keep coming back"), ("quit the app", "t", "Quit the app fully"), ("then confirm", "k", "Confirm both in System Settings")]), | |
| 28 | + dict(id="c18", chap=E, layout="card", notes=[(0, "h", "Browser commands stop responding"), ("look for", "t", "Look for an open dialog"), ("so dismiss", "k", "Dismiss it and carry on")]), | |
| 29 | + dict(id="c19", chap=F, layout="card", notes=[(0, "h", "Three mistakes"), ("in a terminal", "t", "Plan mode blocks aren't enforced in terminal bypass"), ("bypass also", "t", "Bypass writes to protected paths"), ("and approving", "t", "A terminal for computer use is shell access")]), | |
| 30 | + dict(id="c20", chap=F, layout="card", notes=[(0, "h", "Guardrails that hold"), ("deny rules", "t", "Deny rules block in every mode"), ("and so does", "t", "So does a denying PreToolUse hook"), ("use worktrees", "k", "Use worktrees for unattended work")]), | |
| 31 | + dict(id="c21", chap=F, layout="card", notes=[(0, "k", "Start on Auto"), ("scope the task", "t", "Scope the task"), ("treat what", "t", "Treat what it reads as untrusted"), ("and keep", "t", "Keep your deny rules in place"), ("the full", "s", "Full lists and Anthropic's docs at airesourcepro.com")]), | |
| 32 | + ] |
films/codex.py added
| 1 | + TITLE = "Codex Full Access" | |
| 2 | + SUB = "Sandbox, approvals, browser and computer use" | |
| 3 | + SUB_TOP = 510 | |
| 4 | + CREDIT = "Based on OpenAI's documentation. Tested in the ChatGPT desktop app, November 2026." | |
| 5 | + SOURCES = {"cth": "11.56.19", "perm": "12.20.11", "calc": "11.39.23", "ct": "11.56.19", "cu": "11.33.22"} | |
| 6 | + CROPS = {"cth": (1000, 170, 918, 582), "perm": (134, 129, 864, 848), "calc": (560, 166, 1356, 863), "ct": (135, 128, 1816, 852), "cu": (414, 140, 1260, 799)} | |
| 7 | + A = "The ladder"; B = "Turn it on"; C = "Browser use"; D = "Computer use"; E = "When it breaks"; F = "Pitfalls and guardrails" | |
| 8 | + BEATS = [ | |
| 9 | + dict(id="a01", chap="Why this matters", layout="wide", fit=False, shots=[("calc", 2.0, 24.8, 1.2)], notes=[("can open chrome", "t", "Chrome. Mac apps. Less supervision."), ("the top setting", "k", "Top setting: not recommended")]), | |
| 10 | + dict(id="a02", chap=A, layout="side", shots=[("perm", 52.3, 60.5, 0.8)], zooms=[("permissions control", 1.4, 0.39, 0.84)], notes=[("first", "h", "Where to look"), ("chatgpt desktop", "s", "ChatGPT desktop app, then Codex"), ("permissions control", "t", "Below the message box")]), | |
| 11 | + dict(id="a03", chap=A, layout="card", notes=[(0, "t", "1. Ask for approval"), ("work stays", "s", "Work stays in your project. Leaving it asks first.")]), | |
| 12 | + dict(id="a04", chap=A, layout="card", shown=2, notes=[(0, "t", "1. Ask for approval"), (0, "s", "Work stays in your project. Leaving it asks first."), (0, "k", "2. Approve for me: stop here"), ("it keeps", "s", "Same sandbox. Automatic review. May use more credits.")]), | |
| 13 | + dict(id="a05", chap=A, layout="card", shown=4, notes=[(0, "t", "1. Ask for approval"), (0, "s", "Work stays in your project. Leaving it asks first."), (0, "k", "2. Approve for me: stop here"), (0, "s", "Same sandbox. Automatic review. May use more credits."), (0, "t", "3. Full access"), ("openai lists", "s", "OpenAI: not recommended. Trusted repos or specific workflows only.")]), | |
| 14 | + dict(id="a06", chap=A, layout="card", notes=[(0, "h", "A good prompt isn't enough"), ("so you control", "t", "You control the machine"), ("you scope", "t", "You scope the task"), ("you treat", "k", "Everything it reads is untrusted")]), | |
| 15 | + dict(id="a07", chap=B, layout="card", notes=[(0, "h", "No Approve for me?"), ("one line", "c", 'approvals_reviewer = "auto_review"'), ("one line", "s", "Top of ~/.codex/config.toml"), ("quit the app", "t", "Quit, add it, reopen")]), | |
| 16 | + dict(id="a08", chap=B, layout="side", shots=[("perm", 14.5, 20.1), ("perm", 29.9, 30.5)], notes=[(0, "h", "Full access starts hidden"), ("press command", "c", "⌘ ,"), ("open general", "s", "Settings, General, Permissions")]), | |
| 17 | + dict(id="a09", chap=B, layout="side", shots=[("perm", 30.5, 36.7)], zooms=[("this warning", 1.4, 0.5, 0.5)], notes=[("this warning", "h", "Read the warning"), ("chatgpt can access", "s", "Internet, files, no approvals, destructive commands included.")]), | |
| 18 | + dict(id="a10", chap=B, layout="side", shots=[("perm", 36.8, 37.4)], zooms=[(0.2, 1, 0.5, 0.5)], notes=[(0, "t", "Confirm adds it to the menu."), ("it doesnt", "k", "It stays off.")]), | |
| 19 | + dict(id="a11", chap=B, layout="side", shots=[("perm", 52.3, 55.3), ("perm", 68.9, 72.0)], zooms=[(0, 1.4, 0.39, 0.84)], notes=[("im going", "h", "Leave Full access alone"), ("choose approve", "s", "Choose <span class='hit'>Approve for me</span>")]), | |
| 20 | + dict(id="a12", chap=B, layout="side", pre=1.5, fit=True, shots=[("perm", 85.6, 87.0), ("perm", 87.0, 98.6, 3.5), ("perm", 98.6, 100.1), ("perm", 116.0, 120.0)], zooms=[(-1.2, 1, 0.5, 0.5), (6.3, 1.4, 0.75, 0.55)], notes=[(0, "s", "The prompt"), ("add an hours", "c", "Add a short Hours section to index.html.")]), | |
| 21 | + dict(id="a13", chap=C, layout="card", notes=[(0, "h", "Two browsers"), ("use the at symbol with browser", "t", "@Browser: the built-in one"), ("use the at symbol with chrome", "k", "@Chrome: your real signed-in browser")]), | |
| 22 | + dict(id="a14", chap=C, layout="wide", shots=[("cu", 4.4, 7.4), ("cth", 12.0, 15.6), ("cth", 101.0, 104.0), ("cu", 7.0, 13.0)], notes=[(0, "t", "Settings, Computer use, Install"), ("check that", "k", "Look for Manage")]), | |
| 23 | + dict(id="a15", chap=C, layout="wide", fit=True, shots=[("ct", 272.0, 274.0), ("ct", 280.0, 290.0, 4), ("ct", 290.0, 292.5)], notes=[("then test", "t", "The heading comes back: Trailhead Coffee")]), | |
| 24 | + dict(id="a16", chap=C, layout="wide", shots=[("cu", 14.0, 23.0)], zooms=[(0.1, 1.7, 0.62, 0.72)], notes=[("you can also", "t", "Per-site allow and block"), ("allow for all", "k", "Allow for all sites: elevated risk")]), | |
| 25 | + dict(id="a27", chap=C, layout="card", notes=[(0, "h", "Why use it"), ("anything you", "t", "Anything with no API or MCP"), ("cloud console", "t", "Long settings pages in AWS or Azure"), ("fill in forms", "t", "Forms, downloads and uploads"), ("so use chrome", "s", "Uploads need Chrome, not the built-in browser"), ("stay present", "k", "Stay present for billing, credentials and security")]), | |
| 26 | + dict(id="a17", chap=D, layout="wide", shots=[("cu", 4.4, 10.8)], zooms=[("turn on any", 1.3, 0.6, 0.36)], notes=[(0, "t", "Settings, Computer use"), ("turn on any", "k", "Turn on Any App")]), | |
| 27 | + dict(id="a18", chap=D, layout="card", notes=[(0, "h", "Two macOS permissions"), ("screen recording", "t", "Screen Recording"), ("accessibility", "t", "Accessibility"), ("both for", "k", "Both for Codex Computer Use")]), | |
| 28 | + dict(id="a19", chap=D, layout="wide", fit=True, shots=[("calc", 0.0, 17.0, 2)], notes=[(0, "t", "Use @Computer in your prompt"), ("gets 144", "k", "12 × 12 = 144")]), | |
| 29 | + dict(id="a20", chap=D, layout="wide", shots=[("calc", 17.0, 24.8)], notes=[(0, "t", "Always allow carries forward"), ("review that", "k", "Review the list")]), | |
| 30 | + dict(id="a28", chap=D, layout="card", notes=[(0, "h", "Everything outside the browser"), ("plenty of", "t", "Desktop software with no API or MCP"), ("steer a timeline", "t", "Steer a timeline in Final Cut Pro"), ("repeat an edit", "t", "Repeat an edit in Photoshop"), ("change settings", "t", "Change settings, move work between apps"), ("if an app", "k", "Plugin or MCP first")]), | |
| 31 | + dict(id="a21", chap=E, layout="wide", fit=False, shots=[("ct", 168.0, 184.0, 2), ("ct", 184.0, 199.0), ("ct", 286.5, 291.0)], notes=[("right after", "t", "Browser access host unavailable"), ("so if", "k", "Quit and reopen both")]), | |
| 32 | + dict(id="a22", chap=E, layout="wide", shots=[("cu", 7.0, 13.0)], notes=[(0, "t", "Install instead of Manage?"), ("go back", "k", "Run the setup again")]), | |
| 33 | + dict(id="a23", chap=E, layout="card", notes=[(0, "h", "Can't see or control an app?"), ("open privacy", "t", "System Settings, Privacy & Security"), ("check both", "k", "Check both permissions")]), | |
| 34 | + dict(id="a24", chap=F, layout="card", notes=[(0, "h", "Three things to watch"), ("under full", "t", "Full access searches live results"), ("a site permission", "t", "Allowed doesn't mean trustworthy"), ("and computer use", "t", "Computer Use acts outside your workspace")]), | |
| 35 | + dict(id="a25", chap=F, layout="card", notes=[(0, "h", "Guardrails"), ("put your", "t", "Standing rules in AGENTS.md"), ("and allow", "t", "Allow, prompt or forbid specific commands")]), | |
| 36 | + dict(id="a26", chap=F, layout="card", notes=[(0, "k", "Start on Approve for me"), ("scope the task", "t", "Scope the task"), ("treat what", "t", "Treat what it reads as untrusted"), ("and save", "t", "Save Full access for work that needs it"), ("the full lists", "s", "Full lists and OpenAI's docs at airesourcepro.com")]), | |
| 37 | + ] |
films/extra.css added
| 1 | + | |
| 2 | + .chap { position: absolute; left: 150px; top: 960px; } | |
| 3 | + .win { position: absolute; overflow: hidden; border-radius: 20px; border: 2px solid var(--line); background: var(--card); } | |
| 4 | + .mv { position: absolute; left: 0; top: 0; } | |
| 5 | + .mv video { position: absolute; left: 0; top: 0; object-fit: fill; } | |
| 6 | + .nts-side { position: absolute; left: 150px; top: 170px; width: 590px; display: flex; flex-direction: column; gap: 30px; } | |
| 7 | + .nts-wide { position: absolute; left: 150px; right: 150px; top: 868px; display: flex; gap: 60px; align-items: baseline; } | |
| 8 | + .nts-card { position: absolute; left: 150px; right: 150px; top: 180px; display: flex; flex-direction: column; gap: 42px; } | |
| 9 | + .nt { opacity: 0; } | |
| 10 | + .nt-h { font-family: var(--display); font-weight: 600; font-size: 66px; line-height: 1.08; letter-spacing: -0.01em; color: var(--ink); } | |
| 11 | + .nt-t { font-family: var(--display); font-weight: 600; font-size: 56px; line-height: 1.14; color: var(--ink); } | |
| 12 | + .nt-s { font-family: var(--body); font-weight: 500; font-size: 38px; line-height: 1.3; color: var(--quiet); } | |
| 13 | + .nt-k { font-family: var(--display); font-weight: 600; font-size: 56px; line-height: 1.14; color: var(--sky); } | |
| 14 | + .nt-c { font-family: var(--mono); font-weight: 500; font-size: 42px; line-height: 1.4; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 24px 32px; align-self: flex-start; } | |
| 15 | + .nts-wide .nt-t, .nts-wide .nt-k { font-size: 44px; } | |
| 16 | + .nts-wide .nt-s { font-size: 34px; } | |
| 17 | + .nts-side .nt-c { font-size: 34px; } |
films/outro-logo.js added
| 1 | + const canvas = document.getElementById("logo3d"); | |
| 2 | + const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true, preserveDrawingBuffer: true }); | |
| 3 | + renderer.setPixelRatio(window.devicePixelRatio || 1); | |
| 4 | + renderer.setSize(1920, 1080, false); | |
| 5 | + const scene = new THREE.Scene(); | |
| 6 | + const camera = new THREE.PerspectiveCamera(30, 1920 / 1080, 1, 3000); | |
| 7 | + camera.position.z = 324; | |
| 8 | + scene.add(new THREE.AmbientLight(0xffffff, 0.9)); | |
| 9 | + const key = new THREE.DirectionalLight(0xffffff, 2.4); | |
| 10 | + key.position.set(-80, 90, 240); | |
| 11 | + scene.add(key); | |
| 12 | + const rim = new THREE.DirectionalLight(0x7cc4f2, 2.2); | |
| 13 | + rim.position.set(160, -40, 90); | |
| 14 | + scene.add(rim); | |
| 15 | + const logo = new THREE.Group(); | |
| 16 | + [["3 49.94 7.14 57.11 56.86 57.11 36.14 21.24 32 28.41 44.43 49.94", 0x46aae9], | |
| 17 | + ["56.86 57.11 61 49.94 36.14 6.89 15.43 42.76 23.71 42.76 36.14 21.24", 0x2a7fb8], | |
| 18 | + ["36.14 6.89 27.86 6.89 3 49.94 44.43 49.94 40.29 42.76 15.43 42.76", 0xffffff]].forEach(([points, color]) => { | |
| 19 | + const v = points.split(" ").map(Number), shape = new THREE.Shape(); | |
| 20 | + for (let i = 0; i < v.length; i += 2) { | |
| 21 | + const x = v[i] - 32, y = 32 - v[i + 1]; | |
| 22 | + i ? shape.lineTo(x, y) : shape.moveTo(x, y); | |
| 23 | + } | |
| 24 | + shape.closePath(); | |
| 25 | + const geometry = new THREE.ExtrudeGeometry(shape, { depth: 9, bevelEnabled: true, bevelSize: 0.5, bevelThickness: 0.7, bevelSegments: 3 }); | |
| 26 | + geometry.translate(0, 0, -4.5); | |
| 27 | + logo.add(new THREE.Mesh(geometry, new THREE.MeshStandardMaterial({ color, metalness: 0.2, roughness: 0.32 }))); | |
| 28 | + }); | |
| 29 | + logo.position.y = 26; | |
| 30 | + scene.add(logo); | |
| 31 | + const state = { spin: 0, idle: 0 }; | |
| 32 | + function draw() { | |
| 33 | + const left = 1 - state.spin; | |
| 34 | + logo.rotation.y = -Math.PI * 11.8 * Math.pow(left, 2.5) + (0.24 * Math.sin(state.idle * 2.4) + 0.1) * state.spin; | |
| 35 | + logo.rotation.x = -0.1 * state.spin; | |
| 36 | + logo.position.z = 243 * left; | |
| 37 | + logo.position.y = 26 * state.spin * state.spin; | |
| 38 | + key.position.x = -140 + 150 * state.idle; | |
| 39 | + renderer.render(scene, camera); | |
| 40 | + } | |
| 41 | + tl.fromTo("#logo3d", { opacity: 0 }, { opacity: 1, duration: 0.5, ease: "none" }, 2.35); | |
| 42 | + tl.to(state, { spin: 1, duration: 3.2, ease: "power1.out" }, 1.91); | |
| 43 | + tl.to(state, { idle: 1, duration: DURATION, ease: "none" }, 0); | |
| 44 | + tl.eventCallback("onUpdate", draw); | |
| 45 | + draw(); |
script.json added
| 1 | + [ | |
| 2 | + { | |
| 3 | + "id": "b01", | |
| 4 | + "text": "Full access is hidden by default. Press Command comma, open General, and find Permissions.", | |
| 5 | + "speed": 1.08 | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "id": "b02", | |
| 9 | + "text": "Turn on Full access, and you get this warning. ChatGPT can access the internet and read and edit files without asking, including potentially destructive commands.", | |
| 10 | + "speed": 1.08 | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "id": "b03", | |
| 14 | + "text": "Confirming only adds it to the menu. It doesn't turn it on.", | |
| 15 | + "speed": 1.08 | |
| 16 | + }, | |
| 17 | + { | |
| 18 | + "id": "b04", | |
| 19 | + "text": "Here's the menu now, with Full access in red. I'm going to leave it alone and choose Approve for me.", | |
| 20 | + "speed": 1.08 | |
| 21 | + }, | |
| 22 | + { | |
| 23 | + "id": "b05", | |
| 24 | + "text": "Then I'll ask Codex to add an Hours section to the site, and it finishes without stopping to ask.", | |
| 25 | + "speed": 1.08 | |
| 26 | + } | |
| 27 | + ] |
tools/build_film.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Build the film from video/scenes/film.scenes and video/scenes/cues.tpl.js. | |
| 3 | + | |
| 4 | + python3 tools/build_film.py | |
| 5 | + | |
| 6 | + Every time in a scene is a phrase in the voiceover, so changing a take retimes the film: | |
| 7 | + @{b09:16 bits} start of that phrase, in scene time | |
| 8 | + @{b09:16 bits+0.2} with an offset; #2 picks the second match (@{b06:network volume#2}) | |
| 9 | + @{b09:start} @{b09:end} @{end} @{end-0.25} | |
| 10 | + Writes compositions/, index.html, assets/cues.js and assets/timeline.json. | |
| 11 | + """ | |
| 12 | + import json, os, re, sys | |
| 13 | + | |
| 14 | + ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") | |
| 15 | + VIDEO = os.path.join(ROOT, "video") | |
| 16 | + VO = os.path.join(ROOT, "assets", "vo", "film") | |
| 17 | + LEAD_IN = 1.2 | |
| 18 | + HOLD_AFTER = {"b01": 0.4, "b02": 0.4, "b03": 0.4, "b04": 1.51, "b05": 7.791} | |
| 19 | + | |
| 20 | + | |
| 21 | + def norm(word): | |
| 22 | + return re.sub(r"[^a-z0-9]", "", word.lower()) | |
| 23 | + | |
| 24 | + | |
| 25 | + def load_beats(): | |
| 26 | + beats, clock = {}, LEAD_IN | |
| 27 | + for beat, hold in HOLD_AFTER.items(): | |
| 28 | + words = json.load(open(os.path.join(VO, beat + ".words.json"))) | |
| 29 | + for word in words: | |
| 30 | + word["key"] = norm(word["word"]) | |
| 31 | + words = [w for w in words if w["key"]] | |
| 32 | + length = words[-1]["end"] | |
| 33 | + beats[beat] = {"start": clock, "length": length, "words": words} | |
| 34 | + clock += length + hold | |
| 35 | + return beats, clock | |
| 36 | + | |
| 37 | + | |
| 38 | + def phrase_time(beats, beat, phrase): | |
| 39 | + phrase, _, nth = phrase.partition("#") | |
| 40 | + data = beats[beat] | |
| 41 | + if phrase == "start": | |
| 42 | + return data["start"] | |
| 43 | + if phrase == "end": | |
| 44 | + return data["start"] + data["length"] | |
| 45 | + wanted = [norm(w) for w in phrase.split()] | |
| 46 | + keys = [w["key"] for w in data["words"]] | |
| 47 | + hits = [i for i in range(len(keys) - len(wanted) + 1) if keys[i : i + len(wanted)] == wanted] | |
| 48 | + if len(hits) < int(nth or 1): | |
| 49 | + sys.exit(f"no match for '{phrase}' in {beat}") | |
| 50 | + return data["start"] + data["words"][hits[int(nth or 1) - 1]]["start"] | |
| 51 | + | |
| 52 | + | |
| 53 | + def resolve(beats, expr, scene=None): | |
| 54 | + match = re.fullmatch(r"\s*(?:(b\d\d):)?(.*?)\s*([+-]\s*\d+(?:\.\d+)?)?\s*", expr) | |
| 55 | + beat, name, offset = match.groups() | |
| 56 | + offset = float(offset.replace(" ", "")) if offset else 0.0 | |
| 57 | + if beat: | |
| 58 | + value = phrase_time(beats, beat, name) | |
| 59 | + if scene: | |
| 60 | + value -= scene["start"] | |
| 61 | + elif name == "end": | |
| 62 | + value = scene["duration"] | |
| 63 | + else: | |
| 64 | + value = float(name or 0) | |
| 65 | + return value + offset | |
| 66 | + | |
| 67 | + | |
| 68 | + def fill(beats, text, scene=None): | |
| 69 | + return re.sub(r"@\{([^}]+)\}", lambda m: f"{resolve(beats, m.group(1), scene):.3f}", text) | |
| 70 | + | |
| 71 | + | |
| 72 | + def parse_scenes(beats, total): | |
| 73 | + source = open(os.path.join(VIDEO, "scenes", "film.scenes")).read() | |
| 74 | + blocks = re.split(r"^=== ", source, flags=re.M)[1:] | |
| 75 | + scenes = [] | |
| 76 | + for block in blocks: | |
| 77 | + head, _, rest = block.partition("\n") | |
| 78 | + name, _, start = head.partition("|") | |
| 79 | + markup, _, script = rest.partition("\n---\n") | |
| 80 | + scenes.append({"id": name.strip(), "start": resolve(beats, start.strip().strip("@{}")), "markup": markup, "script": script}) | |
| 81 | + for scene, following in zip(scenes, scenes[1:] + [None]): | |
| 82 | + scene["duration"] = (following["start"] if following else total) - scene["start"] | |
| 83 | + if scene["duration"] <= 0: | |
| 84 | + sys.exit(f"scene {scene['id']} has no length") | |
| 85 | + return scenes | |
| 86 | + | |
| 87 | + | |
| 88 | + def write_scene(beats, scene): | |
| 89 | + markup = fill(beats, scene["markup"], scene) | |
| 90 | + script = fill(beats, scene["script"], scene) | |
| 91 | + style = "\n".join(re.findall(r"<style>(.*?)</style>", markup, flags=re.S)) | |
| 92 | + markup = re.sub(r"<style>.*?</style>\s*", "", markup, flags=re.S).strip() | |
| 93 | + page = f"""<template> | |
| 94 | + <style> | |
| 95 | + #root {{ position: absolute; inset: 0; }} | |
| 96 | + {style} | |
| 97 | + </style> | |
| 98 | + <div id="root" data-composition-id="{scene['id']}" data-width="1920" data-height="1080"> | |
| 99 | + {markup} | |
| 100 | + </div> | |
| 101 | + <script> | |
| 102 | + (() => {{ | |
| 103 | + const tl = gsap.timeline({{ paused: true }}); | |
| 104 | + const {{ land, rise, leave, card, cardOut, mark, open, camera }} = Film(tl); | |
| 105 | + {script.strip()} | |
| 106 | + window.__timelines["{scene['id']}"] = tl; | |
| 107 | + }})(); | |
| 108 | + </script> | |
| 109 | + </template> | |
| 110 | + """ | |
| 111 | + open(os.path.join(VIDEO, "compositions", scene["id"] + ".html"), "w").write(page) | |
| 112 | + | |
| 113 | + | |
| 114 | + def write_index(scenes, total): | |
| 115 | + hosts = [f' <div id="field" data-composition-id="field" data-composition-src="compositions/field.html" data-start="0" data-duration="{total:.3f}" data-track-index="0" data-track-kind="graphics" data-width="1920" data-height="1080"></div>'] | |
| 116 | + for scene in scenes: | |
| 117 | + hosts.append(f' <div id="{scene["id"]}" data-composition-id="{scene["id"]}" data-composition-src="compositions/{scene["id"]}.html" data-start="{scene["start"]:.3f}" data-duration="{scene["duration"]:.3f}" data-track-index="1" data-track-kind="graphics" data-width="1920" data-height="1080"></div>') | |
| 118 | + if os.path.exists(os.path.join(VIDEO, "assets", "mix.m4a")): | |
| 119 | + hosts.append(f' <audio id="mix" class="clip" src="assets/mix.m4a" data-start="0" data-duration="{total:.3f}" data-track-index="2" data-volume="1"></audio>') | |
| 120 | + page = """<!doctype html> | |
| 121 | + <html lang="en"> | |
| 122 | + <head> | |
| 123 | + <meta charset="UTF-8" /> | |
| 124 | + <meta name="viewport" content="width=1920, height=1080" /> | |
| 125 | + <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script> | |
| 126 | + <script src="assets/cues.js"></script> | |
| 127 | + <script src="assets/film.js"></script> | |
| 128 | + <link rel="stylesheet" href="assets/film.css" /> | |
| 129 | + </head> | |
| 130 | + <body> | |
| 131 | + <div id="root" data-composition-id="main" data-start="0" data-duration="%.3f" data-width="1920" data-height="1080" data-fps="30"> | |
| 132 | + %s | |
| 133 | + </div> | |
| 134 | + <script> | |
| 135 | + window.__timelines = window.__timelines || {}; | |
| 136 | + window.__timelines["main"] = gsap.timeline({ paused: true }); | |
| 137 | + </script> | |
| 138 | + </body> | |
| 139 | + </html> | |
| 140 | + """ % (total, "\n".join(hosts)) | |
| 141 | + open(os.path.join(VIDEO, "index.html"), "w").write(page) | |
| 142 | + | |
| 143 | + | |
| 144 | + def main(): | |
| 145 | + beats, total = load_beats() | |
| 146 | + scenes = parse_scenes(beats, total) | |
| 147 | + for name in os.listdir(os.path.join(VIDEO, "compositions")): | |
| 148 | + if name != "field.html": | |
| 149 | + os.remove(os.path.join(VIDEO, "compositions", name)) | |
| 150 | + for scene in scenes: | |
| 151 | + write_scene(beats, scene) | |
| 152 | + cues = fill(beats, open(os.path.join(VIDEO, "scenes", "cues.tpl.js")).read()) | |
| 153 | + open(os.path.join(VIDEO, "assets", "cues.js"), "w").write(f"window.FILM_SECONDS = {total:.3f};\n" + cues) | |
| 154 | + write_index(scenes, total) | |
| 155 | + timeline = {"total": total, "beats": {k: {"start": v["start"], "length": v["length"]} for k, v in beats.items()}, "scenes": [{"id": s["id"], "start": s["start"], "duration": s["duration"]} for s in scenes]} | |
| 156 | + json.dump(timeline, open(os.path.join(VIDEO, "assets", "timeline.json"), "w"), indent=1) | |
| 157 | + print(f"{total:.1f} s ({total/60:.2f} min), {len(scenes)} scenes") | |
| 158 | + for s in scenes: | |
| 159 | + print(f" {s['id']:12} {s['start']:7.2f} {s['duration']:6.2f}") | |
| 160 | + | |
| 161 | + | |
| 162 | + main() |
tools/deliver.sh added
| 1 | + #!/bin/bash | |
| 2 | + # deliver.sh <name> <1080|4k>: renders film-<name>, puts the checked mix back on, and makes a phone copy at 1080. | |
| 3 | + set -e | |
| 4 | + cd "$(dirname "$0")/../film-$1" | |
| 5 | + out=../video/renders | |
| 6 | + if [ "$2" = 1080 ]; then | |
| 7 | + npx hyperframes render --quality delivery --video-frame-format png -o "$out/.$1-1080.mp4" | |
| 8 | + ffmpeg -y -v error -i "$out/.$1-1080.mp4" -i assets/mix.m4a -map 0:v -map 1:a -c copy -movflags +faststart "$out/$1-full-access-1080p.mp4" | |
| 9 | + rm "$out/.$1-1080.mp4" | |
| 10 | + secs=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$out/$1-full-access-1080p.mp4") | |
| 11 | + kbps=$(python3 -c "print(int(19.5*8192/$secs-64))") | |
| 12 | + ffmpeg -y -v error -i "$out/$1-full-access-1080p.mp4" -vf scale=-2:540 -c:v libx264 -b:v ${kbps}k -pass 1 -passlogfile "/tmp/$1pass" -an -f null /dev/null | |
| 13 | + ffmpeg -y -v error -i "$out/$1-full-access-1080p.mp4" -vf scale=-2:540 -c:v libx264 -b:v ${kbps}k -pass 2 -passlogfile "/tmp/$1pass" -c:a aac -b:a 64k -movflags +faststart "$out/$1-full-access-phone.mp4" | |
| 14 | + echo STAGE 1080 done | |
| 15 | + else | |
| 16 | + npx hyperframes render --resolution 4k --fps 60 --quality delivery --video-frame-format png -o "$out/.$1-4k.mp4" | |
| 17 | + ffmpeg -y -v error -i "$out/.$1-4k.mp4" -i assets/mix.m4a -map 0:v -map 1:a -c copy -movflags +faststart "$out/$1-full-access-4k60.mp4" | |
| 18 | + rm "$out/.$1-4k.mp4" | |
| 19 | + echo STAGE 4k done | |
| 20 | + fi |
tools/make.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Build a full-access film from films/<name>.py: python3 tools/make.py <name> | |
| 3 | + | |
| 4 | + Fits every beat's footage to Eric's narration, writes the HyperFrames project to film-<name>/, and mixes voice with Slow Render. | |
| 5 | + """ | |
| 6 | + import glob, hashlib, html, importlib.util, json, os, re, shutil, subprocess, sys | |
| 7 | + | |
| 8 | + ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | |
| 9 | + os.chdir(ROOT) | |
| 10 | + NAME = sys.argv[1] | |
| 11 | + spec = importlib.util.spec_from_file_location("film", f"films/{NAME}.py") | |
| 12 | + FILM = importlib.util.module_from_spec(spec); spec.loader.exec_module(FILM) | |
| 13 | + OUT = f"film-{NAME}" | |
| 14 | + VOICE = f"assets/vo/{NAME}" | |
| 15 | + FOOTAGE = "/Users/Shared/airp-recordings/footage" | |
| 16 | + MUSIC = "/Volumes/Expand/Video/Motion Projects/airp-runpod-comfyui/assets/suno/Slow Render.wav" | |
| 17 | + TITLE_SECONDS = 3.6 | |
| 18 | + END_SECONDS = 8.3 | |
| 19 | + GAP = 0.55 | |
| 20 | + SIDE = (970, 955, 800, 62) | |
| 21 | + WIDE = (1620, 800, 150, 46) | |
| 22 | + | |
| 23 | + | |
| 24 | + def norm(word): | |
| 25 | + return re.sub(r"[^a-z0-9]", "", word.lower()) | |
| 26 | + | |
| 27 | + | |
| 28 | + def words(beat_id): | |
| 29 | + return json.load(open(f"{VOICE}/{beat_id}.words.json")) | |
| 30 | + | |
| 31 | + | |
| 32 | + def phrase_time(beat_id, phrase): | |
| 33 | + w = [x for x in words(beat_id) if norm(x["word"])] | |
| 34 | + keys = [norm(x["word"]) for x in w] | |
| 35 | + want = [norm(x) for x in phrase.split()] | |
| 36 | + for i in range(len(keys) - len(want) + 1): | |
| 37 | + if keys[i:i + len(want)] == want: | |
| 38 | + return w[i]["start"] | |
| 39 | + sys.exit(f"no '{phrase}' in {beat_id}: {' '.join(keys)}") | |
| 40 | + | |
| 41 | + | |
| 42 | + def shot_seconds(shot): | |
| 43 | + return (shot[2] - shot[1]) / (shot[3] if len(shot) > 3 else 1) | |
| 44 | + | |
| 45 | + | |
| 46 | + def box_for(beat): | |
| 47 | + x = FILM.CROPS[beat["shots"][0][0]] | |
| 48 | + ratio = x[2] / x[3] | |
| 49 | + w0, h0, l0, t0 = SIDE if beat["layout"] == "side" else WIDE | |
| 50 | + w, h = (w0, round(w0 / ratio)) if w0 / ratio <= h0 else (round(h0 * ratio), h0) | |
| 51 | + return w, h, l0 + (w0 - w) // 2, t0 + (h0 - h) // 2 | |
| 52 | + | |
| 53 | + | |
| 54 | + def cut_clip(beat, duration): | |
| 55 | + w, h, _, _ = box_for(beat) | |
| 56 | + zoom = max([z[1] for z in beat.get("zooms", [])] + [1]) | |
| 57 | + pixels_w = round(w * 2 * zoom / 2) * 2 | |
| 58 | + pixels_h = round(h * 2 * zoom / 2) * 2 | |
| 59 | + shots = list(beat["shots"]) | |
| 60 | + total = sum(shot_seconds(s) for s in shots) | |
| 61 | + key = hashlib.sha1(json.dumps([shots, duration, pixels_w, pixels_h, FILM.CROPS, FILM.SOURCES, "sharp"]).encode()).hexdigest()[:12] | |
| 62 | + path = f"{OUT}/assets/clips/{beat['id']}-{key}.mp4" | |
| 63 | + if os.path.exists(path): | |
| 64 | + return path | |
| 65 | + args, filters, labels, inputs = ["ffmpeg", "-y", "-v", "error"], [], [], {} | |
| 66 | + used = 0.0 | |
| 67 | + for i, shot in enumerate(shots): | |
| 68 | + src, a, b = shot[:3] | |
| 69 | + speed = shot[3] if len(shot) > 3 else 1 | |
| 70 | + room = duration - used | |
| 71 | + length = (b - a) / speed | |
| 72 | + if length > room: | |
| 73 | + b = a + room * speed; length = room | |
| 74 | + hold = room - length if i == len(shots) - 1 else 0 | |
| 75 | + if length <= 0.02: | |
| 76 | + continue | |
| 77 | + if src not in inputs: | |
| 78 | + inputs[src] = len(inputs) | |
| 79 | + args += ["-i", glob.glob(f"{FOOTAGE}/*{FILM.SOURCES[src]}*.mov")[0]] | |
| 80 | + x, y, cw, ch = FILM.CROPS[src] | |
| 81 | + pad = f",tpad=stop_mode=clone:stop_duration={hold:.3f}" if hold > 0.02 else "" | |
| 82 | + filters.append(f"[{inputs[src]}:v]trim={a:.3f}:{b:.3f},setpts=(PTS-STARTPTS)/{speed},fps=30,crop={cw}:{ch}:{x}:{y},scale={pixels_w}:{pixels_h}:force_original_aspect_ratio=decrease:flags=lanczos,unsharp=5:5:0.7:5:5:0,pad={pixels_w}:{pixels_h}:(ow-iw)/2:(oh-ih)/2:0x121922,setsar=1,format=yuv420p{pad}[v{i}]") | |
| 83 | + labels.append(f"[v{i}]") | |
| 84 | + used += length | |
| 85 | + filters.append("".join(labels) + f"concat=n={len(labels)}:v=1:a=0[o]") | |
| 86 | + subprocess.run(args + ["-filter_complex", ";".join(filters), "-map", "[o]", "-c:v", "libx264", "-crf", "12", "-preset", "medium", "-g", "15", path], check=True) | |
| 87 | + return path | |
| 88 | + | |
| 89 | + | |
| 90 | + def schedule(): | |
| 91 | + clock = TITLE_SECONDS | |
| 92 | + timeline = [] | |
| 93 | + for beat in FILM.BEATS: | |
| 94 | + length = words(beat["id"])[-1]["end"] | |
| 95 | + pre = beat.get("pre", 0) | |
| 96 | + scene_start = clock | |
| 97 | + voice_start = clock + pre | |
| 98 | + needed = sum(shot_seconds(s) for s in beat["shots"]) if beat.get("fit") else 0 | |
| 99 | + duration = max(pre + length + GAP, needed) | |
| 100 | + timeline.append({**beat, "start": scene_start, "voice": voice_start, "length": length, "duration": duration}) | |
| 101 | + clock += duration | |
| 102 | + return timeline, clock | |
| 103 | + | |
| 104 | + | |
| 105 | + def note_html(beat, i, note): | |
| 106 | + kind, text = note[1], note[2] | |
| 107 | + shown = ' style="opacity:1"' if i < beat.get("shown", 0) else "" | |
| 108 | + return f'<div id="{beat["id"]}-n{i}" class="nt nt-{kind}"{shown}>{text}</div>' | |
| 109 | + | |
| 110 | + | |
| 111 | + def scene_page(beat, clip): | |
| 112 | + bid = beat["id"] | |
| 113 | + duration = beat["duration"] | |
| 114 | + pre = beat.get("pre", 0) | |
| 115 | + at = lambda phrase: pre + (phrase if isinstance(phrase, (int, float)) else phrase_time(bid, phrase)) | |
| 116 | + body, script = [], [] | |
| 117 | + style = "" | |
| 118 | + if beat.get("chap"): | |
| 119 | + body.append(f'<div id="{bid}-tag" class="tag chap">{beat["chap"]}</div>') | |
| 120 | + if clip: | |
| 121 | + w, h, left, top = box_for(beat) | |
| 122 | + src = clip.split("/", 1)[1] | |
| 123 | + body.append(f'<div id="{bid}-win" class="win" style="left:{left}px;top:{top}px;width:{w}px;height:{h}px"><div id="{bid}-mv" class="mv" style="width:{w}px;height:{h}px"><video id="{bid}-v" class="clip" src="{src}" data-start="0" data-duration="{duration:.3f}" muted playsinline style="width:{w}px;height:{h}px"></video></div></div>') | |
| 124 | + if beat.get("open"): | |
| 125 | + script.append(f'open("#{bid}-win", 0.02);') | |
| 126 | + for z in beat.get("zooms", []): | |
| 127 | + t, s, fx, fy = z | |
| 128 | + x = max(w - s * w, min(0, w / 2 - s * fx * w)) | |
| 129 | + y = max(h - s * h, min(0, h / 2 - s * fy * h)) | |
| 130 | + script.append(f'camera("#{bid}-mv", {at(t) - 0.3:.3f}, {s}, {x:.1f}, {y:.1f}, 0.9);') | |
| 131 | + wrap = "nts-side" if beat["layout"] == "side" else ("nts-wide" if beat["layout"] == "wide" else "nts-card") | |
| 132 | + notes = beat.get("notes", []) | |
| 133 | + body.append(f'<div id="{bid}-col" class="{wrap}">' + "".join(note_html(beat, i, n) for i, n in enumerate(notes)) + "</div>") | |
| 134 | + pre_shown = beat.get("shown", 0) | |
| 135 | + for i, n in enumerate(notes): | |
| 136 | + target = f"#{bid}-n{i}" | |
| 137 | + if i < pre_shown: | |
| 138 | + continue | |
| 139 | + script.append(f'land("{target}", {at(n[0]):.3f});') | |
| 140 | + if notes and not beat.get("stay"): | |
| 141 | + script.append(f'leave("#{bid}-col", {duration - 0.25:.3f});') | |
| 142 | + page = f"""<template> | |
| 143 | + <style> | |
| 144 | + #root {{ position: absolute; inset: 0; }} | |
| 145 | + </style> | |
| 146 | + <div id="root" data-composition-id="{bid}" data-width="1920" data-height="1080"> | |
| 147 | + {''.join(body)} | |
| 148 | + </div> | |
| 149 | + <script> | |
| 150 | + (() => {{ | |
| 151 | + const tl = gsap.timeline({{ paused: true }}); | |
| 152 | + const {{ land, rise, leave, card, cardOut, mark, open, camera }} = Film(tl); | |
| 153 | + {' '.join(script)} | |
| 154 | + tl.to({{}}, {{ duration: {duration:.3f} }}, 0); | |
| 155 | + window.__timelines["{bid}"] = tl; | |
| 156 | + }})(); | |
| 157 | + </script> | |
| 158 | + </template> | |
| 159 | + """ | |
| 160 | + open(f"{OUT}/compositions/{bid}.html", "w").write(page) | |
| 161 | + | |
| 162 | + | |
| 163 | + def extra_scene(sid, inner, duration, script): | |
| 164 | + open(f"{OUT}/compositions/{sid}.html", "w").write(f"""<template> | |
| 165 | + <style>#root {{ position: absolute; inset: 0; }}</style> | |
| 166 | + <div id="root" data-composition-id="{sid}" data-width="1920" data-height="1080">{inner}</div> | |
| 167 | + <script> | |
| 168 | + (() => {{ | |
| 169 | + const tl = gsap.timeline({{ paused: true }}); | |
| 170 | + const {{ land, rise, leave }} = Film(tl); | |
| 171 | + {script} | |
| 172 | + tl.to({{}}, {{ duration: {duration:.3f} }}, 0); | |
| 173 | + window.__timelines["{sid}"] = tl; | |
| 174 | + }})(); | |
| 175 | + </script> | |
| 176 | + </template> | |
| 177 | + """) | |
| 178 | + | |
| 179 | + | |
| 180 | + def write_cues(total): | |
| 181 | + cues = ['{ t: 0, shape: "dust", s: 10, turn: 0, tilt: 0, flat: 1, sway: 0, dim: 0.3 }'] | |
| 182 | + end = total - END_SECONDS | |
| 183 | + cues.append(f'{{ t: {end - 2.4:.3f}, shape: "mark", s: 4, x: 0, y: 0, sway: 0, turn: 0, twist: 0.12, flat: 1, wave: [0, -1], dur: 2.3 }}') | |
| 184 | + cues.append(f'{{ t: {end + 0.6:.3f}, shape: "mark", s: 7.2, x: 0, y: 0, sway: 0, turn: 0, twist: 0.1, flat: 1, burst: 1.4, dim: 0, fade: [0.95, 0.98], snap: 1, wave: 0, dur: 1.9 }}') | |
| 185 | + open(f"{OUT}/assets/cues.js", "w").write(f"""window.FILM_SECONDS = {total:.3f}; | |
| 186 | + window.FIELD_CUES = [ | |
| 187 | + {",".join(cues)} | |
| 188 | + ]; | |
| 189 | + """) | |
| 190 | + | |
| 191 | + | |
| 192 | + def write_index(timeline, total): | |
| 193 | + hosts = [f'<div id="field" data-composition-id="field" data-composition-src="compositions/field.html" data-start="0" data-duration="{total:.3f}" data-track-index="0" data-track-kind="graphics" data-width="1920" data-height="1080"></div>'] | |
| 194 | + rows = [("intro", 0, TITLE_SECONDS)] + [(b["id"], b["start"], b["duration"]) for b in timeline] + [("outro", total - END_SECONDS, END_SECONDS)] | |
| 195 | + for sid, start, duration in rows: | |
| 196 | + hosts.append(f'<div id="{sid}" data-composition-id="{sid}" data-composition-src="compositions/{sid}.html" data-start="{start:.3f}" data-duration="{duration:.3f}" data-track-index="1" data-track-kind="graphics" data-width="1920" data-height="1080"></div>') | |
| 197 | + hosts.append(f'<audio id="mix" class="clip" src="assets/mix.m4a" data-start="0" data-duration="{total:.3f}" data-track-index="2" data-volume="1"></audio>') | |
| 198 | + open(f"{OUT}/index.html", "w").write(f"""<!doctype html> | |
| 199 | + <html lang="en"> | |
| 200 | + <head> | |
| 201 | + <meta charset="UTF-8" /> | |
| 202 | + <meta name="viewport" content="width=1920, height=1080" /> | |
| 203 | + <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script> | |
| 204 | + <script src="https://cdn.jsdelivr.net/npm/three@0.160.1/build/three.min.js"></script> | |
| 205 | + <script src="assets/cues.js"></script> | |
| 206 | + <script src="assets/film.js"></script> | |
| 207 | + <link rel="stylesheet" href="assets/film.css" /> | |
| 208 | + </head> | |
| 209 | + <body> | |
| 210 | + <div id="root" data-composition-id="main" data-start="0" data-duration="{total:.3f}" data-width="1920" data-height="1080" data-fps="30"> | |
| 211 | + {chr(10).join(hosts)} | |
| 212 | + </div> | |
| 213 | + <script> | |
| 214 | + window.__timelines = window.__timelines || {{}}; | |
| 215 | + window.__timelines["main"] = gsap.timeline({{ paused: true }}); | |
| 216 | + </script> | |
| 217 | + </body> | |
| 218 | + </html> | |
| 219 | + """) | |
| 220 | + | |
| 221 | + | |
| 222 | + def mix(timeline, total): | |
| 223 | + args, filters, labels = ["ffmpeg", "-y", "-v", "error"], [], [] | |
| 224 | + for i, beat in enumerate(timeline): | |
| 225 | + args += ["-i", f"{VOICE}/{beat['id']}.mp3"] | |
| 226 | + ms = round(beat["voice"] * 1000) | |
| 227 | + filters.append(f"[{i}:a]aresample=48000,aformat=channel_layouts=stereo,adelay={ms}|{ms}[v{i}]") | |
| 228 | + labels.append(f"[v{i}]") | |
| 229 | + n = len(labels) | |
| 230 | + first = timeline[0]["voice"] | |
| 231 | + last = timeline[-1]["voice"] + timeline[-1]["length"] | |
| 232 | + crossfade, period, start = 22.96, 128.51, 48.25 | |
| 233 | + count = int(total // period) + 2 | |
| 234 | + for i in range(count): | |
| 235 | + args += ["-i", MUSIC] | |
| 236 | + filters.append(f"[{n + i}:a]aresample=48000,aformat=channel_layouts=stereo,atrim={start}:{start + period + crossfade},asetpts=PTS-STARTPTS[m{i}]") | |
| 237 | + prev = "m0" | |
| 238 | + for i in range(1, count): | |
| 239 | + filters.append(f"[{prev}][m{i}]acrossfade=d={crossfade}:c1=qsin:c2=qsin[x{i}]") | |
| 240 | + prev = f"x{i}" | |
| 241 | + under, clear = 10 ** (-26.5 / 20), 10 ** (-12 / 20) | |
| 242 | + gain = f"if(lt(t,{first - 0.6}),{clear}*clip(t/0.8,0,1),if(lt(t,{first}),{clear}+({under}-{clear})*(t-{first - 0.6})/0.6,if(lt(t,{last + 0.2}),{under},if(lt(t,{total - 3}),{under}+({clear}-{under})*clip((t-{last + 0.2})/1.2,0,1),{clear}*clip(({total}-t-0.1)/2.9,0,1)))))" | |
| 243 | + gain = gain.replace(",", "\\,") | |
| 244 | + filters.append(f"[{prev}]atrim=0:{total:.3f},volume='{gain}':eval=frame[m]") | |
| 245 | + filters.append("".join(labels) + f"[m]amix=inputs={n + 1}:normalize=0:dropout_transition=0,apad,atrim=0:{total:.3f}[bed]") | |
| 246 | + os.makedirs("assets/mix", exist_ok=True) | |
| 247 | + bed = f"assets/mix/{NAME}-bed.wav" | |
| 248 | + subprocess.run(args + ["-filter_complex", ";".join(filters), "-map", "[bed]", "-c:a", "pcm_s24le", bed], check=True) | |
| 249 | + r = subprocess.run(["ffmpeg", "-hide_banner", "-i", bed, "-af", "loudnorm=I=-14:TP=-1.5:LRA=11:print_format=json", "-f", "null", "-"], capture_output=True, text=True).stderr | |
| 250 | + m = json.loads(r[r.rindex("{"):r.rindex("}") + 1]) | |
| 251 | + subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", bed, "-af", f"loudnorm=I=-14:TP=-1.5:LRA=11:linear=true:measured_I={m['input_i']}:measured_TP={m['input_tp']}:measured_LRA={m['input_lra']}:measured_thresh={m['input_thresh']}:offset={m['target_offset']},aresample=48000", "-c:a", "aac", "-b:a", "256k", f"{OUT}/assets/mix.m4a"], check=True) | |
| 252 | + | |
| 253 | + | |
| 254 | + def main(): | |
| 255 | + os.makedirs(f"{OUT}/compositions", exist_ok=True) | |
| 256 | + os.makedirs(f"{OUT}/assets/clips", exist_ok=True) | |
| 257 | + for name in ("film.css", "film.js"): | |
| 258 | + shutil.copy(f"video/assets/{name}", f"{OUT}/assets/{name}") | |
| 259 | + if not os.path.exists(f"{OUT}/assets/fonts"): | |
| 260 | + shutil.copytree("video/assets/fonts", f"{OUT}/assets/fonts") | |
| 261 | + shutil.copy("tools/thumbnail/wordmark-dark.svg", f"{OUT}/assets/wordmark-dark.svg") | |
| 262 | + for name in ("hyperframes.json", "package.json"): | |
| 263 | + shutil.copy(f"video/{name}", f"{OUT}/{name}") | |
| 264 | + shutil.copy("video/compositions/field.html", f"{OUT}/compositions/field.html") | |
| 265 | + open(f"{OUT}/assets/film.css", "a").write(open("films/extra.css").read()) | |
| 266 | + timeline, clock = schedule() | |
| 267 | + total = clock + END_SECONDS | |
| 268 | + for name in os.listdir(f"{OUT}/compositions"): | |
| 269 | + if name != "field.html": | |
| 270 | + os.remove(f"{OUT}/compositions/{name}") | |
| 271 | + previous = None | |
| 272 | + for index, beat in enumerate(timeline): | |
| 273 | + clip = None | |
| 274 | + if index + 1 < len(timeline) and timeline[index + 1].get("shown"): | |
| 275 | + beat["stay"] = True | |
| 276 | + if beat.get("shots"): | |
| 277 | + clip = cut_clip(beat, beat["duration"]) | |
| 278 | + beat["open"] = previous != beat["layout"] | |
| 279 | + previous = beat["layout"] | |
| 280 | + scene_page(beat, clip) | |
| 281 | + extra_scene("intro", f'<div id="t1" class="big" style="position:absolute;left:150px;top:380px;width:1620px">{FILM.TITLE}</div><div id="t2" class="tag" style="position:absolute;left:150px;top:{FILM.SUB_TOP}px">{FILM.SUB}</div>', TITLE_SECONDS, f'rise("#t1", 0.3); land("#t2", 0.8); leave("#t1, #t2", {TITLE_SECONDS - 0.3});') | |
| 282 | + extra_scene("outro", f'<script src="https://cdn.jsdelivr.net/npm/three@0.160.1/build/three.min.js"></script><canvas id="logo3d" width="1920" height="1080" style="position:absolute;left:0;top:0;width:1920px;height:1080px;opacity:0"></canvas><img id="e0" src="assets/wordmark-dark.svg" alt="AI Resource Pro" style="position:absolute;left:640px;top:610px;width:640px;opacity:0" /><div id="e1" class="mid" style="position:absolute;left:0;right:0;top:730px;text-align:center">airesourcepro.com</div><div id="e2" class="say" style="position:absolute;left:210px;right:210px;top:815px;text-align:center">{FILM.CREDIT}</div>', END_SECONDS, f'const DURATION = {END_SECONDS}; ' + open("films/outro-logo.js").read() + f' tl.to("#e0", {{ opacity: 1, duration: 0.7, ease: "power2.out" }}, 4.35); land("#e1", 4.85); land("#e2", 5.25); leave("#logo3d, #e0, #e1, #e2", {END_SECONDS - 0.7});') | |
| 283 | + write_cues(total) | |
| 284 | + write_index(timeline, total) | |
| 285 | + mix(timeline, total) | |
| 286 | + json.dump([{k: b[k] for k in ("id", "start", "voice", "duration")} for b in timeline], open(f"{OUT}/timeline.json", "w"), indent=0) | |
| 287 | + print(f"{total:.1f} s ({total / 60:.2f} min), {len(timeline)} beats") | |
| 288 | + | |
| 289 | + | |
| 290 | + main() |
tools/mix.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Mix the film's sound into video/assets/mix.m4a from video/assets/timeline.json. | |
| 3 | + | |
| 4 | + python3 tools/mix.py [music_file] | |
| 5 | + | |
| 6 | + Places every voice line, plays the drum clip's own sound in s18c, and, when a music | |
| 7 | + file is given, loops it on whole bars under the voice. Output is -14 LUFS, true peak -1. | |
| 8 | + """ | |
| 9 | + import json, os, re, subprocess, sys | |
| 10 | + | |
| 11 | + ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") | |
| 12 | + VIDEO = os.path.join(ROOT, "video") | |
| 13 | + VO = os.path.join(ROOT, "assets", "vo", "film") | |
| 14 | + WORK = os.path.join(ROOT, "assets", "mix") | |
| 15 | + DRUM_CLIP = os.path.join(VIDEO, "assets", "clips", "drums.mp4") | |
| 16 | + MUSIC_UNDER_VOICE_DB = -26.5 | |
| 17 | + MUSIC_CLEAR_DB = -9.0 | |
| 18 | + DRUM_CLIP_DB = -5.0 | |
| 19 | + BPM = 104.54 | |
| 20 | + BAR = 4 * 60 / BPM | |
| 21 | + LOOP_START = 48.25 | |
| 22 | + LOOP_PERIOD = 128.51 | |
| 23 | + CROSSFADE_BARS = 4 | |
| 24 | + | |
| 25 | + | |
| 26 | + def run(*args): | |
| 27 | + return subprocess.run(args, check=True, capture_output=True, text=True) | |
| 28 | + | |
| 29 | + | |
| 30 | + def voice_and_drums(timeline): | |
| 31 | + beats = timeline["beats"] | |
| 32 | + drum_start = next(s["start"] for s in timeline["scenes"] if s["id"] == "s18c") | |
| 33 | + args, filters, labels = ["ffmpeg", "-y", "-v", "error"], [], [] | |
| 34 | + for index, (beat, data) in enumerate(beats.items()): | |
| 35 | + args += ["-i", os.path.join(VO, beat + ".mp3")] | |
| 36 | + delay = round(data["start"] * 1000) | |
| 37 | + filters.append(f"[{index}:a]aresample=48000,aformat=channel_layouts=stereo,adelay={delay}|{delay}[v{index}]") | |
| 38 | + labels.append(f"[v{index}]") | |
| 39 | + index = len(beats) | |
| 40 | + args += ["-i", DRUM_CLIP] | |
| 41 | + delay = round(drum_start * 1000) | |
| 42 | + filters.append(f"[{index}:a]aresample=48000,aformat=channel_layouts=stereo,volume={DRUM_CLIP_DB}dB,adelay={delay}|{delay}[d]") | |
| 43 | + labels.append("[d]") | |
| 44 | + filters.append("".join(labels) + f"amix=inputs={len(labels)}:normalize=0:dropout_transition=0,apad,atrim=0:{timeline['total']:.3f}[out]") | |
| 45 | + path = os.path.join(WORK, "voice.wav") | |
| 46 | + run(*args, "-filter_complex", ";".join(filters), "-map", "[out]", "-c:a", "pcm_s24le", path) | |
| 47 | + return path, drum_start | |
| 48 | + | |
| 49 | + | |
| 50 | + def looped_music(music, total): | |
| 51 | + """Repeat one stretch of whole bars, crossfaded, until it covers the film.""" | |
| 52 | + crossfade = CROSSFADE_BARS * BAR | |
| 53 | + start = LOOP_START | |
| 54 | + loop_seconds = LOOP_PERIOD + crossfade | |
| 55 | + count = int((total + crossfade) // LOOP_PERIOD) + 2 | |
| 56 | + args, filters = ["ffmpeg", "-y", "-v", "error"], [] | |
| 57 | + for index in range(count): | |
| 58 | + args += ["-i", music] | |
| 59 | + filters.append(f"[{index}:a]aresample=48000,aformat=channel_layouts=stereo,atrim={start:.4f}:{start + loop_seconds:.4f},asetpts=PTS-STARTPTS[m{index}]") | |
| 60 | + last = "m0" | |
| 61 | + for index in range(1, count): | |
| 62 | + filters.append(f"[{last}][m{index}]acrossfade=d={crossfade:.4f}:c1=qsin:c2=qsin[x{index}]") | |
| 63 | + last = f"x{index}" | |
| 64 | + filters.append(f"[{last}]atrim=0:{total:.3f}[out]") | |
| 65 | + path = os.path.join(WORK, "music.wav") | |
| 66 | + run(*args, "-filter_complex", ";".join(filters), "-map", "[out]", "-c:a", "pcm_s24le", path) | |
| 67 | + return path | |
| 68 | + | |
| 69 | + | |
| 70 | + def music_level(timeline, drum_start): | |
| 71 | + """Music sits under the voice, clears the drum clip and comes up at the ends.""" | |
| 72 | + beats = timeline["beats"] | |
| 73 | + total = timeline["total"] | |
| 74 | + first_voice = beats["b01"]["start"] | |
| 75 | + last_voice = beats["b23"]["start"] + beats["b23"]["length"] | |
| 76 | + drum_end = beats["b19"]["start"] | |
| 77 | + under = 10 ** (MUSIC_UNDER_VOICE_DB / 20) | |
| 78 | + clear = 10 ** (MUSIC_CLEAR_DB / 20) | |
| 79 | + ramp = lambda t, a, b, seconds: f"({a}+({b}-{a})*clip((t-{t})/{seconds},0,1))" | |
| 80 | + gain = f"{ramp(0, 0, clear, 0.8)}" | |
| 81 | + gain = f"if(lt(t,{first_voice - 0.2}),{gain},{ramp(first_voice - 0.2, clear, under, 0.8)})" | |
| 82 | + gain = f"if(lt(t,{drum_start - 0.5}),{gain},if(lt(t,{drum_end - 0.2}),{ramp(drum_start - 0.5, under, 0.03, 0.4)},{ramp(drum_end - 0.2, 0.03, under, 0.5)}))" | |
| 83 | + gain = f"if(lt(t,{last_voice + 0.2}),{gain},if(lt(t,{total - 3}),{ramp(last_voice + 0.2, under, clear, 1.2)},{ramp(total - 3, clear, 0, 2.9)}))" | |
| 84 | + return gain | |
| 85 | + | |
| 86 | + | |
| 87 | + def loudness(path): | |
| 88 | + """Measure for a linear two-pass normalize.""" | |
| 89 | + result = subprocess.run(["ffmpeg", "-hide_banner", "-i", path, "-af", "loudnorm=I=-14:TP=-1.3:LRA=11:print_format=json", "-f", "null", "-"], capture_output=True, text=True) | |
| 90 | + return json.loads(result.stderr[result.stderr.rindex("{") : result.stderr.rindex("}") + 1]) | |
| 91 | + | |
| 92 | + | |
| 93 | + def main(): | |
| 94 | + os.makedirs(WORK, exist_ok=True) | |
| 95 | + timeline = json.load(open(os.path.join(VIDEO, "assets", "timeline.json"))) | |
| 96 | + voice, drum_start = voice_and_drums(timeline) | |
| 97 | + bed = voice | |
| 98 | + if len(sys.argv) > 1: | |
| 99 | + music = looped_music(sys.argv[1], timeline["total"]) | |
| 100 | + bed = os.path.join(WORK, "bed.wav") | |
| 101 | + level = music_level(timeline, drum_start).replace(",", "\\,") | |
| 102 | + run("ffmpeg", "-y", "-v", "error", "-i", voice, "-i", music, "-filter_complex", | |
| 103 | + f"[1:a]volume='{level}':eval=frame[m];[0:a][m]amix=inputs=2:normalize=0:dropout_transition=0[out]", | |
| 104 | + "-map", "[out]", "-c:a", "pcm_s24le", bed) | |
| 105 | + measured = loudness(bed) | |
| 106 | + final = os.path.join(WORK, "mix.wav") | |
| 107 | + run("ffmpeg", "-y", "-v", "error", "-i", bed, "-af", | |
| 108 | + f"loudnorm=I=-14:TP=-1.3:LRA=11:linear=true:measured_I={measured['input_i']}:measured_TP={measured['input_tp']}:measured_LRA={measured['input_lra']}:measured_thresh={measured['input_thresh']}:offset={measured['target_offset']},aresample=48000", | |
| 109 | + "-c:a", "pcm_s24le", final) | |
| 110 | + run("ffmpeg", "-y", "-v", "error", "-i", final, "-c:a", "aac", "-b:a", "256k", os.path.join(VIDEO, "assets", "mix.m4a")) | |
| 111 | + check = loudness(final) | |
| 112 | + print(f"integrated {check['input_i']} LUFS, true peak {check['input_tp']} dBTP, music {'yes' if len(sys.argv) > 1 else 'no'}") | |
| 113 | + | |
| 114 | + | |
| 115 | + main() |
tools/outro_sample.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Builds film-outro/: the last seconds of film-codex alone, to review the ending.""" | |
| 3 | + import os, re, shutil | |
| 4 | + S, D, L = "film-codex", "film-outro", 11.3 | |
| 5 | + shutil.rmtree(D, ignore_errors=True) | |
| 6 | + shutil.copytree(S, D, ignore=shutil.ignore_patterns("clips", ".hyperframes", "renders", "mix.m4a")) | |
| 7 | + html = open(f"{D}/index.html").read() | |
| 8 | + total = float(re.search(r'data-composition-id="main" data-start="0" data-duration="([\d.]+)"', html).group(1)) | |
| 9 | + off = total - L | |
| 10 | + html = re.sub(r'\s*<div id="(?!field|outro|root)\w+" data-composition-id="\w+" data-composition-src.*?</div>', "", html) | |
| 11 | + html = re.sub(r"\s*<audio.*?</audio>", "", html) | |
| 12 | + html = html.replace(f'data-duration="{total:.3f}"', f'data-duration="{L}"') | |
| 13 | + html = re.sub(r'(id="outro".*?data-start=")[\d.]+', lambda m: f"{m.group(1)}{L - 8.3}", html) | |
| 14 | + open(f"{D}/index.html", "w").write(html) | |
| 15 | + cues = open(f"{D}/assets/cues.js").read() | |
| 16 | + cues = re.sub(r"FILM_SECONDS = [\d.]+", f"FILM_SECONDS = {L}", cues) | |
| 17 | + items = re.findall(r"\{ t: ([\d.]+), (.*?) \}", cues) | |
| 18 | + kept = [f"{{ t: {max(0, float(t) - off):.3f}, {body} }}" for t, body in items] | |
| 19 | + cues = re.sub(r"window\.FIELD_CUES = \[.*\];", lambda m: "window.FIELD_CUES = [\n" + ",".join(kept) + "\n];", cues, flags=re.S) | |
| 20 | + open(f"{D}/assets/cues.js", "w").write(cues) |
tools/sample_cut.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Cut the sample's footage to the voice: sets holds in build_film.py, writes take.mp4 and mix.m4a, and rebuilds.""" | |
| 3 | + import glob, json, re, subprocess | |
| 4 | + LEAD = 1.2 | |
| 5 | + SRC = glob.glob('/Users/Shared/airp-recordings/footage/*12.20.11*.mov')[0] | |
| 6 | + words = {b: json.load(open(f'assets/vo/film/{b}.words.json')) for b in ['b01','b02','b03','b04','b05']} | |
| 7 | + length = {b: w[-1]['end'] for b, w in words.items()} | |
| 8 | + norm = lambda s: re.sub('[^a-z]', '', s.lower()) | |
| 9 | + choose_offset = next(w['start'] for w in words['b04'] if norm(w['word']) == 'choose') | |
| 10 | + gap = 0.4 | |
| 11 | + b02 = LEAD + length['b01'] + gap | |
| 12 | + b03 = b02 + length['b02'] + gap | |
| 13 | + b04 = b03 + length['b03'] + gap | |
| 14 | + choose = b04 + choose_offset | |
| 15 | + prompt_at = choose + 2.1 # film time the chat clip starts | |
| 16 | + b05 = prompt_at + 1.5 | |
| 17 | + success = prompt_at + 1.4 + 5.8 # the chat reports success | |
| 18 | + site = success + 2.5 # the site opens | |
| 19 | + zoom = site + 2.0 | |
| 20 | + end = zoom + 4.0 | |
| 21 | + holds = {'b01': gap, 'b02': gap, 'b03': gap, 'b04': b05 - b04 - length['b04'], 'b05': end - b05 - length['b05']} | |
| 22 | + s = open('tools/build_film.py').read() | |
| 23 | + s = re.sub(r'HOLD_AFTER = \{.*?\}', 'HOLD_AFTER = ' + json.dumps({k: round(v, 3) for k, v in holds.items()}), s) | |
| 24 | + open('tools/build_film.py', 'w').write(s) | |
| 25 | + t = b02 + 0.5 | |
| 26 | + b_len = t - 5.6 | |
| 27 | + cuts = [(14.5, 20.1, 1, 0), (30.6 - b_len, 30.6, 1, 0), (30.6, 36.7, 1, max(0, b03 - t - 6.1))] | |
| 28 | + d_len = b04 - 0.4 - b03 | |
| 29 | + cuts.append((36.8, 36.8 + d_len, 1, 0)) | |
| 30 | + e_len = choose - 1.2 - (b04 - 0.4) | |
| 31 | + cuts += [(52.3, 52.3 + e_len, 1, 0), (68.9, 72.0, 1, 0), (85.6, 87.0, 1, 0), (87.0, 98.6, 2, 0), (98.6, 101.1, 1, 0), (116.0, 116.0 + end - site + 1, 1, 0)] | |
| 32 | + f, l = [], [] | |
| 33 | + for i, (a, b, speed, hold) in enumerate(cuts): | |
| 34 | + pad = f',tpad=stop_mode=clone:stop_duration={hold:.3f}' if hold else '' | |
| 35 | + f.append(f'[0:v]trim={a:.3f}:{b:.3f},setpts=(PTS-STARTPTS)/{speed},fps=30,crop=878:864:128:121,scale=1400:-2:flags=lanczos,setsar=1,format=yuv420p{pad}[v{i}]') | |
| 36 | + l.append(f'[v{i}]') | |
| 37 | + f.append(''.join(l) + f'concat=n={len(cuts)}:v=1:a=0[o]') | |
| 38 | + subprocess.run(['ffmpeg','-y','-v','error','-i',SRC,'-filter_complex',';'.join(f),'-map','[o]','-c:v','libx264','-crf','14','-preset','medium','-g','15','video/assets/clips/take.mp4'],check=True) | |
| 39 | + subprocess.run(['python3','tools/build_film.py'],check=True) | |
| 40 | + tl = json.load(open('video/assets/timeline.json')); total = tl['total'] | |
| 41 | + args = ['ffmpeg','-y','-v','error']; f = []; l = [] | |
| 42 | + for i, (b, d) in enumerate(tl['beats'].items()): | |
| 43 | + args += ['-i', f'assets/vo/film/{b}.mp3']; ms = round(d['start'] * 1000) | |
| 44 | + f.append(f'[{i}:a]aresample=48000,aformat=channel_layouts=stereo,adelay={ms}|{ms}[v{i}]'); l.append(f'[v{i}]') | |
| 45 | + n = len(l) | |
| 46 | + args += ['-ss','48.25','-t',str(total),'-i','/Volumes/Expand/Video/Motion Projects/airp-runpod-comfyui/assets/suno/Slow Render.wav'] | |
| 47 | + f.append(f'[{n}:a]aresample=48000,aformat=channel_layouts=stereo,volume=-26.5dB,afade=t=in:d=0.8,afade=t=out:st={total-2.5}:d=2.4[m]') | |
| 48 | + f.append(''.join(l) + f'[m]amix=inputs={n+1}:normalize=0:dropout_transition=0,apad,atrim=0:{total},loudnorm=I=-14:TP=-1.5:LRA=11[o]') | |
| 49 | + subprocess.run(args + ['-filter_complex', ';'.join(f), '-map','[o]','-ar','48000','-c:a','aac','-b:a','256k','video/assets/mix.m4a'], check=True) | |
| 50 | + subprocess.run(['python3','tools/build_film.py'],check=True) | |
| 51 | + print(f'success {success:.1f} site {site:.1f} zoom {zoom:.1f} end {end:.1f}; zoom = b05 end + {zoom - b05 - length["b05"]:.2f}; prompt_at {prompt_at:.1f}') |
tools/thumbnail/claude-thumbnail.png added
Not a text file.
tools/thumbnail/claude.png added
Not a text file.
tools/thumbnail/codex-thumbnail.png added
Not a text file.
tools/thumbnail/codex.png added
Not a text file.
tools/thumbnail/funnel-display.woff2 added
Not a text file.
tools/thumbnail/lockup-dark.svg added
| 1 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 353.08 64" role="img" aria-label="AI Resource Pro"><title>AI Resource Pro</title><g><path d="M3 49.94 L7.14 57.11 L56.86 57.11 L36.14 21.24 L32 28.41 L44.43 49.94Z" fill="#46AAE9" stroke="#46AAE9" stroke-width="0.35" stroke-linejoin="round"/><path d="M56.86 57.11 L61 49.94 L36.14 6.89 L15.43 42.76 L23.71 42.76 L36.14 21.24Z" fill="#2a7fb8" stroke="#2a7fb8" stroke-width="0.35" stroke-linejoin="round"/><path d="M36.14 6.89 L27.86 6.89 L3 49.94 L44.43 49.94 L40.29 42.76 L15.43 42.76Z" fill="#ffffff" stroke="#ffffff" stroke-width="0.35" stroke-linejoin="round"/></g><path d="M96.898 39.395H87.446L85.882 43.917H80.884L89.418 20.151H94.96000000000001L103.494 43.917H98.462ZM95.606 35.587 92.172 25.659 88.738 35.587ZM110.6 20.185V43.917H105.84V20.185ZM133.924 43.917 128.688 34.669H126.44399999999999V43.917H121.684V20.185H130.59199999999998Q133.346 20.185 135.284 21.154Q137.22199999999998 22.123 138.19099999999997 23.772Q139.16 25.421 139.16 27.461000000000002Q139.16 29.807000000000002 137.8 31.694000000000003Q136.44 33.581 133.754 34.295L139.432 43.917ZM126.44399999999999 31.099H130.422Q132.35999999999999 31.099 133.312 30.164Q134.264 29.229 134.264 27.563Q134.264 25.931 133.312 25.03Q132.35999999999999 24.129 130.422 24.129H126.44399999999999ZM160.002 35.927H146.232Q146.40200000000002 37.967 147.66000000000003 39.123000000000005Q148.918 40.279 150.75400000000002 40.279Q153.406 40.279 154.52800000000002 38.001000000000005H159.662Q158.846 40.721000000000004 156.534 42.472Q154.222 44.223 150.85600000000002 44.223Q148.13600000000002 44.223 145.97700000000003 43.016000000000005Q143.818 41.809000000000005 142.61100000000002 39.599000000000004Q141.40400000000002 37.389 141.40400000000002 34.499Q141.40400000000002 31.575000000000003 142.59400000000002 29.365000000000002Q143.78400000000002 27.155 145.92600000000002 25.965Q148.068 24.775 150.85600000000002 24.775Q153.542 24.775 155.667 25.930999999999997Q157.792 27.087 158.965 29.212000000000003Q160.138 31.337000000000003 160.138 34.091Q160.138 35.111000000000004 160.002 35.927ZM155.20800000000003 32.731Q155.174 30.895000000000003 153.882 29.790000000000003Q152.59 28.685000000000002 150.72 28.685000000000002Q148.952 28.685000000000002 147.745 29.756Q146.538 30.826999999999998 146.26600000000002 32.731ZM161.73600000000002 37.967H166.53000000000003Q166.66600000000003 39.055 167.60100000000003 39.769000000000005Q168.53600000000003 40.483000000000004 169.93000000000004 40.483000000000004Q171.29000000000002 40.483000000000004 172.055 39.93900000000001Q172.82000000000002 39.395 172.82000000000002 38.545Q172.82000000000002 37.627 171.88500000000002 37.168000000000006Q170.95000000000002 36.709 168.91000000000003 36.165Q166.80200000000002 35.655 165.459 35.111000000000004Q164.116 34.567 163.14700000000002 33.445Q162.17800000000003 32.323 162.17800000000003 30.419Q162.17800000000003 28.855 163.079 27.563000000000002Q163.98000000000002 26.271 165.663 25.523Q167.34600000000003 24.775 169.62400000000002 24.775Q172.99000000000004 24.775 174.99600000000004 26.458Q177.00200000000004 28.141 177.20600000000002 30.997H172.65000000000003Q172.54800000000003 29.875 171.71500000000003 29.212Q170.88200000000003 28.549 169.48800000000003 28.549Q168.19600000000003 28.549 167.49900000000002 29.025Q166.80200000000002 29.501 166.80200000000002 30.351Q166.80200000000002 31.303 167.75400000000002 31.796Q168.70600000000002 32.289 170.71200000000002 32.799Q172.75200000000004 33.309 174.07800000000003 33.852999999999994Q175.40400000000002 34.397 176.37300000000005 35.536Q177.34200000000004 36.675 177.37600000000003 38.545Q177.37600000000003 40.177 176.47500000000002 41.469Q175.574 42.761 173.89100000000002 43.492000000000004Q172.20800000000003 44.223 169.96400000000003 44.223Q167.65200000000002 44.223 165.81600000000003 43.39Q163.98000000000002 42.557 162.90900000000002 41.129000000000005Q161.83800000000002 39.701 161.73600000000002 37.967ZM179.246 34.499Q179.246 31.609 180.52100000000002 29.399Q181.796 27.189 184.006 25.982Q186.216 24.775 188.936 24.775Q191.656 24.775 193.86599999999999 25.982Q196.076 27.189 197.351 29.399Q198.626 31.609 198.626 34.499Q198.626 37.389 197.317 39.599000000000004Q196.008 41.809000000000005 193.781 43.016000000000005Q191.554 44.223 188.8 44.223Q186.08 44.223 183.904 43.016000000000005Q181.728 41.809000000000005 180.48700000000002 39.599000000000004Q179.246 37.389 179.246 34.499ZM193.73000000000002 34.499Q193.73000000000002 31.813000000000002 192.31900000000002 30.368000000000002Q190.90800000000002 28.923000000000002 188.868 28.923000000000002Q186.828 28.923000000000002 185.45100000000002 30.368000000000002Q184.074 31.813000000000002 184.074 34.499Q184.074 37.185 185.417 38.63Q186.76 40.075 188.8 40.075Q190.092 40.075 191.231 39.446Q192.37 38.817 193.05 37.559Q193.73000000000002 36.301 193.73000000000002 34.499ZM219.06 25.081V43.917H214.26600000000002V41.537Q213.348 42.761 211.86900000000003 43.458Q210.39000000000001 44.155 208.656 44.155Q206.44600000000003 44.155 204.74600000000004 43.22Q203.04600000000002 42.285000000000004 202.077 40.466Q201.108 38.647 201.108 36.131V25.081H205.86800000000002V35.451Q205.86800000000002 37.695 206.99 38.902Q208.11200000000002 40.109 210.05 40.109Q212.02200000000002 40.109 213.144 38.902Q214.26600000000002 37.695 214.26600000000002 35.451V25.081ZM233.442 24.809V29.807000000000002H232.18400000000003Q229.94 29.807000000000002 228.801 30.861Q227.662 31.915 227.662 34.533V43.917H222.90200000000002V25.081H227.662V28.005000000000003Q228.58 26.509 230.05900000000003 25.659Q231.538 24.809 233.442 24.809ZM243.88 24.775Q247.382 24.775 249.67700000000002 26.526Q251.972 28.277 252.75400000000002 31.439H247.62Q247.21200000000002 30.215 246.243 29.518Q245.274 28.820999999999998 243.846 28.820999999999998Q241.806 28.820999999999998 240.616 30.299999999999997Q239.42600000000002 31.779 239.42600000000002 34.499Q239.42600000000002 37.185 240.616 38.664Q241.806 40.143 243.846 40.143Q246.73600000000002 40.143 247.62 37.559H252.75400000000002Q251.972 40.619 249.66000000000003 42.421Q247.348 44.223 243.88 44.223Q241.16 44.223 239.05200000000002 43.016000000000005Q236.94400000000002 41.809000000000005 235.75400000000002 39.616Q234.56400000000002 37.423 234.56400000000002 34.499Q234.56400000000002 31.575000000000003 235.75400000000002 29.382Q236.94400000000002 27.189 239.05200000000002 25.982Q241.16 24.775 243.88 24.775ZM272.78000000000003 35.927H259.01Q259.18 37.967 260.438 39.123000000000005Q261.696 40.279 263.532 40.279Q266.184 40.279 267.306 38.001000000000005H272.44Q271.624 40.721000000000004 269.312 42.472Q267.0 44.223 263.634 44.223Q260.914 44.223 258.755 43.016000000000005Q256.596 41.809000000000005 255.389 39.599000000000004Q254.18200000000002 37.389 254.18200000000002 34.499Q254.18200000000002 31.575000000000003 255.372 29.365000000000002Q256.562 27.155 258.704 25.965Q260.846 24.775 263.634 24.775Q266.32 24.775 268.445 25.930999999999997Q270.57 27.087 271.743 29.212000000000003Q272.916 31.337000000000003 272.916 34.091Q272.916 35.111000000000004 272.78000000000003 35.927ZM267.986 32.731Q267.952 30.895000000000003 266.65999999999997 29.790000000000003Q265.368 28.685000000000002 263.498 28.685000000000002Q261.73 28.685000000000002 260.523 29.756Q259.31600000000003 30.826999999999998 259.044 32.731Z" fill="#ffffff"/><rect x="283.39" y="15.00" width="68.69" height="34.00" rx="10.20" fill="#46AAE9"/><path d="M303.63840000000005 33.683H301.25160000000005V39.1502H298.39560000000006V24.911H303.63840000000005Q305.29080000000005 24.911 306.45360000000005 25.4822Q307.61640000000006 26.0534 308.19780000000003 27.052999999999997Q308.77920000000006 28.052599999999998 308.77920000000006 29.3174Q308.77920000000006 30.4598 308.2386 31.4594Q307.69800000000004 32.458999999999996 306.5454000000001 33.071Q305.3928000000001 33.683 303.63840000000005 33.683ZM305.8416 29.3174Q305.8416 27.2366 303.5160000000001 27.2366H301.25160000000005V31.3778H303.5160000000001Q304.6992000000001 31.3778 305.27040000000005 30.8372Q305.8416 30.296599999999998 305.8416 29.3174ZM318.1428 39.1502 315.00120000000004 33.6014H313.6548V39.1502H310.7988V24.911H316.14360000000005Q317.79600000000005 24.911 318.9588 25.4924Q320.1216 26.0738 320.703 27.0632Q321.2844 28.052599999999998 321.2844 29.2766Q321.2844 30.684199999999997 320.4684 31.816399999999998Q319.6524 32.9486 318.04080000000005 33.376999999999995L321.4476 39.1502ZM313.6548 31.4594H316.0416Q317.2044 31.4594 317.77560000000005 30.8984Q318.34680000000003 30.3374 318.34680000000003 29.3378Q318.34680000000003 28.3586 317.77560000000005 27.817999999999998Q317.2044 27.2774 316.0416 27.2774H313.6548ZM323.18160000000006 31.9898Q323.18160000000006 29.909 324.16080000000005 28.2464Q325.14000000000004 26.5838 326.81280000000004 25.645400000000002Q328.48560000000003 24.707 330.48480000000006 24.707Q332.50440000000003 24.707 334.16700000000003 25.645400000000002Q335.8296000000001 26.5838 336.7986000000001 28.2464Q337.7676000000001 29.909 337.7676000000001 31.9898Q337.7676000000001 34.091 336.7986000000001 35.7536Q335.8296000000001 37.416199999999996 334.1568000000001 38.3546Q332.48400000000004 39.293 330.48480000000006 39.293Q328.48560000000003 39.293 326.81280000000004 38.3546Q325.14000000000004 37.416199999999996 324.16080000000005 35.7536Q323.18160000000006 34.091 323.18160000000006 31.9898ZM334.83000000000004 31.9898Q334.83000000000004 30.561799999999998 334.27920000000006 29.4908Q333.7284000000001 28.4198 332.7492000000001 27.848599999999998Q331.77000000000004 27.2774 330.48480000000006 27.2774Q329.19960000000003 27.2774 328.21020000000004 27.848599999999998Q327.22080000000005 28.4198 326.6700000000001 29.4908Q326.11920000000003 30.561799999999998 326.11920000000003 31.9898Q326.11920000000003 33.4178 326.6700000000001 34.498999999999995Q327.22080000000005 35.5802 328.21020000000004 36.16159999999999Q329.19960000000003 36.742999999999995 330.48480000000006 36.742999999999995Q331.77000000000004 36.742999999999995 332.7492000000001 36.16159999999999Q333.7284000000001 35.5802 334.27920000000006 34.498999999999995Q334.83000000000004 33.4178 334.83000000000004 31.9898Z" fill="#ffffff"/></svg> |
tools/thumbnail/thumb-claude.html added
| 1 | + <!doctype html><html><head><meta charset="utf-8"><style> | |
| 2 | + @font-face { font-family: "Funnel Display"; src: url("funnel-display.woff2") format("woff2"); font-weight: 300 800; } | |
| 3 | + html, body { margin: 0; width: 1280px; height: 720px; overflow: hidden; background: #000; } | |
| 4 | + #art { position: absolute; right: -40px; top: -74px; width: 1280px; } | |
| 5 | + #fade { position: absolute; inset: 0; background: linear-gradient(to right, #000 34%, rgba(0,0,0,.72) 46%, rgba(0,0,0,0) 62%); } | |
| 6 | + #title { position: absolute; left: 52px; top: 84px; font-family: "Funnel Display", sans-serif; font-weight: 800; font-size: 112px; line-height: 1; letter-spacing: -3px; color: #f8fafc; } | |
| 7 | + #sub { position: absolute; left: 54px; top: 366px; font-family: "Funnel Display", sans-serif; font-weight: 700; font-size: 92px; line-height: 1.04; letter-spacing: -1.5px; color: #7cc4f2; } | |
| 8 | + #logo { position: absolute; left: 56px; top: 618px; height: 50px; } | |
| 9 | + </style></head><body> | |
| 10 | + <img id="art" src="claude.png"><div id="fade"></div> | |
| 11 | + <div id="title">Claude Code<br>Full Access</div> | |
| 12 | + <div id="sub">How far to<br>let it run</div> | |
| 13 | + <img id="logo" src="lockup-dark.svg"> | |
| 14 | + </body></html> |
tools/thumbnail/thumb-codex.html added
| 1 | + <!doctype html><html><head><meta charset="utf-8"><style> | |
| 2 | + @font-face { font-family: "Funnel Display"; src: url("funnel-display.woff2") format("woff2"); font-weight: 300 800; } | |
| 3 | + html, body { margin: 0; width: 1280px; height: 720px; overflow: hidden; background: #000; } | |
| 4 | + #art { position: absolute; right: -40px; top: -74px; width: 1280px; } | |
| 5 | + #fade { position: absolute; inset: 0; background: linear-gradient(to right, #000 34%, rgba(0,0,0,.72) 46%, rgba(0,0,0,0) 62%); } | |
| 6 | + #title { position: absolute; left: 52px; top: 84px; font-family: "Funnel Display", sans-serif; font-weight: 800; font-size: 112px; line-height: 1; letter-spacing: -3px; color: #f8fafc; } | |
| 7 | + #sub { position: absolute; left: 54px; top: 366px; font-family: "Funnel Display", sans-serif; font-weight: 700; font-size: 92px; line-height: 1.04; letter-spacing: -1.5px; color: #7cc4f2; } | |
| 8 | + #logo { position: absolute; left: 56px; top: 618px; height: 50px; } | |
| 9 | + </style></head><body> | |
| 10 | + <img id="art" src="codex.png"><div id="fade"></div> | |
| 11 | + <div id="title">Codex<br>Full Access</div> | |
| 12 | + <div id="sub">How far to<br>let it run</div> | |
| 13 | + <img id="logo" src="lockup-dark.svg"> | |
| 14 | + </body></html> |
tools/thumbnail/wordmark-dark.svg added
| 1 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="76 12 277 40" role="img" aria-label="AI Resource Pro"><title>AI Resource Pro</title><path d="M96.898 39.395H87.446L85.882 43.917H80.884L89.418 20.151H94.96000000000001L103.494 43.917H98.462ZM95.606 35.587 92.172 25.659 88.738 35.587ZM110.6 20.185V43.917H105.84V20.185ZM133.924 43.917 128.688 34.669H126.44399999999999V43.917H121.684V20.185H130.59199999999998Q133.346 20.185 135.284 21.154Q137.22199999999998 22.123 138.19099999999997 23.772Q139.16 25.421 139.16 27.461000000000002Q139.16 29.807000000000002 137.8 31.694000000000003Q136.44 33.581 133.754 34.295L139.432 43.917ZM126.44399999999999 31.099H130.422Q132.35999999999999 31.099 133.312 30.164Q134.264 29.229 134.264 27.563Q134.264 25.931 133.312 25.03Q132.35999999999999 24.129 130.422 24.129H126.44399999999999ZM160.002 35.927H146.232Q146.40200000000002 37.967 147.66000000000003 39.123000000000005Q148.918 40.279 150.75400000000002 40.279Q153.406 40.279 154.52800000000002 38.001000000000005H159.662Q158.846 40.721000000000004 156.534 42.472Q154.222 44.223 150.85600000000002 44.223Q148.13600000000002 44.223 145.97700000000003 43.016000000000005Q143.818 41.809000000000005 142.61100000000002 39.599000000000004Q141.40400000000002 37.389 141.40400000000002 34.499Q141.40400000000002 31.575000000000003 142.59400000000002 29.365000000000002Q143.78400000000002 27.155 145.92600000000002 25.965Q148.068 24.775 150.85600000000002 24.775Q153.542 24.775 155.667 25.930999999999997Q157.792 27.087 158.965 29.212000000000003Q160.138 31.337000000000003 160.138 34.091Q160.138 35.111000000000004 160.002 35.927ZM155.20800000000003 32.731Q155.174 30.895000000000003 153.882 29.790000000000003Q152.59 28.685000000000002 150.72 28.685000000000002Q148.952 28.685000000000002 147.745 29.756Q146.538 30.826999999999998 146.26600000000002 32.731ZM161.73600000000002 37.967H166.53000000000003Q166.66600000000003 39.055 167.60100000000003 39.769000000000005Q168.53600000000003 40.483000000000004 169.93000000000004 40.483000000000004Q171.29000000000002 40.483000000000004 172.055 39.93900000000001Q172.82000000000002 39.395 172.82000000000002 38.545Q172.82000000000002 37.627 171.88500000000002 37.168000000000006Q170.95000000000002 36.709 168.91000000000003 36.165Q166.80200000000002 35.655 165.459 35.111000000000004Q164.116 34.567 163.14700000000002 33.445Q162.17800000000003 32.323 162.17800000000003 30.419Q162.17800000000003 28.855 163.079 27.563000000000002Q163.98000000000002 26.271 165.663 25.523Q167.34600000000003 24.775 169.62400000000002 24.775Q172.99000000000004 24.775 174.99600000000004 26.458Q177.00200000000004 28.141 177.20600000000002 30.997H172.65000000000003Q172.54800000000003 29.875 171.71500000000003 29.212Q170.88200000000003 28.549 169.48800000000003 28.549Q168.19600000000003 28.549 167.49900000000002 29.025Q166.80200000000002 29.501 166.80200000000002 30.351Q166.80200000000002 31.303 167.75400000000002 31.796Q168.70600000000002 32.289 170.71200000000002 32.799Q172.75200000000004 33.309 174.07800000000003 33.852999999999994Q175.40400000000002 34.397 176.37300000000005 35.536Q177.34200000000004 36.675 177.37600000000003 38.545Q177.37600000000003 40.177 176.47500000000002 41.469Q175.574 42.761 173.89100000000002 43.492000000000004Q172.20800000000003 44.223 169.96400000000003 44.223Q167.65200000000002 44.223 165.81600000000003 43.39Q163.98000000000002 42.557 162.90900000000002 41.129000000000005Q161.83800000000002 39.701 161.73600000000002 37.967ZM179.246 34.499Q179.246 31.609 180.52100000000002 29.399Q181.796 27.189 184.006 25.982Q186.216 24.775 188.936 24.775Q191.656 24.775 193.86599999999999 25.982Q196.076 27.189 197.351 29.399Q198.626 31.609 198.626 34.499Q198.626 37.389 197.317 39.599000000000004Q196.008 41.809000000000005 193.781 43.016000000000005Q191.554 44.223 188.8 44.223Q186.08 44.223 183.904 43.016000000000005Q181.728 41.809000000000005 180.48700000000002 39.599000000000004Q179.246 37.389 179.246 34.499ZM193.73000000000002 34.499Q193.73000000000002 31.813000000000002 192.31900000000002 30.368000000000002Q190.90800000000002 28.923000000000002 188.868 28.923000000000002Q186.828 28.923000000000002 185.45100000000002 30.368000000000002Q184.074 31.813000000000002 184.074 34.499Q184.074 37.185 185.417 38.63Q186.76 40.075 188.8 40.075Q190.092 40.075 191.231 39.446Q192.37 38.817 193.05 37.559Q193.73000000000002 36.301 193.73000000000002 34.499ZM219.06 25.081V43.917H214.26600000000002V41.537Q213.348 42.761 211.86900000000003 43.458Q210.39000000000001 44.155 208.656 44.155Q206.44600000000003 44.155 204.74600000000004 43.22Q203.04600000000002 42.285000000000004 202.077 40.466Q201.108 38.647 201.108 36.131V25.081H205.86800000000002V35.451Q205.86800000000002 37.695 206.99 38.902Q208.11200000000002 40.109 210.05 40.109Q212.02200000000002 40.109 213.144 38.902Q214.26600000000002 37.695 214.26600000000002 35.451V25.081ZM233.442 24.809V29.807000000000002H232.18400000000003Q229.94 29.807000000000002 228.801 30.861Q227.662 31.915 227.662 34.533V43.917H222.90200000000002V25.081H227.662V28.005000000000003Q228.58 26.509 230.05900000000003 25.659Q231.538 24.809 233.442 24.809ZM243.88 24.775Q247.382 24.775 249.67700000000002 26.526Q251.972 28.277 252.75400000000002 31.439H247.62Q247.21200000000002 30.215 246.243 29.518Q245.274 28.820999999999998 243.846 28.820999999999998Q241.806 28.820999999999998 240.616 30.299999999999997Q239.42600000000002 31.779 239.42600000000002 34.499Q239.42600000000002 37.185 240.616 38.664Q241.806 40.143 243.846 40.143Q246.73600000000002 40.143 247.62 37.559H252.75400000000002Q251.972 40.619 249.66000000000003 42.421Q247.348 44.223 243.88 44.223Q241.16 44.223 239.05200000000002 43.016000000000005Q236.94400000000002 41.809000000000005 235.75400000000002 39.616Q234.56400000000002 37.423 234.56400000000002 34.499Q234.56400000000002 31.575000000000003 235.75400000000002 29.382Q236.94400000000002 27.189 239.05200000000002 25.982Q241.16 24.775 243.88 24.775ZM272.78000000000003 35.927H259.01Q259.18 37.967 260.438 39.123000000000005Q261.696 40.279 263.532 40.279Q266.184 40.279 267.306 38.001000000000005H272.44Q271.624 40.721000000000004 269.312 42.472Q267.0 44.223 263.634 44.223Q260.914 44.223 258.755 43.016000000000005Q256.596 41.809000000000005 255.389 39.599000000000004Q254.18200000000002 37.389 254.18200000000002 34.499Q254.18200000000002 31.575000000000003 255.372 29.365000000000002Q256.562 27.155 258.704 25.965Q260.846 24.775 263.634 24.775Q266.32 24.775 268.445 25.930999999999997Q270.57 27.087 271.743 29.212000000000003Q272.916 31.337000000000003 272.916 34.091Q272.916 35.111000000000004 272.78000000000003 35.927ZM267.986 32.731Q267.952 30.895000000000003 266.65999999999997 29.790000000000003Q265.368 28.685000000000002 263.498 28.685000000000002Q261.73 28.685000000000002 260.523 29.756Q259.31600000000003 30.826999999999998 259.044 32.731Z" fill="#ffffff"/><rect x="283.39" y="15.00" width="68.69" height="34.00" rx="10.20" fill="#46AAE9"/><path d="M303.63840000000005 33.683H301.25160000000005V39.1502H298.39560000000006V24.911H303.63840000000005Q305.29080000000005 24.911 306.45360000000005 25.4822Q307.61640000000006 26.0534 308.19780000000003 27.052999999999997Q308.77920000000006 28.052599999999998 308.77920000000006 29.3174Q308.77920000000006 30.4598 308.2386 31.4594Q307.69800000000004 32.458999999999996 306.5454000000001 33.071Q305.3928000000001 33.683 303.63840000000005 33.683ZM305.8416 29.3174Q305.8416 27.2366 303.5160000000001 27.2366H301.25160000000005V31.3778H303.5160000000001Q304.6992000000001 31.3778 305.27040000000005 30.8372Q305.8416 30.296599999999998 305.8416 29.3174ZM318.1428 39.1502 315.00120000000004 33.6014H313.6548V39.1502H310.7988V24.911H316.14360000000005Q317.79600000000005 24.911 318.9588 25.4924Q320.1216 26.0738 320.703 27.0632Q321.2844 28.052599999999998 321.2844 29.2766Q321.2844 30.684199999999997 320.4684 31.816399999999998Q319.6524 32.9486 318.04080000000005 33.376999999999995L321.4476 39.1502ZM313.6548 31.4594H316.0416Q317.2044 31.4594 317.77560000000005 30.8984Q318.34680000000003 30.3374 318.34680000000003 29.3378Q318.34680000000003 28.3586 317.77560000000005 27.817999999999998Q317.2044 27.2774 316.0416 27.2774H313.6548ZM323.18160000000006 31.9898Q323.18160000000006 29.909 324.16080000000005 28.2464Q325.14000000000004 26.5838 326.81280000000004 25.645400000000002Q328.48560000000003 24.707 330.48480000000006 24.707Q332.50440000000003 24.707 334.16700000000003 25.645400000000002Q335.8296000000001 26.5838 336.7986000000001 28.2464Q337.7676000000001 29.909 337.7676000000001 31.9898Q337.7676000000001 34.091 336.7986000000001 35.7536Q335.8296000000001 37.416199999999996 334.1568000000001 38.3546Q332.48400000000004 39.293 330.48480000000006 39.293Q328.48560000000003 39.293 326.81280000000004 38.3546Q325.14000000000004 37.416199999999996 324.16080000000005 35.7536Q323.18160000000006 34.091 323.18160000000006 31.9898ZM334.83000000000004 31.9898Q334.83000000000004 30.561799999999998 334.27920000000006 29.4908Q333.7284000000001 28.4198 332.7492000000001 27.848599999999998Q331.77000000000004 27.2774 330.48480000000006 27.2774Q329.19960000000003 27.2774 328.21020000000004 27.848599999999998Q327.22080000000005 28.4198 326.6700000000001 29.4908Q326.11920000000003 30.561799999999998 326.11920000000003 31.9898Q326.11920000000003 33.4178 326.6700000000001 34.498999999999995Q327.22080000000005 35.5802 328.21020000000004 36.16159999999999Q329.19960000000003 36.742999999999995 330.48480000000006 36.742999999999995Q331.77000000000004 36.742999999999995 332.7492000000001 36.16159999999999Q333.7284000000001 35.5802 334.27920000000006 34.498999999999995Q334.83000000000004 33.4178 334.83000000000004 31.9898Z" fill="#ffffff"/></svg> |
tools/thumbnail/wordmark.py added
| 1 | + import re | |
| 2 | + s=open('tools/thumbnail/lockup-dark.svg').read() | |
| 3 | + s=re.sub(r'<g>.*?</g>','',s,count=1,flags=re.S).replace('viewBox="0 0 353.08 64"','viewBox="76 12 277 40"') | |
| 4 | + open('tools/thumbnail/wordmark-dark.svg','w').write(s) |
tools/tts.py added
| 1 | + #!/usr/bin/env python3 | |
| 2 | + """Quentin narration for the Runpod ComfyUI tutorial. Key from Bitwarden Secrets Manager, never printed. | |
| 3 | + | |
| 4 | + tools/tts.py lines.json out_dir # lines.json: [{"id", "text", "prev"?, "next"?, "speed"?}, ...] | |
| 5 | + | |
| 6 | + Each line gives out_dir/<id>.mp3 and out_dir/<id>.words.json with word timings. Existing takes are kept, | |
| 7 | + so a rerun only pays for new or changed lines. SPOKEN holds the only differences between what the script | |
| 8 | + says and what the voice is told to read, because the frozen script stays word for word on screen. | |
| 9 | + """ | |
| 10 | + import base64, hashlib, json, os, re, subprocess, sys, urllib.request | |
| 11 | + | |
| 12 | + VOICE_ID = "cjVigY5qzO86Huf0OWal" # Eric - Smooth, Trustworthy; the owner chose him November 1, 2026 | |
| 13 | + MODEL = "eleven_multilingual_v2" | |
| 14 | + SETTINGS = {"stability": 0.5, "similarity_boost": 0.75} | |
| 15 | + SECRET_ID = "82f9689b-1a23-4472-91c6-b4be017b23e9" # AGENT_ELEVENLABS_API_KEY | |
| 16 | + | |
| 17 | + SPOKEN = [ | |
| 18 | + ("Use @Browser", "Use the at symbol with Browser"), | |
| 19 | + ("Use @Chrome", "Use the at symbol with Chrome"), | |
| 20 | + ("Then mention @Computer", "Then type the at symbol, then Computer,"), | |
| 21 | + ("airesourcepro.com", "A I Resource Pro dot com"), | |
| 22 | + ("MCP", "M C P"), | |
| 23 | + ("AGENTS.md", "agents dot M D"), | |
| 24 | + ("PreToolUse", "pre tool use"), | |
| 25 | + ("chrome://extensions", "chrome colon slash slash extensions"), | |
| 26 | + ("IDE", "I D E"), | |
| 27 | + ("IDEs", "I D Es"), | |
| 28 | + ("CLI", "C L I"), | |
| 29 | + ("macOS", "Mac O S"), | |
| 30 | + ] | |
| 31 | + | |
| 32 | + | |
| 33 | + def spoken(text): | |
| 34 | + for written, said in SPOKEN: | |
| 35 | + text = re.sub(rf"(?<![\w.-]){re.escape(written)}(?![\w-])", said, text) | |
| 36 | + return text | |
| 37 | + | |
| 38 | + | |
| 39 | + def key(): | |
| 40 | + env = dict(os.environ) | |
| 41 | + if not env.get("BWS_ACCESS_TOKEN"): | |
| 42 | + env["BWS_ACCESS_TOKEN"] = subprocess.run(["launchctl", "getenv", "BWS_ACCESS_TOKEN"], capture_output=True, text=True).stdout.strip() | |
| 43 | + out = subprocess.run(["bws", "secret", "get", SECRET_ID, "--output", "json"], capture_output=True, text=True, check=True, env=env) | |
| 44 | + return json.loads(out.stdout)["value"] | |
| 45 | + | |
| 46 | + | |
| 47 | + def words_from(alignment): | |
| 48 | + chars = alignment.get("characters", []) | |
| 49 | + starts = alignment.get("character_start_times_seconds", []) | |
| 50 | + ends = alignment.get("character_end_times_seconds", []) | |
| 51 | + words, current, begin, last = [], "", None, 0 | |
| 52 | + for char, start, end in zip(chars, starts, ends): | |
| 53 | + if char.isspace(): | |
| 54 | + if current: | |
| 55 | + words.append({"word": current, "start": begin, "end": last}) | |
| 56 | + current = "" | |
| 57 | + else: | |
| 58 | + if not current: | |
| 59 | + begin = start | |
| 60 | + current += char | |
| 61 | + last = end | |
| 62 | + if current: | |
| 63 | + words.append({"word": current, "start": begin, "end": last}) | |
| 64 | + return words | |
| 65 | + | |
| 66 | + | |
| 67 | + def speak(api_key, line, out_dir): | |
| 68 | + text = spoken(line["text"]) | |
| 69 | + settings = {**SETTINGS, "speed": line["speed"]} if "speed" in line else SETTINGS | |
| 70 | + stamp = hashlib.sha1(json.dumps([VOICE_ID, text, spoken(line.get("prev", "")), spoken(line.get("next", "")), MODEL, settings]).encode()).hexdigest()[:10] | |
| 71 | + base = os.path.join(out_dir, line["id"]) | |
| 72 | + if os.path.exists(base + ".mp3") and os.path.exists(base + ".stamp") and open(base + ".stamp").read() == stamp: | |
| 73 | + return None | |
| 74 | + body = {"text": text, "model_id": MODEL, "voice_settings": settings} | |
| 75 | + if line.get("prev"): | |
| 76 | + body["previous_text"] = spoken(line["prev"]) | |
| 77 | + if line.get("next"): | |
| 78 | + body["next_text"] = spoken(line["next"]) | |
| 79 | + request = urllib.request.Request( | |
| 80 | + f"https://api.elevenlabs.io/v1/text-to-speech/{VOICE_ID}/with-timestamps", | |
| 81 | + data=json.dumps(body).encode(), | |
| 82 | + headers={"xi-api-key": api_key, "Content-Type": "application/json"}, | |
| 83 | + ) | |
| 84 | + with urllib.request.urlopen(request) as response: | |
| 85 | + result = json.load(response) | |
| 86 | + with open(base + ".mp3", "wb") as audio: | |
| 87 | + audio.write(base64.b64decode(result["audio_base64"])) | |
| 88 | + words = words_from(result.get("alignment") or {}) | |
| 89 | + json.dump(words, open(base + ".words.json", "w"), indent=1) | |
| 90 | + open(base + ".stamp", "w").write(stamp) | |
| 91 | + return words | |
| 92 | + | |
| 93 | + | |
| 94 | + def main(): | |
| 95 | + lines = json.load(open(sys.argv[1])) | |
| 96 | + out_dir = sys.argv[2] | |
| 97 | + os.makedirs(out_dir, exist_ok=True) | |
| 98 | + api_key = key() | |
| 99 | + for line in lines: | |
| 100 | + words = speak(api_key, line, out_dir) | |
| 101 | + if words is None: | |
| 102 | + print(line["id"], "kept") | |
| 103 | + else: | |
| 104 | + seconds = words[-1]["end"] if words else 0 | |
| 105 | + print(line["id"], f"{len(words)} words, {seconds:.1f} s, {len(words) / seconds * 60 if seconds else 0:.0f} wpm") | |
| 106 | + | |
| 107 | + | |
| 108 | + if __name__ == "__main__": | |
| 109 | + main() |
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/.capture-owner.json added
| 1 | + {"version":1,"pid":43335,"released":true} |
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/contact-sheet.jpg added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-00-at-3s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-01-at-12s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-02-at-17s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-03-at-21s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-04-at-26s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-05-at-29.5s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-06-at-34s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-07-at-39s.png added
Not a text file.
video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-08-at-39.372s.png added
Not a text file.
video/.hyperframes/history-id added
| 1 | + 2203e0e8-e0e8-4e2b-a93e-b2b046892059 |
video/.hyperframes/render-outputs.json added
| 1 | + {"version":1,"paths":["renders/sample.mp4"]} |
video/.hyperframes/video-state.json added
| 1 | + { | |
| 2 | + "version": 1, | |
| 3 | + "historyId": "2203e0e8-e0e8-4e2b-a93e-b2b046892059", | |
| 4 | + "currentRevision": "874949b0-3bc3-4846-aa93-03663d655e9a", | |
| 5 | + "pendingChanges": false, | |
| 6 | + "files": { | |
| 7 | + "assets/cues.js": { | |
| 8 | + "hash": "7442f19a93b1a31935b3f41cdf6c8415278ed85cc6d12d98dd82e232b57bb14e", | |
| 9 | + "content": "/path/to/file" | |
| 10 | + }, | |
| 11 | + "assets/film.css": { | |
| 12 | + "hash": "d2e52e1b8eba572532728a05eb0c2705bacbfcbdef522e1c605d5d052342adf3", | |
| 13 | + "content": "/path/to/file" | |
| 14 | + }, | |
| 15 | + "assets/film.js": { | |
| 16 | + "hash": "7e656a8c6a720fee3e8e7d6c68afb128f2fd906c9efe65f0be8470ce0b0b9a8e", | |
| 17 | + "content": "/path/to/file" | |
| 18 | + }, | |
| 19 | + "assets/fonts/funnel-display.woff2": { | |
| 20 | + "hash": "96468ae7727580c804f679aa5d29c75389e605fb2e41ae6a067ad86e5e9a86a9", | |
| 21 | + "content": "/path/to/file" | |
| 22 | + }, | |
| 23 | + "assets/fonts/geist-mono.woff2": { | |
| 24 | + "hash": "5f3d6ad60f29d6cb708414ec6887163d63bf197377ef5417d2483ff31ace6c3b", | |
| 25 | + "content": "/path/to/file" | |
| 26 | + }, | |
| 27 | + "assets/fonts/geist.woff2": { | |
| 28 | + "hash": "9b6f5ff45b278c744b5f379a2c4ecbaf858a842b8eaf82ac8d21b699ca16c608", | |
| 29 | + "content": "/path/to/file" | |
| 30 | + }, | |
| 31 | + "assets/timeline.json": { | |
| 32 | + "hash": "ad9a7565f75142c6dcf13189ebc4f24e09477e9d8fd6022081ad48fee6ab9ff2", | |
| 33 | + "content": "/path/to/file" | |
| 34 | + }, | |
| 35 | + "compositions/field.html": { | |
| 36 | + "hash": "9361e5d11e8ef8a354b62f5488b6ce620600f94a34b8fc211ae12ca64e035390", | |
| 37 | + "content": "/path/to/file" | |
| 38 | + }, | |
| 39 | + "compositions/s01.html": { | |
| 40 | + "hash": "17ae2ad923524a1427762ffd1edb5cf8d612bbef747332a9232c64871972ad5d", | |
| 41 | + "content": "/path/to/file" | |
| 42 | + }, | |
| 43 | + "hyperframes.json": { | |
| 44 | + "hash": "35a6d4ea79ebe911f0d81705f7aace5d8ff0316b745b0311d56af50c9c237cb7", | |
| 45 | + "content": "/path/to/file" | |
| 46 | + }, | |
| 47 | + "index.html": { | |
| 48 | + "hash": "74b2c4c4a1d199a4f67c8f63c9d99984b2b4f45f6eb3948d667b05f83ad134b5", | |
| 49 | + "content": "/path/to/file" | |
| 50 | + }, | |
| 51 | + "package.json": { | |
| 52 | + "hash": "7b163d88abbaa6e5df4571cf114fa6cd20fda68be86e2bfa3001f20412d80848", | |
| 53 | + "content": "/path/to/file" | |
| 54 | + }, | |
| 55 | + "scenes/cues.tpl.js": { | |
| 56 | + "hash": "b69049eb5746451d762f06e978ef2aef6fb8b37066d12e815646061835638792", | |
| 57 | + "content": "/path/to/file" | |
| 58 | + }, | |
| 59 | + "scenes/film.scenes": { | |
| 60 | + "hash": "97fe0a7a90605cb80240224dff6fd87a0e39550da92737570ada4c549dd03cc2", | |
| 61 | + "content": "/path/to/file" | |
| 62 | + }, | |
| 63 | + "assets/clips/take.mp4": { | |
| 64 | + "hash": "694534efff0144270b5d047af9b1f5aacd8433cee97530b7c97692b1ff06990c", | |
| 65 | + "content": "/path/to/file" | |
| 66 | + }, | |
| 67 | + "assets/mix.m4a": { | |
| 68 | + "hash": "b11195f29c526d0749d8a9c50f06e6606b5019c19c3a077c8c16aea5be9be192", | |
| 69 | + "content": "/path/to/file" | |
| 70 | + } | |
| 71 | + }, | |
| 72 | + "revisions": { | |
| 73 | + "4299dc4a-2411-45c2-abb6-febe89ad5394": { | |
| 74 | + "actor": { | |
| 75 | + "kind": "outside", | |
| 76 | + "name": "Outside" | |
| 77 | + }, | |
| 78 | + "label": "Changed outside the app", | |
| 79 | + "startedAt": 1793554092365, | |
| 80 | + "endedAt": 1793554092389, | |
| 81 | + "files": { | |
| 82 | + "assets/clips/take.mp4": { | |
| 83 | + "before": "/path/to/file", | |
| 84 | + "after": "/path/to/file" | |
| 85 | + }, | |
| 86 | + "compositions/s01.html": { | |
| 87 | + "before": "/path/to/file", | |
| 88 | + "after": "/path/to/file" | |
| 89 | + }, | |
| 90 | + "scenes/film.scenes": { | |
| 91 | + "before": "/path/to/file", | |
| 92 | + "after": "/path/to/file" | |
| 93 | + } | |
| 94 | + } | |
| 95 | + }, | |
| 96 | + "082f3049-48df-4187-9a1a-fd85cfc3e615": { | |
| 97 | + "actor": { | |
| 98 | + "kind": "outside", | |
| 99 | + "name": "Outside" | |
| 100 | + }, | |
| 101 | + "label": "Changed outside the app", | |
| 102 | + "startedAt": 1793555700468, | |
| 103 | + "endedAt": 1793555700477, | |
| 104 | + "files": { | |
| 105 | + "assets/clips/take.mp4": { | |
| 106 | + "before": "/path/to/file", | |
| 107 | + "after": "/path/to/file" | |
| 108 | + }, | |
| 109 | + "assets/cues.js": { | |
| 110 | + "before": "/path/to/file", | |
| 111 | + "after": "/path/to/file" | |
| 112 | + }, | |
| 113 | + "assets/mix.m4a": { | |
| 114 | + "before": "/path/to/file", | |
| 115 | + "after": "/path/to/file" | |
| 116 | + }, | |
| 117 | + "assets/timeline.json": { | |
| 118 | + "before": "/path/to/file", | |
| 119 | + "after": "/path/to/file" | |
| 120 | + }, | |
| 121 | + "compositions/s01.html": { | |
| 122 | + "before": "/path/to/file", | |
| 123 | + "after": "/path/to/file" | |
| 124 | + }, | |
| 125 | + "index.html": { | |
| 126 | + "before": "/path/to/file", | |
| 127 | + "after": "/path/to/file" | |
| 128 | + }, | |
| 129 | + "scenes/film.scenes": { | |
| 130 | + "before": "/path/to/file", | |
| 131 | + "after": "/path/to/file" | |
| 132 | + } | |
| 133 | + } | |
| 134 | + }, | |
| 135 | + "ee8f3e31-59e3-4b7b-87a2-eb1929aa3ac0": { | |
| 136 | + "actor": { | |
| 137 | + "kind": "outside", | |
| 138 | + "name": "Outside" | |
| 139 | + }, | |
| 140 | + "label": "Changed outside the app", | |
| 141 | + "startedAt": 1793555759109, | |
| 142 | + "endedAt": 1793555759124, | |
| 143 | + "files": { | |
| 144 | + "assets/clips/take.mp4": { | |
| 145 | + "before": "/path/to/file", | |
| 146 | + "after": "/path/to/file" | |
| 147 | + }, | |
| 148 | + "assets/cues.js": { | |
| 149 | + "before": "/path/to/file", | |
| 150 | + "after": "/path/to/file" | |
| 151 | + }, | |
| 152 | + "assets/mix.m4a": { | |
| 153 | + "before": "/path/to/file", | |
| 154 | + "after": "/path/to/file" | |
| 155 | + }, | |
| 156 | + "assets/timeline.json": { | |
| 157 | + "before": "/path/to/file", | |
| 158 | + "after": "/path/to/file" | |
| 159 | + }, | |
| 160 | + "compositions/s01.html": { | |
| 161 | + "before": "/path/to/file", | |
| 162 | + "after": "/path/to/file" | |
| 163 | + }, | |
| 164 | + "index.html": { | |
| 165 | + "before": "/path/to/file", | |
| 166 | + "after": "/path/to/file" | |
| 167 | + }, | |
| 168 | + "scenes/film.scenes": { | |
| 169 | + "before": "/path/to/file", | |
| 170 | + "after": "/path/to/file" | |
| 171 | + } | |
| 172 | + } | |
| 173 | + }, | |
| 174 | + "734fcec9-dfc0-425b-b1c6-e25363f926b5": { | |
| 175 | + "actor": { | |
| 176 | + "kind": "outside", | |
| 177 | + "name": "Outside" | |
| 178 | + }, | |
| 179 | + "label": "Changed outside the app", | |
| 180 | + "startedAt": 1793555840938, | |
| 181 | + "endedAt": 1793555840951, | |
| 182 | + "files": { | |
| 183 | + "assets/clips/take.mp4": { | |
| 184 | + "before": "/path/to/file", | |
| 185 | + "after": "/path/to/file" | |
| 186 | + }, | |
| 187 | + "assets/cues.js": { | |
| 188 | + "before": "/path/to/file", | |
| 189 | + "after": "/path/to/file" | |
| 190 | + }, | |
| 191 | + "assets/mix.m4a": { | |
| 192 | + "before": "/path/to/file", | |
| 193 | + "after": "/path/to/file" | |
| 194 | + }, | |
| 195 | + "assets/timeline.json": { | |
| 196 | + "before": "/path/to/file", | |
| 197 | + "after": "/path/to/file" | |
| 198 | + }, | |
| 199 | + "compositions/s01.html": { | |
| 200 | + "before": "/path/to/file", | |
| 201 | + "after": "/path/to/file" | |
| 202 | + }, | |
| 203 | + "index.html": { | |
| 204 | + "before": "/path/to/file", | |
| 205 | + "after": "/path/to/file" | |
| 206 | + }, | |
| 207 | + "scenes/film.scenes": { | |
| 208 | + "before": "/path/to/file", | |
| 209 | + "after": "/path/to/file" | |
| 210 | + } | |
| 211 | + } | |
| 212 | + }, | |
| 213 | + "874949b0-3bc3-4846-aa93-03663d655e9a": { | |
| 214 | + "actor": { | |
| 215 | + "kind": "outside", | |
| 216 | + "name": "Outside" | |
| 217 | + }, | |
| 218 | + "label": "Changed outside the app", | |
| 219 | + "startedAt": 1793556655089, | |
| 220 | + "endedAt": 1793556655102, | |
| 221 | + "files": { | |
| 222 | + "assets/clips/take.mp4": { | |
| 223 | + "before": "/path/to/file", | |
| 224 | + "after": "/path/to/file" | |
| 225 | + }, | |
| 226 | + "assets/cues.js": { | |
| 227 | + "before": "/path/to/file", | |
| 228 | + "after": "/path/to/file" | |
| 229 | + }, | |
| 230 | + "assets/mix.m4a": { | |
| 231 | + "before": "/path/to/file", | |
| 232 | + "after": "/path/to/file" | |
| 233 | + }, | |
| 234 | + "assets/timeline.json": { | |
| 235 | + "before": "/path/to/file", | |
| 236 | + "after": "/path/to/file" | |
| 237 | + }, | |
| 238 | + "compositions/s01.html": { | |
| 239 | + "before": "/path/to/file", | |
| 240 | + "after": "/path/to/file" | |
| 241 | + }, | |
| 242 | + "index.html": { | |
| 243 | + "before": "/path/to/file", | |
| 244 | + "after": "/path/to/file" | |
| 245 | + }, | |
| 246 | + "scenes/film.scenes": { | |
| 247 | + "before": "/path/to/file", | |
| 248 | + "after": "/path/to/file" | |
| 249 | + } | |
| 250 | + } | |
| 251 | + } | |
| 252 | + }, | |
| 253 | + "checks": { | |
| 254 | + "latest": { | |
| 255 | + "revision": null, | |
| 256 | + "id": "6b597f48-c652-4a06-bb96-1ef6493c73b9" | |
| 257 | + }, | |
| 258 | + "revisions": { | |
| 259 | + "082f3049-48df-4187-9a1a-fd85cfc3e615": [ | |
| 260 | + { | |
| 261 | + "id": "8022c887-37c7-47fe-8bfa-49b45c55c3d6", | |
| 262 | + "scope": "project", | |
| 263 | + "metadata": { | |
| 264 | + "ok": true, | |
| 265 | + "browserSkipped": false, | |
| 266 | + "options": { | |
| 267 | + "samples": 9, | |
| 268 | + "atTransitions": false, | |
| 269 | + "maxIssues": 80, | |
| 270 | + "collapseStatic": true, | |
| 271 | + "tolerance": 2, | |
| 272 | + "timeout": 3000, | |
| 273 | + "contrast": true, | |
| 274 | + "strict": false, | |
| 275 | + "snapshots": false, | |
| 276 | + "browserGpuMode": "auto" | |
| 277 | + } | |
| 278 | + }, | |
| 279 | + "createdAt": 1793555702922, | |
| 280 | + "contentHash": "908af38eb37976d3b8d6534a015d6bd08f982344fd1fca40f09144033e787f38", | |
| 281 | + "revision": "082f3049-48df-4187-9a1a-fd85cfc3e615", | |
| 282 | + "inputFingerprint": "a01bd087265d3d7ebefedec8765f1f0ecbf31c3b730aeb8033904a2e59b1b883", | |
| 283 | + "inputScope": "local-project-files", | |
| 284 | + "attribution": "recorded-revision", | |
| 285 | + "status": "cleaned", | |
| 286 | + "cleanedAfterRender": "c1c251dd-a8e1-4abc-a28f-65ef5bd88a8e" | |
| 287 | + } | |
| 288 | + ] | |
| 289 | + }, | |
| 290 | + "unversioned": [ | |
| 291 | + { | |
| 292 | + "id": "6b597f48-c652-4a06-bb96-1ef6493c73b9", | |
| 293 | + "scope": "project", | |
| 294 | + "report": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/checks/6b597f48-c652-4a06-bb96-1ef6493c73b9.json", | |
| 295 | + "metadata": { | |
| 296 | + "ok": true, | |
| 297 | + "browserSkipped": false, | |
| 298 | + "options": { | |
| 299 | + "samples": 9, | |
| 300 | + "atTransitions": false, | |
| 301 | + "maxIssues": 80, | |
| 302 | + "collapseStatic": true, | |
| 303 | + "tolerance": 2, | |
| 304 | + "timeout": 3000, | |
| 305 | + "contrast": true, | |
| 306 | + "strict": false, | |
| 307 | + "snapshots": false, | |
| 308 | + "browserGpuMode": "auto" | |
| 309 | + } | |
| 310 | + }, | |
| 311 | + "createdAt": 1793554066444, | |
| 312 | + "contentHash": "799a2e0e32c694d62d9e48b1ba9f03c6493cc9c84fc8a70d3057882bf4102708", | |
| 313 | + "revision": null, | |
| 314 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 315 | + "inputScope": "local-project-files", | |
| 316 | + "attribution": "unversioned" | |
| 317 | + } | |
| 318 | + ] | |
| 319 | + }, | |
| 320 | + "snapshots": { | |
| 321 | + "latest": { | |
| 322 | + "revision": null, | |
| 323 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-8" | |
| 324 | + }, | |
| 325 | + "revisions": {}, | |
| 326 | + "unversioned": [ | |
| 327 | + { | |
| 328 | + "scope": "full", | |
| 329 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-0", | |
| 330 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-00-at-3s.png", | |
| 331 | + "time": 3, | |
| 332 | + "metadata": { | |
| 333 | + "width": 1920, | |
| 334 | + "height": 1080, | |
| 335 | + "zoomScale": 1, | |
| 336 | + "browserGpuMode": "auto", | |
| 337 | + "warnings": [], | |
| 338 | + "partial": false | |
| 339 | + }, | |
| 340 | + "createdAt": 1793554073273, | |
| 341 | + "contentHash": "4a9d43221193291afd843d26dcbd6442e4ba96f800ef8c4ba9509562f072628a", | |
| 342 | + "revision": null, | |
| 343 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 344 | + "inputScope": "local-project-files", | |
| 345 | + "attribution": "unversioned" | |
| 346 | + }, | |
| 347 | + { | |
| 348 | + "scope": "full", | |
| 349 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-1", | |
| 350 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-01-at-12s.png", | |
| 351 | + "time": 12, | |
| 352 | + "metadata": { | |
| 353 | + "width": 1920, | |
| 354 | + "height": 1080, | |
| 355 | + "zoomScale": 1, | |
| 356 | + "browserGpuMode": "auto", | |
| 357 | + "warnings": [], | |
| 358 | + "partial": false | |
| 359 | + }, | |
| 360 | + "createdAt": 1793554073273, | |
| 361 | + "contentHash": "2750b21cd5c17dc88bec4bd525ecc84151b79a87842219f9414f93bc48edf98e", | |
| 362 | + "revision": null, | |
| 363 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 364 | + "inputScope": "local-project-files", | |
| 365 | + "attribution": "unversioned" | |
| 366 | + }, | |
| 367 | + { | |
| 368 | + "scope": "full", | |
| 369 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-2", | |
| 370 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-02-at-17s.png", | |
| 371 | + "time": 17, | |
| 372 | + "metadata": { | |
| 373 | + "width": 1920, | |
| 374 | + "height": 1080, | |
| 375 | + "zoomScale": 1, | |
| 376 | + "browserGpuMode": "auto", | |
| 377 | + "warnings": [], | |
| 378 | + "partial": false | |
| 379 | + }, | |
| 380 | + "createdAt": 1793554073273, | |
| 381 | + "contentHash": "bb7226a4b0bba05dfca09df5f04b81ccff511086a6066277e3694eca461848e7", | |
| 382 | + "revision": null, | |
| 383 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 384 | + "inputScope": "local-project-files", | |
| 385 | + "attribution": "unversioned" | |
| 386 | + }, | |
| 387 | + { | |
| 388 | + "scope": "full", | |
| 389 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-3", | |
| 390 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-03-at-21s.png", | |
| 391 | + "time": 21, | |
| 392 | + "metadata": { | |
| 393 | + "width": 1920, | |
| 394 | + "height": 1080, | |
| 395 | + "zoomScale": 1, | |
| 396 | + "browserGpuMode": "auto", | |
| 397 | + "warnings": [], | |
| 398 | + "partial": false | |
| 399 | + }, | |
| 400 | + "createdAt": 1793554073273, | |
| 401 | + "contentHash": "3f9808e0182cda577d31d2ffbbf0da27d75a21f69c892389f273d0823a289000", | |
| 402 | + "revision": null, | |
| 403 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 404 | + "inputScope": "local-project-files", | |
| 405 | + "attribution": "unversioned" | |
| 406 | + }, | |
| 407 | + { | |
| 408 | + "scope": "full", | |
| 409 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-4", | |
| 410 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-04-at-26s.png", | |
| 411 | + "time": 26, | |
| 412 | + "metadata": { | |
| 413 | + "width": 1920, | |
| 414 | + "height": 1080, | |
| 415 | + "zoomScale": 1, | |
| 416 | + "browserGpuMode": "auto", | |
| 417 | + "warnings": [], | |
| 418 | + "partial": false | |
| 419 | + }, | |
| 420 | + "createdAt": 1793554073273, | |
| 421 | + "contentHash": "620be4f2f6f1ed1f5a76887b35fcd82064722623747474b9baf7f093e05b9536", | |
| 422 | + "revision": null, | |
| 423 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 424 | + "inputScope": "local-project-files", | |
| 425 | + "attribution": "unversioned" | |
| 426 | + }, | |
| 427 | + { | |
| 428 | + "scope": "full", | |
| 429 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-5", | |
| 430 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-05-at-29.5s.png", | |
| 431 | + "time": 29.5, | |
| 432 | + "metadata": { | |
| 433 | + "width": 1920, | |
| 434 | + "height": 1080, | |
| 435 | + "zoomScale": 1, | |
| 436 | + "browserGpuMode": "auto", | |
| 437 | + "warnings": [], | |
| 438 | + "partial": false | |
| 439 | + }, | |
| 440 | + "createdAt": 1793554073273, | |
| 441 | + "contentHash": "08988c058545a906a568abda862029ea4a7654999f75834a8fb12955355242b2", | |
| 442 | + "revision": null, | |
| 443 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 444 | + "inputScope": "local-project-files", | |
| 445 | + "attribution": "unversioned" | |
| 446 | + }, | |
| 447 | + { | |
| 448 | + "scope": "full", | |
| 449 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-6", | |
| 450 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-06-at-34s.png", | |
| 451 | + "time": 34, | |
| 452 | + "metadata": { | |
| 453 | + "width": 1920, | |
| 454 | + "height": 1080, | |
| 455 | + "zoomScale": 1, | |
| 456 | + "browserGpuMode": "auto", | |
| 457 | + "warnings": [], | |
| 458 | + "partial": false | |
| 459 | + }, | |
| 460 | + "createdAt": 1793554073273, | |
| 461 | + "contentHash": "ffae0c51639aeb9b4205e6d139dd3ff3acc97bd5d4c19acc82baab976ab6e9bf", | |
| 462 | + "revision": null, | |
| 463 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 464 | + "inputScope": "local-project-files", | |
| 465 | + "attribution": "unversioned" | |
| 466 | + }, | |
| 467 | + { | |
| 468 | + "scope": "full", | |
| 469 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-7", | |
| 470 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-07-at-39s.png", | |
| 471 | + "time": 39, | |
| 472 | + "metadata": { | |
| 473 | + "width": 1920, | |
| 474 | + "height": 1080, | |
| 475 | + "zoomScale": 1, | |
| 476 | + "browserGpuMode": "auto", | |
| 477 | + "warnings": [], | |
| 478 | + "partial": false | |
| 479 | + }, | |
| 480 | + "createdAt": 1793554073273, | |
| 481 | + "contentHash": "64d5df60a6069561774c42102c1b4bb98eaf6c9ea88950aeb6d8a292899dcd5d", | |
| 482 | + "revision": null, | |
| 483 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 484 | + "inputScope": "local-project-files", | |
| 485 | + "attribution": "unversioned" | |
| 486 | + }, | |
| 487 | + { | |
| 488 | + "scope": "full", | |
| 489 | + "id": "1ed02d5d-16fc-40bc-b69f-8e74e0281b31-8", | |
| 490 | + "image": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/.hyperframes/artifacts/snapshots/4b449885-1f27-423b-9968-e0673b476438/frame-08-at-39.372s.png", | |
| 491 | + "time": 39.372, | |
| 492 | + "metadata": { | |
| 493 | + "width": 1920, | |
| 494 | + "height": 1080, | |
| 495 | + "zoomScale": 1, | |
| 496 | + "browserGpuMode": "auto", | |
| 497 | + "warnings": [], | |
| 498 | + "partial": false | |
| 499 | + }, | |
| 500 | + "createdAt": 1793554073273, | |
| 501 | + "contentHash": "8433c05eab6fc4b2861cd3504d89c7d34f29b43875e97fdaecc5cb9e90d80eb9", | |
| 502 | + "revision": null, | |
| 503 | + "inputFingerprint": "506a74dca38bdc0f60af384c08c71bbc3ae54e93a0d7835f05bf02c9e1185d09", | |
| 504 | + "inputScope": "local-project-files", | |
| 505 | + "attribution": "unversioned" | |
| 506 | + } | |
| 507 | + ] | |
| 508 | + }, | |
| 509 | + "renders": { | |
| 510 | + "latest": { | |
| 511 | + "id": "fa8f1ca6-4701-4c6f-ac25-6501ab324b9f", | |
| 512 | + "completedAt": 1793556684421, | |
| 513 | + "output": "/Volumes/Expand/Video/Motion Projects/airp-full-access-films/video/renders/sample.mp4", | |
| 514 | + "status": "completed", | |
| 515 | + "revision": "874949b0-3bc3-4846-aa93-03663d655e9a" | |
| 516 | + }, | |
| 517 | + "retainedRevisions": [ | |
| 518 | + "874949b0-3bc3-4846-aa93-03663d655e9a", | |
| 519 | + "734fcec9-dfc0-425b-b1c6-e25363f926b5" | |
| 520 | + ] | |
| 521 | + }, | |
| 522 | + "pendingArtifactCleanup": [] | |
| 523 | + } |
video/compositions/field.html added
| 1 | + <template> | |
| 2 | + <style> | |
| 3 | + #root { | |
| 4 | + position: absolute; | |
| 5 | + inset: 0; | |
| 6 | + background: #0d1117; | |
| 7 | + } | |
| 8 | + #field-canvas { | |
| 9 | + position: absolute; | |
| 10 | + left: 0; | |
| 11 | + top: 0; | |
| 12 | + width: 1920px; | |
| 13 | + height: 1080px; | |
| 14 | + } | |
| 15 | + </style> | |
| 16 | + <div data-hf-id="hf-qkep" id="root" data-composition-id="field" data-width="1920" data-height="1080"> | |
| 17 | + <canvas data-hf-id="hf-vfy6" id="field-canvas" width="1920" height="1080" data-layout-ignore></canvas> | |
| 18 | + </div> | |
| 19 | + <script> | |
| 20 | + (() => { | |
| 21 | + // One WebGL field of outlined triangles, ported from the site's home page. Every frame is a function of | |
| 22 | + // time alone: window.FIELD_CUES says which shape the particles hold, and when they burst into the next. | |
| 23 | + const N = 24000, NA = Math.floor(N * 0.1), M = N - NA; | |
| 24 | + const PX_PER_UNIT = 540 / (12 * Math.tan(Math.PI / 9)); | |
| 25 | + | |
| 26 | + const seeded = (seed) => () => { | |
| 27 | + seed = (seed + 0x6d2b79f5) | 0; | |
| 28 | + let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); | |
| 29 | + t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; | |
| 30 | + return ((t ^ (t >>> 14)) >>> 0) / 4294967296; | |
| 31 | + }; | |
| 32 | + | |
| 33 | + // Sample points from anything drawn on a canvas. Output height is 1, centred on the origin. | |
| 34 | + function maskPts(draw, W, H, seed, depth = 0.1) { | |
| 35 | + const R = seeded(seed); | |
| 36 | + const c = document.createElement("canvas"); | |
| 37 | + c.width = W; | |
| 38 | + c.height = H; | |
| 39 | + const g = c.getContext("2d", { willReadFrequently: true }); | |
| 40 | + g.fillStyle = "#fff"; | |
| 41 | + g.strokeStyle = "#fff"; | |
| 42 | + draw(g, W, H, R); | |
| 43 | + const d = g.getImageData(0, 0, W, H).data, px = []; | |
| 44 | + for (let y = 0; y < H; y += 2) for (let x = 0; x < W; x += 2) if (d[(y * W + x) * 4 + 3] > 128) px.push(x, y); | |
| 45 | + const out = new Float32Array(M * 3), n = px.length / 2; | |
| 46 | + for (let i = 0; i < M; i++) { | |
| 47 | + const k = Math.floor(R() * n) * 2; | |
| 48 | + out[i * 3] = (px[k] + R() * 2 - W / 2) / H; | |
| 49 | + out[i * 3 + 1] = (H / 2 - px[k + 1] - R() * 2) / H; | |
| 50 | + out[i * 3 + 2] = (R() - 0.5) * depth; | |
| 51 | + } | |
| 52 | + return out; | |
| 53 | + } | |
| 54 | + | |
| 55 | + const gaussian = (R) => { | |
| 56 | + let u = 0, v = 0; | |
| 57 | + while (!u) u = R(); | |
| 58 | + while (!v) v = R(); | |
| 59 | + return Math.sqrt(-2 * Math.log(u)) * Math.cos(6.2832 * v); | |
| 60 | + }; | |
| 61 | + | |
| 62 | + // Console windows tiled edge to edge: the old way | |
| 63 | + const pages = (cols, rows) => (g, W, H, R) => { | |
| 64 | + const w = W / cols, h = H / rows, k = h / 180; | |
| 65 | + for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) { | |
| 66 | + const x = c * w + (11 + R() * 8) * k, y = r * h + (11 + R() * 8) * k, bw = w - 30 * k, bh = h - 30 * k; | |
| 67 | + g.lineWidth = Math.max(2, 4 * k); | |
| 68 | + g.strokeRect(x, y, bw, bh); | |
| 69 | + g.fillRect(x, y, bw, 18 * k); | |
| 70 | + const lines = 3 + Math.floor(R() * 4); | |
| 71 | + for (let l = 0; l < lines; l++) g.fillRect(x + 18 * k, y + (38 + l * 18) * k, (bw - 36 * k) * (0.3 + R() * 0.65), 6 * k); | |
| 72 | + } | |
| 73 | + }; | |
| 74 | + | |
| 75 | + const promptGlyph = (g, W, H) => { | |
| 76 | + g.font = `600 ${H * 0.72}px "Geist Mono"`; | |
| 77 | + g.textAlign = "center"; | |
| 78 | + g.textBaseline = "middle"; | |
| 79 | + g.fillText(">_", W / 2, H / 2); | |
| 80 | + }; | |
| 81 | + | |
| 82 | + function drawGpu(g, x, y, w, h) { | |
| 83 | + const lw = h * 0.05, fanR = h * 0.3; | |
| 84 | + g.lineWidth = lw; | |
| 85 | + g.beginPath(); | |
| 86 | + g.roundRect(x, y, w, h, h * 0.07); | |
| 87 | + g.stroke(); | |
| 88 | + for (let f = 0; f < 3; f++) { | |
| 89 | + const cx = x + w * (0.2 + f * 0.3), cy = y + h * 0.5; | |
| 90 | + g.lineWidth = lw * 0.75; | |
| 91 | + g.beginPath(); | |
| 92 | + g.arc(cx, cy, fanR, 0, 6.2832); | |
| 93 | + g.stroke(); | |
| 94 | + g.beginPath(); | |
| 95 | + g.arc(cx, cy, fanR * 0.2, 0, 6.2832); | |
| 96 | + g.fill(); | |
| 97 | + for (let b = 0; b < 9; b++) { | |
| 98 | + const a = (b / 9) * 6.2832; | |
| 99 | + g.lineWidth = lw * 0.65; | |
| 100 | + g.beginPath(); | |
| 101 | + g.moveTo(cx + Math.cos(a) * fanR * 0.24, cy + Math.sin(a) * fanR * 0.24); | |
| 102 | + g.quadraticCurveTo(cx + Math.cos(a + 0.5) * fanR * 0.7, cy + Math.sin(a + 0.5) * fanR * 0.7, cx + Math.cos(a + 0.95) * fanR * 0.92, cy + Math.sin(a + 0.95) * fanR * 0.92); | |
| 103 | + g.stroke(); | |
| 104 | + } | |
| 105 | + } | |
| 106 | + for (let p = 0; p < 12; p++) g.fillRect(x + w * 0.14 + p * w * 0.042, y + h + lw, w * 0.03, h * 0.09); | |
| 107 | + } | |
| 108 | + const gpu = (g, W, H) => drawGpu(g, W * 0.06, H * 0.2, W * 0.88, H * 0.56); | |
| 109 | + | |
| 110 | + // Agent, link, GPU, for the three pieces | |
| 111 | + const pieces = (g, W, H) => { | |
| 112 | + g.font = `600 ${H * 0.5}px "Geist Mono"`; | |
| 113 | + g.textAlign = "center"; | |
| 114 | + g.textBaseline = "middle"; | |
| 115 | + g.fillText(">_", W * 0.13, H * 0.5); | |
| 116 | + g.lineWidth = H * 0.03; | |
| 117 | + for (let i = 0; i < 2; i++) { | |
| 118 | + g.setLineDash([H * 0.06, H * 0.05]); | |
| 119 | + g.beginPath(); | |
| 120 | + g.moveTo(W * (i ? 0.545 : 0.255), H * 0.5); | |
| 121 | + g.lineTo(W * (i ? 0.615 : 0.445), H * 0.5); | |
| 122 | + g.stroke(); | |
| 123 | + g.setLineDash([]); | |
| 124 | + } | |
| 125 | + g.lineWidth = H * 0.05; | |
| 126 | + g.beginPath(); | |
| 127 | + g.arc(W * 0.5, H * 0.5, H * 0.2, 0, 6.2832); | |
| 128 | + g.stroke(); | |
| 129 | + g.beginPath(); | |
| 130 | + g.arc(W * 0.5, H * 0.5, H * 0.07, 0, 6.2832); | |
| 131 | + g.fill(); | |
| 132 | + drawGpu(g, W * 0.635, H * 0.2, W * 0.34, H * 0.56); | |
| 133 | + }; | |
| 134 | + | |
| 135 | + // Prompt straight to the GPU, with nothing in between | |
| 136 | + const direct = (g, W, H) => { | |
| 137 | + g.font = `600 ${H * 0.5}px "Geist Mono"`; | |
| 138 | + g.textAlign = "center"; | |
| 139 | + g.textBaseline = "middle"; | |
| 140 | + g.fillText(">_", W * 0.13, H * 0.5); | |
| 141 | + g.lineWidth = H * 0.03; | |
| 142 | + g.setLineDash([H * 0.06, H * 0.05]); | |
| 143 | + g.beginPath(); | |
| 144 | + g.moveTo(W * 0.27, H * 0.5); | |
| 145 | + g.lineTo(W * 0.62, H * 0.5); | |
| 146 | + g.stroke(); | |
| 147 | + g.setLineDash([]); | |
| 148 | + drawGpu(g, W * 0.635, H * 0.2, W * 0.34, H * 0.56); | |
| 149 | + }; | |
| 150 | + | |
| 151 | + const server = (g, W, H) => { | |
| 152 | + g.lineWidth = H * 0.06; | |
| 153 | + g.beginPath(); | |
| 154 | + g.arc(W / 2, H / 2, H * 0.3, 0, 6.2832); | |
| 155 | + g.stroke(); | |
| 156 | + g.beginPath(); | |
| 157 | + g.arc(W / 2, H / 2, H * 0.11, 0, 6.2832); | |
| 158 | + g.fill(); | |
| 159 | + g.lineWidth = H * 0.04; | |
| 160 | + g.setLineDash([H * 0.07, H * 0.06]); | |
| 161 | + [[0.02, 0.5, 0.17, 0.5], [0.83, 0.5, 0.98, 0.5]].forEach(([x1, y1, x2, y2]) => { | |
| 162 | + g.beginPath(); | |
| 163 | + g.moveTo(W * x1, H * y1); | |
| 164 | + g.lineTo(W * x2, H * y2); | |
| 165 | + g.stroke(); | |
| 166 | + }); | |
| 167 | + g.setLineDash([]); | |
| 168 | + }; | |
| 169 | + | |
| 170 | + function drawCube(g, cx, cy, r) { | |
| 171 | + const dx = r * 0.87, dy = r * 0.5; | |
| 172 | + g.lineWidth = r * 0.06; | |
| 173 | + g.lineJoin = "round"; | |
| 174 | + g.beginPath(); | |
| 175 | + g.moveTo(cx, cy - r); | |
| 176 | + g.lineTo(cx + dx, cy - dy); | |
| 177 | + g.lineTo(cx + dx, cy + dy); | |
| 178 | + g.lineTo(cx, cy + r); | |
| 179 | + g.lineTo(cx - dx, cy + dy); | |
| 180 | + g.lineTo(cx - dx, cy - dy); | |
| 181 | + g.closePath(); | |
| 182 | + g.moveTo(cx - dx, cy - dy); | |
| 183 | + g.lineTo(cx, cy); | |
| 184 | + g.lineTo(cx + dx, cy - dy); | |
| 185 | + g.moveTo(cx, cy); | |
| 186 | + g.lineTo(cx, cy + r); | |
| 187 | + g.stroke(); | |
| 188 | + } | |
| 189 | + | |
| 190 | + function drawDisks(g, cx, cy, w, h, levels) { | |
| 191 | + g.lineWidth = h * 0.13; | |
| 192 | + for (let l = levels; l >= 0; l--) { | |
| 193 | + const y = cy + l * h * 0.95; | |
| 194 | + g.beginPath(); | |
| 195 | + g.ellipse(cx, y, w / 2, h / 2, 0, 0, l === 0 ? 6.2832 : 3.1416); | |
| 196 | + g.stroke(); | |
| 197 | + } | |
| 198 | + g.beginPath(); | |
| 199 | + g.moveTo(cx - w / 2, cy); | |
| 200 | + g.lineTo(cx - w / 2, cy + levels * h * 0.95); | |
| 201 | + g.moveTo(cx + w / 2, cy); | |
| 202 | + g.lineTo(cx + w / 2, cy + levels * h * 0.95); | |
| 203 | + g.stroke(); | |
| 204 | + } | |
| 205 | + const podVolume = (g, W, H) => { | |
| 206 | + drawCube(g, W * 0.5, H * 0.3, H * 0.26); | |
| 207 | + drawDisks(g, W * 0.5, H * 0.72, W * 0.58, H * 0.11, 2); | |
| 208 | + }; | |
| 209 | + const volumeOnly = (g, W, H) => drawDisks(g, W * 0.5, H * 0.72, W * 0.58, H * 0.11, 2); | |
| 210 | + | |
| 211 | + const quiet = (g, W, H, R) => { | |
| 212 | + for (let x = 0; x < W; x += 16) { | |
| 213 | + const h = 6 + R() * 12; | |
| 214 | + g.fillRect(x, H / 2 - h / 2, 8, h); | |
| 215 | + } | |
| 216 | + }; | |
| 217 | + | |
| 218 | + function modelAndCardPts() { | |
| 219 | + const brain = brainPts(18), card = maskPts(gpu, 1000, 420, 19), out = new Float32Array(M * 3); | |
| 220 | + for (let i = 0; i < M; i++) { | |
| 221 | + const isBrain = i % 5 < 3, source = isBrain ? brain : card, s = isBrain ? 0.62 : 1.02, shift = isBrain ? -1.55 : 1.7; | |
| 222 | + out[i * 3] = source[i * 3] * s + shift; | |
| 223 | + out[i * 3 + 1] = source[i * 3 + 1] * s; | |
| 224 | + out[i * 3 + 2] = source[i * 3 + 2] * s; | |
| 225 | + } | |
| 226 | + return out; | |
| 227 | + } | |
| 228 | + | |
| 229 | + // The Impossible A, straight from youtube/lockup-dark.svg | |
| 230 | + const mark = (g, W, H) => { | |
| 231 | + g.save(); | |
| 232 | + g.scale(W / 64, H / 64); | |
| 233 | + ["M3 49.94 L7.14 57.11 L56.86 57.11 L36.14 21.24 L32 28.41 L44.43 49.94Z", "M56.86 57.11 L61 49.94 L36.14 6.89 L15.43 42.76 L23.71 42.76 L36.14 21.24Z", "M36.14 6.89 L27.86 6.89 L3 49.94 L44.43 49.94 L40.29 42.76 L15.43 42.76Z"].forEach((d) => g.fill(new Path2D(d))); | |
| 234 | + g.restore(); | |
| 235 | + }; | |
| 236 | + | |
| 237 | + // Filled rectangles laid out in frame pixels, so they line up with the DOM labels over them | |
| 238 | + function rectsPts(spec, seed) { | |
| 239 | + const R = seeded(seed), rects = spec.split(";").map((r) => r.split(",").map(Number)); | |
| 240 | + const areas = rects.map(([, , w, h]) => w * h), total = areas.reduce((a, b) => a + b, 0); | |
| 241 | + const out = new Float32Array(M * 3); | |
| 242 | + for (let i = 0; i < M; i++) { | |
| 243 | + let pick = R() * total, k = 0; | |
| 244 | + while (pick > areas[k]) pick -= areas[k++]; | |
| 245 | + const [x, y, w, h] = rects[k]; | |
| 246 | + out[i * 3] = (x + R() * w - 960) / PX_PER_UNIT; | |
| 247 | + out[i * 3 + 1] = (540 - y - R() * h) / PX_PER_UNIT; | |
| 248 | + out[i * 3 + 2] = (R() - 0.5) * 0.04; | |
| 249 | + } | |
| 250 | + return out; | |
| 251 | + } | |
| 252 | + | |
| 253 | + function brainPts(seed) { | |
| 254 | + const R = seeded(seed), W = 400, H = 300; | |
| 255 | + const maskField = (draw) => { | |
| 256 | + const c = document.createElement("canvas"); | |
| 257 | + c.width = W; | |
| 258 | + c.height = H; | |
| 259 | + const g = c.getContext("2d", { willReadFrequently: true }); | |
| 260 | + g.fillStyle = "#fff"; | |
| 261 | + draw(g); | |
| 262 | + const a = g.getImageData(0, 0, W, H).data, D = new Float32Array(W * H), pts = []; | |
| 263 | + for (let i = 0; i < W * H; i++) D[i] = a[i * 4 + 3] > 127 ? 1e9 : 0; | |
| 264 | + for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) { | |
| 265 | + const i = y * W + x; | |
| 266 | + if (!D[i]) continue; | |
| 267 | + let d = D[i]; | |
| 268 | + d = x > 0 ? Math.min(d, D[i - 1] + 1) : Math.min(d, 1); | |
| 269 | + if (y > 0) { | |
| 270 | + d = Math.min(d, D[i - W] + 1); | |
| 271 | + if (x > 0) d = Math.min(d, D[i - W - 1] + 1.414); | |
| 272 | + if (x < W - 1) d = Math.min(d, D[i - W + 1] + 1.414); | |
| 273 | + } else d = Math.min(d, 1); | |
| 274 | + D[i] = d; | |
| 275 | + } | |
| 276 | + let max = 1; | |
| 277 | + for (let y = H - 1; y >= 0; y--) for (let x = W - 1; x >= 0; x--) { | |
| 278 | + const i = y * W + x; | |
| 279 | + if (!D[i]) continue; | |
| 280 | + let d = D[i]; | |
| 281 | + d = x < W - 1 ? Math.min(d, D[i + 1] + 1) : Math.min(d, 1); | |
| 282 | + if (y < H - 1) { | |
| 283 | + d = Math.min(d, D[i + W] + 1); | |
| 284 | + if (x < W - 1) d = Math.min(d, D[i + W + 1] + 1.414); | |
| 285 | + if (x > 0) d = Math.min(d, D[i + W - 1] + 1.414); | |
| 286 | + } else d = Math.min(d, 1); | |
| 287 | + D[i] = d; | |
| 288 | + if (d > max) max = d; | |
| 289 | + pts.push(i); | |
| 290 | + } | |
| 291 | + return { D, pts, max }; | |
| 292 | + }; | |
| 293 | + const segDist = (px, py, line) => { | |
| 294 | + let best = 1e9; | |
| 295 | + for (let k = 0; k < line.length - 1; k++) { | |
| 296 | + const [ax, ay] = line[k], [bx, by] = line[k + 1], vx = bx - ax, vy = by - ay; | |
| 297 | + const t = Math.max(0, Math.min(1, ((px - ax) * vx + (py - ay) * vy) / (vx * vx + vy * vy))); | |
| 298 | + const dx = px - ax - vx * t, dy = py - ay - vy * t; | |
| 299 | + best = Math.min(best, dx * dx + dy * dy); | |
| 300 | + } | |
| 301 | + return Math.sqrt(best); | |
| 302 | + }; | |
| 303 | + const cer = maskField((g) => { | |
| 304 | + g.beginPath(); | |
| 305 | + g.moveTo(36, 150); | |
| 306 | + g.bezierCurveTo(30, 95, 62, 48, 125, 33); | |
| 307 | + g.bezierCurveTo(190, 18, 265, 22, 312, 50); | |
| 308 | + g.bezierCurveTo(358, 78, 386, 125, 378, 170); | |
| 309 | + g.bezierCurveTo(372, 198, 352, 214, 326, 216); | |
| 310 | + g.lineTo(296, 213); | |
| 311 | + g.bezierCurveTo(272, 212, 258, 226, 244, 236); | |
| 312 | + g.bezierCurveTo(205, 252, 150, 252, 118, 236); | |
| 313 | + g.bezierCurveTo(98, 226, 90, 206, 104, 193); | |
| 314 | + g.lineTo(118, 186); | |
| 315 | + g.bezierCurveTo(92, 186, 60, 182, 44, 170); | |
| 316 | + g.bezierCurveTo(38, 165, 35, 158, 36, 150); | |
| 317 | + g.closePath(); | |
| 318 | + g.fill(); | |
| 319 | + }); | |
| 320 | + const cbl = maskField((g) => { | |
| 321 | + g.beginPath(); | |
| 322 | + g.ellipse(314, 240, 58, 33, -0.12, 0, 6.2832); | |
| 323 | + g.fill(); | |
| 324 | + }); | |
| 325 | + const stem = maskField((g) => { | |
| 326 | + g.beginPath(); | |
| 327 | + g.moveTo(236, 228); | |
| 328 | + g.lineTo(268, 230); | |
| 329 | + g.lineTo(278, 298); | |
| 330 | + g.lineTo(252, 299); | |
| 331 | + g.closePath(); | |
| 332 | + g.fill(); | |
| 333 | + }); | |
| 334 | + const sylvian = [[116, 188], [170, 160], [228, 136], [262, 122], [276, 108]]; | |
| 335 | + const central = [[206, 24], [196, 70], [186, 110], [176, 150]]; | |
| 336 | + const fold = (x, y, z) => { | |
| 337 | + const s = 3.2, qx = x * s, qy = y * s, qz = z * s; | |
| 338 | + const wx = qx + 0.9 * Math.sin(qy * 1.3 + qz * 0.7), wy = qy + 0.9 * Math.sin(qz * 1.1 + qx * 0.8), wz = qz + 0.9 * Math.sin(qx * 1.2 + qy * 0.9); | |
| 339 | + return Math.sin(wx * 1.1 + wy * 0.3) * Math.cos(wy - wz * 0.6) + 0.6 * Math.sin(wz * 1.3 + wx * 0.5 + wy * 0.4); | |
| 340 | + }; | |
| 341 | + const pick = (f) => { | |
| 342 | + const p = f.pts[Math.floor(R() * f.pts.length)]; | |
| 343 | + return { p, x: (p % W) + R(), y: Math.floor(p / W) + R() }; | |
| 344 | + }; | |
| 345 | + const out = new Float32Array(M * 3), k = 3 / 345, gap = 4; | |
| 346 | + let i = 0; | |
| 347 | + while (i < M) { | |
| 348 | + const r = R(); | |
| 349 | + let x, y, z; | |
| 350 | + if (r < 0.84) { | |
| 351 | + const q = pick(cer); | |
| 352 | + x = q.x; | |
| 353 | + y = q.y; | |
| 354 | + const dn = cer.D[q.p] / cer.max; | |
| 355 | + let h = 140 * Math.pow(dn, 0.42); | |
| 356 | + if (dn < 0.16 && R() < 0.22) h *= R(); | |
| 357 | + const side = R() < 0.5 ? -1 : 1; | |
| 358 | + const ds = Math.min(segDist(x, y, sylvian), segDist(x, y, central) * 1.3); | |
| 359 | + if (ds < 4.5 && R() < 0.93) continue; | |
| 360 | + let groove = 1 - Math.min(1, Math.abs(fold(x / 100, y / 100, (gap + h) / 100)) / 0.42); | |
| 361 | + groove = groove * groove * (3 - 2 * groove); | |
| 362 | + if (groove > 0.45 && R() < 0.95) continue; | |
| 363 | + h = Math.max(0, h - groove * 22); | |
| 364 | + z = side * (gap + h); | |
| 365 | + } else if (r < 0.95) { | |
| 366 | + const q = pick(cbl); | |
| 367 | + x = q.x; | |
| 368 | + y = q.y; | |
| 369 | + const f = Math.abs(Math.sin((y - 0.12 * x) * 0.42)); | |
| 370 | + if (f < 0.28 && R() < 0.8) continue; | |
| 371 | + z = (R() < 0.5 ? -1 : 1) * 96 * Math.pow(cbl.D[q.p] / cbl.max, 0.5); | |
| 372 | + } else { | |
| 373 | + const q = pick(stem); | |
| 374 | + x = q.x; | |
| 375 | + y = q.y; | |
| 376 | + z = (R() < 0.5 ? -1 : 1) * 22 * Math.pow(stem.D[q.p] / stem.max, 0.5); | |
| 377 | + } | |
| 378 | + out[i * 3] = (x - 210) * k; | |
| 379 | + out[i * 3 + 1] = -(y - 160) * k; | |
| 380 | + out[i * 3 + 2] = z * k; | |
| 381 | + i++; | |
| 382 | + } | |
| 383 | + return out; | |
| 384 | + } | |
| 385 | + | |
| 386 | + function dustPts(seed) { | |
| 387 | + const R = seeded(seed), out = new Float32Array(M * 3); | |
| 388 | + for (let i = 0; i < M; i++) { | |
| 389 | + out[i * 3] = (R() - 0.5) * 2.4; | |
| 390 | + out[i * 3 + 1] = (R() - 0.5) * 1.4; | |
| 391 | + out[i * 3 + 2] = (R() - 0.5) * 1.2; | |
| 392 | + } | |
| 393 | + return out; | |
| 394 | + } | |
| 395 | + | |
| 396 | + const named = { | |
| 397 | + pages1: () => maskPts(pages(1, 1), 960, 540, 11, 0.16), | |
| 398 | + pages2: () => maskPts(pages(2, 2), 960, 540, 11, 0.16), | |
| 399 | + pages3: () => maskPts(pages(4, 3), 960, 540, 11, 0.16), | |
| 400 | + pages4: () => maskPts(pages(7, 5), 960, 540, 11, 0.16), | |
| 401 | + prompt: () => maskPts(promptGlyph, 540, 360, 12), | |
| 402 | + gpu: () => maskPts(gpu, 1000, 420, 13), | |
| 403 | + pieces: () => maskPts(pieces, 1200, 400, 14), | |
| 404 | + mark: () => maskPts(mark, 512, 512, 15, 0.04), | |
| 405 | + brain: () => brainPts(16), | |
| 406 | + dust: () => dustPts(17), | |
| 407 | + direct: () => maskPts(direct, 1200, 400, 20), | |
| 408 | + server: () => maskPts(server, 620, 500, 21), | |
| 409 | + podvol: () => maskPts(podVolume, 800, 800, 22), | |
| 410 | + volume: () => maskPts(volumeOnly, 800, 800, 23), | |
| 411 | + quiet: () => maskPts(quiet, 1440, 200, 24), | |
| 412 | + modelcard: modelAndCardPts, | |
| 413 | + }; | |
| 414 | + const shapeFor = (id, seed) => (id.startsWith("rects:") ? rectsPts(id.slice(6), seed) : named[id]()); | |
| 415 | + | |
| 416 | + const VERTEX = ` | |
| 417 | + precision highp float; | |
| 418 | + uniform float uTime, uProgress, uStagger, uPx, uBurst, uSnap, uDimA, uDimB, uScaleA, uScaleB, uQuantA, uQuantB, uSpinA, uSpinB, uFlatA, uFlatB; | |
| 419 | + uniform vec2 uWave; | |
| 420 | + uniform vec3 uOffA, uOffB; | |
| 421 | + uniform mat3 uRot; | |
| 422 | + uniform mat4 uProj; | |
| 423 | + attribute vec3 aFrom, aTo; | |
| 424 | + attribute vec4 aRand; | |
| 425 | + attribute float aAmb; | |
| 426 | + varying vec3 vColor; | |
| 427 | + varying float vAlpha, vRot; | |
| 428 | + vec3 spinY(vec3 p, float a) { float c = cos(a), s = sin(a); return vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c); } | |
| 429 | + void main() { | |
| 430 | + // Each particle starts its move at a delay set by where it sits, so a change sweeps across the frame | |
| 431 | + vec3 a = spinY(aFrom, uSpinA), b = spinY(aTo, uSpinB); | |
| 432 | + float delay = clamp(0.5 + dot(a.xy * uScaleA + uOffA.xy, uWave) / 15.0, 0.0, 1.0) * uStagger; | |
| 433 | + float m = smoothstep(delay, delay + 1.0 - uStagger, uProgress); | |
| 434 | + float body = 1.0 - aAmb, flat_ = mix(uFlatA, uFlatB, m); | |
| 435 | + vec3 p = aFrom; | |
| 436 | + if (aAmb < 0.5) { | |
| 437 | + vec3 local = mix(a, b, m); | |
| 438 | + float q = m < 0.5 ? uQuantA : uQuantB; | |
| 439 | + if (q > 0.0) local = floor(local / q + 0.5) * q; | |
| 440 | + local *= mix(uScaleA, uScaleB, m); | |
| 441 | + p = uRot * local + mix(uOffA, uOffB, m); | |
| 442 | + } | |
| 443 | + float arc = (uSnap > 0.5 && m > 0.5) ? cos(pow((m - 0.5) * 2.0, 2.0) * 1.5708) : sin(m * 3.14159); | |
| 444 | + float burst = pow(max(arc, 0.0), 1.25) * body * uBurst; | |
| 445 | + vec3 dir = normalize(vec3(aRand.x - 0.5, aRand.y - 0.5, aRand.z - 0.5) + 0.0001); | |
| 446 | + float sw = burst * (aRand.y - 0.5) * 2.4, cs = cos(sw), sn = sin(sw); | |
| 447 | + vec2 fl = vec2(dir.x * cs - dir.y * sn, dir.x * sn + dir.y * cs); | |
| 448 | + p += vec3(fl * (1.7 + aRand.w * 4.2), 0.55 + aRand.w * 3.6) * burst; | |
| 449 | + float t = uTime * (0.25 + aRand.y * 0.5); | |
| 450 | + p += vec3(sin(t + aRand.z * 20.0), cos(t * 1.3 + aRand.x * 20.0), sin(t * 0.7 + aRand.w * 20.0)) * (mix(0.018, 0.004, flat_) * body + aAmb * 0.4); | |
| 451 | + vec3 mv = p - vec3(0.0, 0.0, 12.0); | |
| 452 | + gl_Position = uProj * vec4(mv, 1.0); | |
| 453 | + float sz = (0.55 + aRand.w * 0.95) * uPx * (12.0 / -mv.z) * (1.0 + burst * 0.3); | |
| 454 | + gl_PointSize = min(sz, uPx * 3.6); | |
| 455 | + float g = clamp(0.48 + p.y * 0.09 + p.z * 0.06 + (aRand.y - 0.5) * 0.85, 0.0, 1.0); | |
| 456 | + vec3 deep = vec3(0.07, 0.24, 0.62), brand = vec3(0.275, 0.667, 0.914), ice = vec3(0.75, 0.89, 0.98); | |
| 457 | + vec3 col = g < 0.4 ? mix(deep, brand, g / 0.4) : (g < 0.78 ? mix(brand, ice, (g - 0.4) / 0.38) : mix(ice, vec3(1.0), (g - 0.78) / 0.22)); | |
| 458 | + if (aAmb > 0.5 && aRand.x > 0.93) col = aRand.w > 0.5 ? vec3(1.0) : ice; | |
| 459 | + vColor = col; | |
| 460 | + float tw = 0.62 + 0.38 * sin(uTime * (0.7 + aRand.y * 2.2) + aRand.x * 40.0); | |
| 461 | + vAlpha = tw * mix(0.72, 0.34, aAmb) * mix(mix(uDimA, uDimB, m), 1.0, aAmb * 0.4) * mix(1.0, 0.5, burst); | |
| 462 | + vRot = aRand.x * 6.2832 + uTime * (aRand.z - 0.5) * 1.4; | |
| 463 | + }`; | |
| 464 | + const FRAGMENT = ` | |
| 465 | + precision highp float; | |
| 466 | + varying vec3 vColor; | |
| 467 | + varying float vAlpha, vRot; | |
| 468 | + float sdTri(vec2 p, float r) { | |
| 469 | + const float k = 1.7320508; | |
| 470 | + p.x = abs(p.x) - r; | |
| 471 | + p.y = p.y + r / k; | |
| 472 | + if (p.x + k * p.y > 0.0) p = vec2(p.x - k * p.y, -k * p.x - p.y) / 2.0; | |
| 473 | + p.x -= clamp(p.x, -2.0 * r, 0.0); | |
| 474 | + return -length(p) * sign(p.y); | |
| 475 | + } | |
| 476 | + void main() { | |
| 477 | + vec2 p = gl_PointCoord * 2.0 - 1.0; | |
| 478 | + p.y = -p.y; | |
| 479 | + float c = cos(vRot), s = sin(vRot); | |
| 480 | + p = mat2(c, -s, s, c) * p; | |
| 481 | + float d = sdTri(p, 0.62); | |
| 482 | + float a = 1.0 - smoothstep(0.06, 0.22, abs(d)); | |
| 483 | + if (a < 0.02) discard; | |
| 484 | + gl_FragColor = vec4(vColor, a * vAlpha); | |
| 485 | + }`; | |
| 486 | + | |
| 487 | + const canvas = document.getElementById("field-canvas"); | |
| 488 | + // Draw at the render's pixel density, so a 4K render stays sharp. | |
| 489 | + const density = window.devicePixelRatio || 1; | |
| 490 | + canvas.width = 1920 * density; | |
| 491 | + canvas.height = 1080 * density; | |
| 492 | + const gl = canvas.getContext("webgl", { antialias: false, alpha: false, preserveDrawingBuffer: true, premultipliedAlpha: false }); | |
| 493 | + let draw = () => {}; | |
| 494 | + | |
| 495 | + function setUp() { | |
| 496 | + const cues = window.FIELD_CUES; | |
| 497 | + const compile = (type, src) => { | |
| 498 | + const s = gl.createShader(type); | |
| 499 | + gl.shaderSource(s, src); | |
| 500 | + gl.compileShader(s); | |
| 501 | + if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s)); | |
| 502 | + return s; | |
| 503 | + }; | |
| 504 | + const program = gl.createProgram(); | |
| 505 | + gl.attachShader(program, compile(gl.VERTEX_SHADER, VERTEX)); | |
| 506 | + gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAGMENT)); | |
| 507 | + gl.linkProgram(program); | |
| 508 | + gl.useProgram(program); | |
| 509 | + | |
| 510 | + const R = seeded(7), rand = new Float32Array(N * 4), amb = new Float32Array(N), ambPos = new Float32Array(NA * 3); | |
| 511 | + for (let i = 0; i < N * 4; i++) rand[i] = R(); | |
| 512 | + for (let i = 0; i < NA; i++) { | |
| 513 | + amb[i] = 1; | |
| 514 | + ambPos[i * 3] = (R() * 1.24 - 0.62) * 17; | |
| 515 | + ambPos[i * 3 + 1] = (R() * 1.24 - 0.62) * 9.6; | |
| 516 | + ambPos[i * 3 + 2] = R() * 7.5 - 5; | |
| 517 | + } | |
| 518 | + const attr = (name, data, size) => { | |
| 519 | + const buffer = gl.createBuffer(), loc = gl.getAttribLocation(program, name); | |
| 520 | + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); | |
| 521 | + gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW); | |
| 522 | + gl.enableVertexAttribArray(loc); | |
| 523 | + gl.vertexAttribPointer(loc, size, gl.FLOAT, false, 0, 0); | |
| 524 | + }; | |
| 525 | + attr("aRand", rand, 4); | |
| 526 | + attr("aAmb", amb, 1); | |
| 527 | + | |
| 528 | + const buffers = {}; | |
| 529 | + cues.forEach((cue, k) => { | |
| 530 | + if (buffers[cue.shape]) return; | |
| 531 | + const full = new Float32Array(N * 3); | |
| 532 | + full.set(ambPos, 0); | |
| 533 | + full.set(shapeFor(cue.shape, 100 + k), NA * 3); | |
| 534 | + const buffer = gl.createBuffer(); | |
| 535 | + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); | |
| 536 | + gl.bufferData(gl.ARRAY_BUFFER, full, gl.STATIC_DRAW); | |
| 537 | + buffers[cue.shape] = buffer; | |
| 538 | + }); | |
| 539 | + const bind = (name, shape) => { | |
| 540 | + const loc = gl.getAttribLocation(program, name); | |
| 541 | + gl.bindBuffer(gl.ARRAY_BUFFER, buffers[shape]); | |
| 542 | + gl.enableVertexAttribArray(loc); | |
| 543 | + gl.vertexAttribPointer(loc, 3, gl.FLOAT, false, 0, 0); | |
| 544 | + }; | |
| 545 | + | |
| 546 | + const u = (name) => gl.getUniformLocation(program, name); | |
| 547 | + const f = 1 / Math.tan(Math.PI / 9), aspect = 16 / 9, near = 0.1, far = 100; | |
| 548 | + gl.uniformMatrix4fv(u("uProj"), false, new Float32Array([f / aspect, 0, 0, 0, 0, f, 0, 0, 0, 0, (far + near) / (near - far), -1, 0, 0, (2 * far * near) / (near - far), 0])); | |
| 549 | + gl.uniform1f(u("uPx"), 11 * density); | |
| 550 | + gl.viewport(0, 0, canvas.width, canvas.height); | |
| 551 | + gl.enable(gl.BLEND); | |
| 552 | + gl.blendFunc(gl.SRC_ALPHA, gl.ONE); | |
| 553 | + gl.clearColor(13 / 255, 17 / 255, 23 / 255, 1); | |
| 554 | + | |
| 555 | + const defaults = { x: 0, y: 0, s: 3, tilt: 0, turn: 0, sway: 0.14, spin: 0, twist: 0, snap: 0, dim: 1, flat: 0, quant: 0, dur: 1.9, burst: 1, push: 0, wave: [1, 0] }; | |
| 556 | + const list = cues.map((c) => ({ ...defaults, ...c })); | |
| 557 | + const smooth = (x) => { | |
| 558 | + const v = Math.min(1, Math.max(0, x)); | |
| 559 | + return v * v * (3 - 2 * v); | |
| 560 | + }; | |
| 561 | + const lerp = (a, b, m) => a + (b - a) * m; | |
| 562 | + const pose = (c, t) => [c.tilt, c.turn + Math.sin(t * 0.3) * c.sway + c.twist * (t - c.t)]; | |
| 563 | + const scaleOf = (c, t) => c.s * (1 + c.push * (t - c.t)); | |
| 564 | + | |
| 565 | + draw = (t) => { | |
| 566 | + let k = 0; | |
| 567 | + while (k + 1 < list.length && list[k + 1].t <= t) k++; | |
| 568 | + const to = list[k], from = list[Math.max(0, k - 1)]; | |
| 569 | + const m = k === 0 ? 1 : Math.min(1, Math.max(0, (t - to.t) / to.dur)); | |
| 570 | + bind("aFrom", from.shape); | |
| 571 | + bind("aTo", to.shape); | |
| 572 | + gl.uniform1f(u("uProgress"), m); | |
| 573 | + gl.uniform1f(u("uStagger"), to.wave ? 0.55 : 0); | |
| 574 | + gl.uniform2fv(u("uWave"), to.wave || [0, 0]); | |
| 575 | + gl.uniform1f(u("uTime"), t); | |
| 576 | + gl.uniform1f(u("uBurst"), to.burst); | |
| 577 | + gl.uniform1f(u("uSnap"), to.snap); | |
| 578 | + gl.uniform1f(u("uScaleA"), scaleOf(from, t)); | |
| 579 | + gl.uniform1f(u("uScaleB"), scaleOf(to, t)); | |
| 580 | + const fading = to.fade ? 1 - smooth((m - to.fade[0]) / (to.fade[1] - to.fade[0])) : null; | |
| 581 | + gl.uniform1f(u("uDimA"), fading ?? from.dim); | |
| 582 | + gl.uniform1f(u("uDimB"), fading ?? to.dim); | |
| 583 | + gl.uniform1f(u("uFlatA"), from.flat); | |
| 584 | + gl.uniform1f(u("uFlatB"), to.flat); | |
| 585 | + gl.uniform1f(u("uSpinA"), from.spin * t); | |
| 586 | + gl.uniform1f(u("uSpinB"), to.spin * t); | |
| 587 | + gl.uniform1f(u("uQuantA"), from.quant); | |
| 588 | + gl.uniform1f(u("uQuantB"), to.quant); | |
| 589 | + gl.uniform3f(u("uOffA"), from.x, from.y, 0); | |
| 590 | + gl.uniform3f(u("uOffB"), to.x, to.y, 0); | |
| 591 | + const eased = smooth(m), A = pose(from, t), B = pose(to, t), tilt = lerp(A[0], B[0], eased), turn = lerp(A[1], B[1], eased); | |
| 592 | + const cx = Math.cos(tilt), sx = Math.sin(tilt), cy = Math.cos(turn), sy = Math.sin(turn); | |
| 593 | + gl.uniformMatrix3fv(u("uRot"), false, new Float32Array([cy, sx * sy, -cx * sy, 0, cx, sx, sy, -sx * cy, cx * cy])); | |
| 594 | + gl.clear(gl.COLOR_BUFFER_BIT); | |
| 595 | + gl.drawArrays(gl.POINTS, 0, N); | |
| 596 | + }; | |
| 597 | + } | |
| 598 | + | |
| 599 | + window.addEventListener("hf-seek", (e) => draw(e.detail.time)); | |
| 600 | + const ready = document.fonts.load('600 100px "Geist Mono"').then(() => { | |
| 601 | + setUp(); | |
| 602 | + draw(0); | |
| 603 | + }); | |
| 604 | + window.__hf = window.__hf || {}; | |
| 605 | + window.__hf.buildReady = window.__hf.buildReady || {}; | |
| 606 | + window.__hf.buildReady.field = ready; | |
| 607 | + window.__timelines["field"] = gsap.timeline({ paused: true }).to({ v: 0 }, { v: 1, duration: window.FILM_SECONDS }, 0); | |
| 608 | + })(); | |
| 609 | + </script> | |
| 610 | + </template> |
video/compositions/s01.html added
| 1 | + <template> | |
| 2 | + <style> | |
| 3 | + #root { position: absolute; inset: 0; } | |
| 4 | + | |
| 5 | + #win { position: absolute; left: 800px; top: 62px; width: 970px; height: 955px; overflow: hidden; border-radius: 22px; border: 2px solid var(--line); background: var(--card); } | |
| 6 | + #mover { position: absolute; left: 0; top: 0; width: 970px; height: 955px; } | |
| 7 | + #take { position: absolute; left: 0; top: 0; width: 970px; height: 955px; object-fit: fill; } | |
| 8 | + #chap { position: absolute; left: 150px; top: 120px; } | |
| 9 | + .col { position: absolute; left: 150px; width: 590px; } | |
| 10 | + #title { top: 180px; font-size: 76px; } | |
| 11 | + #path { top: 520px; font-family: var(--mono); font-weight: 500; font-size: 36px; line-height: 1.5; color: var(--ink); } | |
| 12 | + #keys { position: absolute; left: 150px; top: 400px; font-family: var(--mono); font-weight: 600; font-size: 44px; color: var(--sky); background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 26px; } | |
| 13 | + #warn-h { top: 360px; font-size: 56px; } | |
| 14 | + #warn-b { top: 500px; font-size: 38px; color: var(--ink); } | |
| 15 | + #only { top: 400px; font-size: 56px; } | |
| 16 | + #only .hit { display: block; margin-top: 16px; } | |
| 17 | + #m1 { top: 390px; } | |
| 18 | + #m2 { top: 560px; font-size: 38px; } | |
| 19 | + #p-h { top: 340px; font-size: 36px; } | |
| 20 | + #p-b { top: 410px; font-family: var(--mono); font-weight: 500; font-size: 40px; line-height: 1.4; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 26px 30px; } | |
| 21 | + | |
| 22 | + </style> | |
| 23 | + <div id="root" data-composition-id="s01" data-width="1920" data-height="1080"> | |
| 24 | + <div id="win" data-layout-allow-overflow> | |
| 25 | + <div id="mover"><video id="take" class="clip" src="assets/clips/take.mp4" data-start="0" data-duration="46.485" muted playsinline></video></div> | |
| 26 | + </div> | |
| 27 | + <div id="chap" class="tag">Turn it on</div> | |
| 28 | + <div id="title" class="col big">Full access starts hidden</div> | |
| 29 | + <div id="keys">⌘ ,</div> | |
| 30 | + <div id="path" class="col">Settings<br>General<br>Permissions</div> | |
| 31 | + <div id="warn-h" class="col mid">The warning is the point</div> | |
| 32 | + <div id="warn-b" class="col say">Internet, files, no approvals, destructive commands included.</div> | |
| 33 | + <div id="only" class="col mid">Confirm adds it to the menu.<span class="hit">It stays off.</span></div> | |
| 34 | + <div id="m1" class="col mid">Leave Full access alone</div> | |
| 35 | + <div id="m2" class="col say">Choose <span class="hit">Approve for me</span></div> | |
| 36 | + <div id="p-h" class="col say">The prompt</div> | |
| 37 | + <div id="p-b" class="col">Add a short Hours section to index.html.</div> | |
| 38 | + </div> | |
| 39 | + <script> | |
| 40 | + (() => { | |
| 41 | + const tl = gsap.timeline({ paused: true }); | |
| 42 | + const { land, rise, leave, card, cardOut, mark, open, camera } = Film(tl); | |
| 43 | + open("#win", 0.1); | |
| 44 | + tl.set("#win", { opacity: 1 }, 0); | |
| 45 | + land("#chap", 0.3); | |
| 46 | + rise("#title", 1.200); | |
| 47 | + land("#keys", 3.557); | |
| 48 | + land("#path", 4.799); | |
| 49 | + leave("#title, #keys, #path", 7.530); | |
| 50 | + camera("#mover", 9.485, 1.6, -291, -286, 0.9); | |
| 51 | + land("#warn-h", 9.785); | |
| 52 | + land("#warn-b", 11.167); | |
| 53 | + leave("#warn-h, #warn-b", 19.076); | |
| 54 | + land("#only", 19.276); | |
| 55 | + camera("#mover", 19.276, 1, 0, 0, 0.7); | |
| 56 | + leave("#only", 23.423); | |
| 57 | + camera("#mover", 23.523, 1.7, -164, -668, 0.8); | |
| 58 | + land("#m1", 27.176); | |
| 59 | + land("#m2", 28.685); | |
| 60 | + leave("#m1, #m2", 30.685); | |
| 61 | + camera("#mover", 30.685, 1, 0, 0, 0.7); | |
| 62 | + land("#p-h", 32.285); | |
| 63 | + land("#p-b", 33.864); | |
| 64 | + camera("#mover", 43.064, 1.4, -388, -258, 1.2); | |
| 65 | + window.__timelines["s01"] = tl; | |
| 66 | + })(); | |
| 67 | + </script> | |
| 68 | + </template> |
video/hyperframes.json added
| 1 | + { | |
| 2 | + "$schema": "https://hyperframes.heygen.com/schema/hyperframes.json", | |
| 3 | + "registry": "https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry", | |
| 4 | + "paths": { | |
| 5 | + "blocks": "compositions", | |
| 6 | + "components": "compositions/components", | |
| 7 | + "assets": "assets" | |
| 8 | + }, | |
| 9 | + "media": { | |
| 10 | + "autoProxy": true | |
| 11 | + }, | |
| 12 | + "authoringSkill": "hyperframes" | |
| 13 | + } |
video/index.html added
| 1 | + <!doctype html> | |
| 2 | + <html lang="en"> | |
| 3 | + <head> | |
| 4 | + <meta charset="UTF-8" /> | |
| 5 | + <meta name="viewport" content="width=1920, height=1080" /> | |
| 6 | + <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script> | |
| 7 | + <script src="assets/cues.js"></script> | |
| 8 | + <script src="assets/film.js"></script> | |
| 9 | + <link rel="stylesheet" href="assets/film.css" /> | |
| 10 | + </head> | |
| 11 | + <body> | |
| 12 | + <div id="root" data-composition-id="main" data-start="0" data-duration="46.485" data-width="1920" data-height="1080" data-fps="30"> | |
| 13 | + <div id="field" data-composition-id="field" data-composition-src="compositions/field.html" data-start="0" data-duration="46.485" data-track-index="0" data-track-kind="graphics" data-width="1920" data-height="1080"></div> | |
| 14 | + <div id="s01" data-composition-id="s01" data-composition-src="compositions/s01.html" data-start="0.000" data-duration="46.485" data-track-index="1" data-track-kind="graphics" data-width="1920" data-height="1080"></div> | |
| 15 | + <audio id="mix" class="clip" src="assets/mix.m4a" data-start="0" data-duration="46.485" data-track-index="2" data-volume="1"></audio> | |
| 16 | + </div> | |
| 17 | + <script> | |
| 18 | + window.__timelines = window.__timelines || {}; | |
| 19 | + window.__timelines["main"] = gsap.timeline({ paused: true }); | |
| 20 | + </script> | |
| 21 | + </body> | |
| 22 | + </html> |
video/package.json added
| 1 | + { | |
| 2 | + "name": "airp-runpod-comfyui", | |
| 3 | + "private": true, | |
| 4 | + "type": "module", | |
| 5 | + "scripts": { | |
| 6 | + "check": "npx hyperframes check --json", | |
| 7 | + "render": "npx hyperframes render" | |
| 8 | + } | |
| 9 | + } |
video/scenes/cues.tpl.js added
| 1 | + // What the particle field holds, and when. Times are voice anchors, filled in by tools/build_film.py. | |
| 2 | + const GALAXY = { shape: "galaxy", s: 7.4, y: -6.2, tilt: 0.82, sway: 0, spin: 0.04 }; | |
| 3 | + window.FIELD_CUES = [ | |
| 4 | + { t: 0, ...GALAXY, dim: 0.5 }, | |
| 5 | + { t: @{b02:this warning-0.3}, ...GALAXY, dim: 0.3, wave: [1, 0] }, | |
| 6 | + { t: @{b04:start-0.4}, ...GALAXY, dim: 0.5, wave: [0, -1] }, | |
| 7 | + ]; |
video/scenes/film.scenes added
| 1 | + === s01 | 0 | |
| 2 | + <style> | |
| 3 | + #win { position: absolute; left: 800px; top: 62px; width: 970px; height: 955px; overflow: hidden; border-radius: 22px; border: 2px solid var(--line); background: var(--card); } | |
| 4 | + #mover { position: absolute; left: 0; top: 0; width: 970px; height: 955px; } | |
| 5 | + #take { position: absolute; left: 0; top: 0; width: 970px; height: 955px; object-fit: fill; } | |
| 6 | + #chap { position: absolute; left: 150px; top: 120px; } | |
| 7 | + .col { position: absolute; left: 150px; width: 590px; } | |
| 8 | + #title { top: 180px; font-size: 76px; } | |
| 9 | + #path { top: 520px; font-family: var(--mono); font-weight: 500; font-size: 36px; line-height: 1.5; color: var(--ink); } | |
| 10 | + #keys { position: absolute; left: 150px; top: 400px; font-family: var(--mono); font-weight: 600; font-size: 44px; color: var(--sky); background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 26px; } | |
| 11 | + #warn-h { top: 360px; font-size: 56px; } | |
| 12 | + #warn-b { top: 500px; font-size: 38px; color: var(--ink); } | |
| 13 | + #only { top: 400px; font-size: 56px; } | |
| 14 | + #only .hit { display: block; margin-top: 16px; } | |
| 15 | + #m1 { top: 390px; } | |
| 16 | + #m2 { top: 560px; font-size: 38px; } | |
| 17 | + #p-h { top: 340px; font-size: 36px; } | |
| 18 | + #p-b { top: 410px; font-family: var(--mono); font-weight: 500; font-size: 40px; line-height: 1.4; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 26px 30px; } | |
| 19 | + </style> | |
| 20 | + <div id="win" data-layout-allow-overflow> | |
| 21 | + <div id="mover"><video id="take" class="clip" src="assets/clips/take.mp4" data-start="0" data-duration="@{end}" muted playsinline></video></div> | |
| 22 | + </div> | |
| 23 | + <div id="chap" class="tag">Turn it on</div> | |
| 24 | + <div id="title" class="col big">Full access starts hidden</div> | |
| 25 | + <div id="keys">⌘ ,</div> | |
| 26 | + <div id="path" class="col">Settings<br>General<br>Permissions</div> | |
| 27 | + <div id="warn-h" class="col mid">The warning is the point</div> | |
| 28 | + <div id="warn-b" class="col say">Internet, files, no approvals, destructive commands included.</div> | |
| 29 | + <div id="only" class="col mid">Confirm adds it to the menu.<span class="hit">It stays off.</span></div> | |
| 30 | + <div id="m1" class="col mid">Leave Full access alone</div> | |
| 31 | + <div id="m2" class="col say">Choose <span class="hit">Approve for me</span></div> | |
| 32 | + <div id="p-h" class="col say">The prompt</div> | |
| 33 | + <div id="p-b" class="col">Add a short Hours section to index.html.</div> | |
| 34 | + --- | |
| 35 | + open("#win", 0.1); | |
| 36 | + tl.set("#win", { opacity: 1 }, 0); | |
| 37 | + land("#chap", 0.3); | |
| 38 | + rise("#title", @{b01:start}); | |
| 39 | + land("#keys", @{b01:press command}); | |
| 40 | + land("#path", @{b01:open general}); | |
| 41 | + leave("#title, #keys, #path", @{b02:start-0.2}); | |
| 42 | + camera("#mover", @{b02:this warning-0.3}, 1.6, -291, -286, 0.9); | |
| 43 | + land("#warn-h", @{b02:this warning}); | |
| 44 | + land("#warn-b", @{b02:chatgpt can access}); | |
| 45 | + leave("#warn-h, #warn-b", @{b03:start-0.2}); | |
| 46 | + land("#only", @{b03:start}); | |
| 47 | + camera("#mover", @{b03:start}, 1, 0, 0, 0.7); | |
| 48 | + leave("#only", @{b04:start-0.2}); | |
| 49 | + camera("#mover", @{b04:start-0.1}, 1.7, -164, -668, 0.8); | |
| 50 | + land("#m1", @{b04:im going}); | |
| 51 | + land("#m2", @{b04:choose approve}); | |
| 52 | + leave("#m1, #m2", @{b05:start-1.6}); | |
| 53 | + camera("#mover", @{b05:start-1.6}, 1, 0, 0, 0.7); | |
| 54 | + land("#p-h", @{b05:start}); | |
| 55 | + land("#p-b", @{b05:add an hours}); | |
| 56 | + camera("#mover", @{b05:end+4.37}, 1.4, -388, -258, 1.2); |