Skip to content

Commit 9a2fc7b

Browse files
jsegaranindent
andcommitted
Resize parrot gif to 160x80 in image build, bump terminal to 200x50.
The 1024x1024 source gif wastes CPU since tct can only render ~col x row*2 pixels. Downscaling in the image build means mpv doesn't have to do it on every frame at runtime. Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
1 parent 47c7d8f commit 9a2fc7b

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

js/demo/scripts/build-image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515
image = (
1616
modal.Image.from_registry("ubuntu:24.04")
17-
.apt_install("bash", "curl", "git", "htop", "mpv", "ca-certificates")
17+
.apt_install("bash", "curl", "git", "htop", "mpv", "ffmpeg", "ca-certificates")
1818
.run_commands(
1919
f"curl -fsSL {BLIT_DEB_URL} -o /tmp/blit.deb && dpkg -i /tmp/blit.deb && rm /tmp/blit.deb",
2020
"curl -fsSL https://opencode.ai/install | bash && ln -sf /root/.opencode/bin/opencode /usr/local/bin/opencode",
2121
"opencode providers list > /dev/null 2>&1 || true",
22-
f"mkdir -p /home/blit && curl -sfL -o /home/blit/parrot.gif '{PARROT_GIF_URL}'",
22+
f"mkdir -p /home/blit && curl -sfL -o /tmp/parrot_1k.gif '{PARROT_GIF_URL}'"
23+
" && ffmpeg -i /tmp/parrot_1k.gif -vf scale=160:80 /home/blit/parrot.gif && rm /tmp/parrot_1k.gif",
2324
"git config --global user.email demo@example.com",
2425
"git config --global user.name Demo",
2526
'mkdir -p /home/blit/project && cd /home/blit/project && git init && echo "# Project" > README.md && git add -A && git commit -m init',

js/demo/src/demo.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const DEMO_APP_NAME = "blit-demo";
1515

1616
// Pre-built Modal image containing blit, opencode, htop, mpv, git, and the parrot gif.
1717
// Rebuild with: uv run python js/demo/scripts/build-image.py
18-
const DEMO_IMAGE_ID = "im-0EUz8WHdYnTs4dzW4zqgNQ";
18+
const DEMO_IMAGE_ID = "im-XwPRfyvhO63upEhdAVzDlS";
1919

2020
function isAllowedOrigin(origin: string): boolean {
2121
try {
@@ -172,10 +172,10 @@ export async function handleDemoRequest(
172172
const startupScript = [
173173
'blit share --passphrase "$BLIT_NONCE" &',
174174
"sleep 2",
175-
"blit start -t bash --cols 160 --rows 40 -- bash",
176-
"blit start -t opencode --cols 160 --rows 40 -- opencode /home/blit/project || true",
177-
"blit start -t htop --cols 160 --rows 40 -- htop",
178-
"blit start -t parrot --cols 160 --rows 40 -- mpv --vo=tct --no-osd-bar --osd-level=0 --no-terminal --loop=inf /home/blit/parrot.gif",
175+
"blit start -t bash --cols 200 --rows 50 -- bash",
176+
"blit start -t opencode --cols 200 --rows 50 -- opencode /home/blit/project || true",
177+
"blit start -t htop --cols 200 --rows 50 -- htop",
178+
"blit start -t parrot --cols 200 --rows 50 -- mpv --vo=tct --no-osd-bar --osd-level=0 --no-terminal --loop=inf /home/blit/parrot.gif",
179179
"wait",
180180
].join("\n");
181181

0 commit comments

Comments
 (0)