跳到正文
原文
Simon Willison·· 2026-09-27AI 评分51

Simon Willison 用 Claude Opus 5.5 制作鸮鹦鹉像素派对并录成视频

Kākāpō Party

AI 导读

Simon Willison 用三张鸮鹦鹉照片和一段提示词,让 Claude Opus 5.5 在 HTML5 canvas 上生成至少 20 只像素风鸮鹦鹉跳跃并撒彩纸的互动派对页面。

正文 · AI 翻译

工具 Kākāpō Party — 体验一场互动像素艺术庆典,主角是 kākāpō(新西兰不会飞的鹦鹉)随音乐跳跃、跳舞。点击、轻触或按下 Space,即可触发彩纸爆发、气球、彩带和节日特效,鸟儿们在迪斯科球下随着欢快节奏同步编排的舞步狂欢。

昨天我为 WeAreDevelopers World Congress North America 做了闭幕主题演讲。作为 一个 STAR 时刻,我决定穿插提及我们在 2026 年迎来的破纪录 kākāpō 繁殖季。

在闭幕幻灯片上我想庆祝一番,而且我看到不少人在热议 Claude Opus 5.5 制作像素艺术动画有多出色。于是我从 Google 图片搜索中找了三张 Kakapo 照片,连同这个提示词一起丢给 Claude:

Here are some photos of kakapo parrots just to remind you what they look like

I need you to make an animation in animated pixel art on HTML 5 canvas of obviously pixel art kakapo jumping up and down having a party with confetti and suchlike - there should be at least 20 of them

这是 对话记录,而这是 生成的页面。相当棒!

我想把它嵌入 Keynote 演示文稿文件,于是下载了 HTML,并对本地的 Claude Code 会话说:

Make me a video of file:///Users/simon/Downloads/kakapo-party.html - you need to load it in a browser and click on it a few times to get the confetti effect, the video should be 15s long

don't start clicking until 3s in

make sure several clicks are spread around the clickable area

Claude Code 使用了 Playwright(对话记录在此)并生成了这段视频,正是我最后一张幻灯片所需要的:

这是它使用的完整 Playwright 脚本,短得令人愉悦:

# /// script
# dependencies = ["playwright"]
# ///
import time
from playwright.sync_api import sync_playwright
W, H = 1280, 720
# Canvas fills the viewport; spread clicks across corners, edges and centre
clicks = [
    (3.0, 640, 360),   # centre
    (4.2, 160, 120),   # top-left
    (5.4, 1120, 120),  # top-right
    (6.6, 180, 600),   # bottom-left
    (7.8, 1100, 600),  # bottom-right
    (9.0, 640, 100),   # top-centre
    (10.0, 380, 380),  # mid-left
    (11.0, 900, 380),  # mid-right
    (12.2, 640, 620),  # bottom-centre
    (13.2, 640, 300),  # finale centre
]
with sync_playwright() as p:
    b = p.chromium.launch()
    ctx = b.new_context(viewport={"width":W,"height":H}, record_video_dir="vids", record_video_size={"width":W,"height":H})
    page = ctx.new_page()
    t0 = time.time()
    page.goto("file:///Users/simon/Downloads/kakapo-party.html")
    for t,x,y in clicks:
        time.sleep(max(0, t-(time.time()-t0)))
        page.mouse.click(x,y)
    time.sleep(max(0, 16.0-(time.time()-t0)))
    ctx.close(); b.close()

来源:Simon Willison · simonwillison.net