工具:Kākāpō Party——体验一场交互式像素风庆典:鸮鹦鹉(kākāpō,新西兰不会飞的鹦鹉)随着音乐跳跃起舞。点击、轻触或按空格键即可触发彩纸、气球、彩带和各种节日特效,鸟儿们在迪斯科球下跳着编排好的舞步,动作与欢快的节奏同步。
昨天,我在 WeAreDevelopers World Congress North America 上做了闭幕主题演讲。作为一个 STAR 时刻,我决定穿插一些关于 2026 年创纪录的鸮鹦鹉繁殖季的内容。
在最后一页幻灯片上,我想做点庆祝的东西。我听说 Claude Opus 5.5 很擅长制作像素风动画,于是从 Google 图片搜索里找了三张鸮鹦鹉的照片,连同下面这段提示词一起丢给了 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 完成了这件事(对话记录在此),并生成了这段视频,正是我最后一页幻灯片所需要的:
▶ https://static.simonwillison.net/static/2026/kakapo-party-small.mp4
下面是它用到的完整 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()
