An AI skill that turns books into animated, narrated, interactive web experiences
JavaScript ai-agentsai-educationanimationclaudeclaude-codeclaude-skillsedtecheducationinteractive-textbookscormtext-to-video
feat(site): Joke Collection episode 5, The Penguin and the Zoo
yzrbfc355c77f4f
diff --git a/site/index.html b/site/index.htmlindex 056f2e3..6432c22 100644--- a/site/index.html+++ b/site/index.html@@ -38,7 +38,7 @@<a class="book-hotspot red-book" data-book="little-red-riding-hood" href="little-red-riding-hood/" aria-label="Open Little Red Riding Hood, a paper-cutout stop-motion picture book and how it was made"><span class="book-caption"><strong>Little Red Riding Hood <span aria-hidden="true">↗</span></strong><small>Paper-cutout stop motion · how it was made</small></span></a>- <a class="book-hotspot joke-book" data-book="joke-collection" href="joke-collection/" aria-label="Open Joke Collection, short animated jokes, four episodes">+ <a class="book-hotspot joke-book" data-book="joke-collection" href="joke-collection/" aria-label="Open Joke Collection, short animated jokes, five episodes"><span class="book-caption"><strong>Joke Collection <span aria-hidden="true">↗</span></strong><small>4 episodes · how they were made</small></span></a></section>diff --git a/site/joke-collection/ch04/index.html b/site/joke-collection/ch04/index.htmlindex ddaf89f..0750b29 100644--- a/site/joke-collection/ch04/index.html+++ b/site/joke-collection/ch04/index.html@@ -23,7 +23,7 @@<script src="scene4.js"></script><script>'use strict';-const CHAPTER = { number: 4, title: 'The Dog Ate My Homework', minutes: 2, language: 'en' };+const CHAPTER = { number: 4, title: 'The Dog Ate My Homework', minutes: 2, language: 'en', next: '../ch05/' };try { if (localStorage.getItem('captions') === null) setCaptions(true); } catch {}/* ---------- beats: one per scene ---------- */diff --git a/site/joke-collection/ch05/audio/en/hush1.mp3 b/site/joke-collection/ch05/audio/en/hush1.mp3new file mode 100644index 0000000..c106beeBinary files /dev/null and b/site/joke-collection/ch05/audio/en/hush1.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/hush2.mp3 b/site/joke-collection/ch05/audio/en/hush2.mp3new file mode 100644index 0000000..c106beeBinary files /dev/null and b/site/joke-collection/ch05/audio/en/hush2.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/hush3.mp3 b/site/joke-collection/ch05/audio/en/hush3.mp3new file mode 100644index 0000000..1b443e5Binary files /dev/null and b/site/joke-collection/ch05/audio/en/hush3.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/hush4.mp3 b/site/joke-collection/ch05/audio/en/hush4.mp3new file mode 100644index 0000000..e86f799Binary files /dev/null and b/site/joke-collection/ch05/audio/en/hush4.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/mouths.js b/site/joke-collection/ch05/audio/en/mouths.jsnew file mode 100644index 0000000..9d5530a--- /dev/null+++ b/site/joke-collection/ch05/audio/en/mouths.js@@ -0,0 +1 @@+window.MOUTHS = {"s01":[[0.222,"E"],[0.339,"B"],[0.456,"C"],[0.574,"B"],[0.658,"F"],[0.743,"B"],[0.828,"C"],[0.912,"A"],[1.022,"E"],[1.132,"B"],[1.242,"C"],[1.352,"B"],[1.462,"X"],[1.615,"D"],[1.667,"A"],[1.798,"D"],[1.928,"B"],[2.058,"A"],[2.136,"F"],[2.214,"B"],[2.292,"D"],[2.357,"G"],[2.488,"C"],[2.618,"B"],[2.748,"D"],[2.794,"B"],[2.839,"B"],[2.885,"C"],[2.93,"B"],[3.011,"D"],[3.091,"B"],[3.171,"A"],[3.252,"F"],[3.332,"B"],[3.412,"D"],[3.477,"B"],[3.542,"B"],[3.625,"C"],[3.707,"B"],[3.79,"E"],[3.9,"G"],[4.011,"G"],[4.072,"E"],[4.133,"B"],[4.193,"B"],[4.331,"E"],[4.468,"A"],[4.606,"C"],[4.743,"X"]],"s02":[[0.222,"B"],[0.287,"E"],[0.352,"A"],[0.417,"C"],[0.482,"A"],[0.548,"E"],[0.613,"B"],[0.678,"C"],[0.743,"C"],[0.818,"H"],[0.893,"B"],[0.968,"C"],[1.042,"B"],[1.116,"D"],[1.19,"B"],[1.264,"B"],[1.321,"E"],[1.379,"B"],[1.437,"C"],[1.494,"B"],[1.552,"C"],[1.61,"B"],[1.667,"B"],[1.719,"C"],[1.772,"G"],[1.955,"C"],[2.138,"B"],[2.322,"X"]],"s03":[[0.22,"E"],[0.495,"B"],[0.77,"X"],[1.395,"B"],[1.532,"C"],[1.67,"H"],[1.808,"E"],[1.945,"X"]],"s04":[[0.22,"F"],[0.403,"C"],[0.587,"H"],[0.77,"X"],[0.895,"B"],[0.948,"E"],[1.001,"A"],[1.054,"C"],[1.108,"D"],[1.245,"H"],[1.383,"E"],[1.52,"B"],[1.745,"B"],[1.928,"C"],[2.112,"B"],[2.295,"X"]],"s05":[[0.223,"C"],[0.333,"B"],[0.443,"F"],[0.553,"B"],[0.663,"C"],[0.808,"A"],[0.955,"C"],[1.101,"B"],[1.284,"C"],[1.467,"B"],[1.651,"X"],[2.394,"C"],[2.48,"B"],[2.567,"B"],[2.629,"D"],[2.691,"B"],[2.753,"D"],[2.833,"A"],[2.924,"C"],[3.016,"B"],[3.108,"F"],[3.199,"C"],[3.291,"B"],[3.383,"X"]],"s06":[[0.22,"B"],[0.308,"C"],[0.395,"B"],[0.482,"A"],[0.541,"C"],[0.599,"B"],[0.657,"G"],[0.722,"E"],[0.787,"H"],[0.851,"F"],[0.916,"C"],[0.98,"B"],[1.045,"A"],[1.114,"C"],[1.182,"D"],[1.314,"H"],[1.445,"A"],[1.555,"E"],[1.665,"B"],[1.775,"C"],[1.885,"B"],[1.995,"X"],[2.857,"C"],[3.033,"B"],[3.108,"C"],[3.182,"B"],[3.258,"B"],[3.32,"C"],[3.383,"H"],[3.45,"C"],[3.517,"B"],[3.585,"C"],[3.653,"B"],[3.72,"A"],[3.995,"C"],[4.27,"X"]],"s07":[[0.223,"C"],[0.296,"F"],[0.369,"B"],[0.426,"F"],[0.482,"H"],[0.539,"B"],[0.596,"B"],[0.655,"D"],[0.715,"B"],[0.775,"C"],[0.835,"B"],[0.888,"C"],[0.941,"A"],[0.994,"B"],[1.054,"E"],[1.114,"B"],[1.181,"C"],[1.247,"B"],[1.522,"F"],[1.797,"X"]],"s08":[[0.22,"B"],[0.287,"F"],[0.353,"B"],[0.42,"C"],[0.603,"B"],[0.787,"C"],[0.97,"X"]],"s09":[[0.222,"D"],[0.326,"B"],[0.43,"E"],[0.574,"G"],[0.717,"B"],[0.802,"C"],[0.886,"F"],[1.069,"C"],[1.253,"B"],[1.436,"X"]],"s10":[[0.222,"B"],[0.294,"C"],[0.365,"B"],[0.469,"C"],[0.574,"B"],[0.678,"A"],[0.788,"E"],[0.898,"B"],[1.008,"C"],[1.118,"B"],[1.342,"B"],[1.4,"C"],[1.459,"A"],[1.52,"E"],[1.581,"H"],[1.642,"C"],[1.704,"B"],[1.765,"C"],[1.826,"A"],[1.887,"D"],[1.948,"B"],[2.032,"F"],[2.088,"D"],[2.145,"B"],[2.201,"A"],[2.318,"D"],[2.436,"B"],[2.553,"E"],[2.618,"B"],[2.683,"B"],[2.731,"C"],[2.779,"B"],[2.826,"B"],[2.936,"E"],[3.046,"B"],[3.156,"C"],[3.266,"B"],[3.376,"X"]],"s11":[[0.223,"E"],[0.498,"C"],[0.773,"X"],[1.503,"C"],[1.649,"B"],[1.729,"F"],[1.809,"B"],[1.889,"C"],[1.982,"B"],[2.055,"E"],[2.128,"H"],[2.201,"B"],[2.274,"C"],[2.321,"F"],[2.367,"B"],[2.421,"E"],[2.474,"B"],[2.537,"D"],[2.6,"B"],[2.663,"C"],[2.726,"B"],[2.802,"D"],[2.877,"B"],[2.952,"A"],[3.026,"C"],[3.099,"B"],[3.172,"F"],[3.245,"C"],[3.318,"B"],[3.391,"B"],[3.444,"E"],[3.498,"B"],[3.571,"C"],[3.644,"B"],[3.919,"F"],[4.194,"X"]],"s12":[[0.22,"C"],[0.395,"B"],[0.578,"C"],[0.762,"B"],[0.945,"X"],[1.707,"B"],[1.808,"C"],[1.908,"B"],[1.966,"D"],[2.024,"B"],[2.082,"D"],[2.158,"B"],[2.278,"C"],[2.399,"B"],[2.52,"B"],[2.658,"C"],[2.795,"A"],[2.932,"C"],[3.07,"X"]],"s13":[[0.22,"B"],[0.314,"E"],[0.407,"B"],[0.501,"C"],[0.595,"F"],[0.636,"C"],[0.676,"B"],[0.717,"C"],[0.757,"B"],[0.823,"E"],[0.889,"C"],[0.954,"B"],[1.02,"B"],[1.07,"E"],[1.12,"B"],[1.176,"C"],[1.233,"A"],[1.416,"C"],[1.599,"B"],[1.783,"X"]],"s14":[[0.22,"C"],[0.314,"F"],[0.407,"B"],[0.457,"F"],[0.507,"H"],[0.558,"B"],[0.607,"B"],[0.661,"D"],[0.714,"B"],[0.767,"C"],[0.82,"B"],[0.87,"C"],[0.92,"A"],[0.97,"B"],[1.014,"E"],[1.058,"B"],[1.114,"C"],[1.17,"B"],[1.445,"F"],[1.72,"X"],[2.445,"B"],[2.541,"C"],[2.637,"H"],[2.732,"H"],[2.795,"E"],[2.857,"G"],[2.92,"C"],[2.982,"C"],[3.257,"B"],[3.532,"X"]]};diff --git a/site/joke-collection/ch05/audio/en/s01.mp3 b/site/joke-collection/ch05/audio/en/s01.mp3new file mode 100644index 0000000..9a61e1cBinary files /dev/null and b/site/joke-collection/ch05/audio/en/s01.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s02.mp3 b/site/joke-collection/ch05/audio/en/s02.mp3new file mode 100644index 0000000..6a387e8Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s02.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s03.mp3 b/site/joke-collection/ch05/audio/en/s03.mp3new file mode 100644index 0000000..e9714b1Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s03.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s04.mp3 b/site/joke-collection/ch05/audio/en/s04.mp3new file mode 100644index 0000000..9fd07c6Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s04.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s05.mp3 b/site/joke-collection/ch05/audio/en/s05.mp3new file mode 100644index 0000000..46d10a3Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s05.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s06.mp3 b/site/joke-collection/ch05/audio/en/s06.mp3new file mode 100644index 0000000..5a1bf89Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s06.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s07.mp3 b/site/joke-collection/ch05/audio/en/s07.mp3new file mode 100644index 0000000..22b4db8Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s07.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s08.mp3 b/site/joke-collection/ch05/audio/en/s08.mp3new file mode 100644index 0000000..265d4e9Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s08.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s09.mp3 b/site/joke-collection/ch05/audio/en/s09.mp3new file mode 100644index 0000000..884ff0dBinary files /dev/null and b/site/joke-collection/ch05/audio/en/s09.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s10.mp3 b/site/joke-collection/ch05/audio/en/s10.mp3new file mode 100644index 0000000..0218d83Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s10.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s11.mp3 b/site/joke-collection/ch05/audio/en/s11.mp3new file mode 100644index 0000000..ad60a2dBinary files /dev/null and b/site/joke-collection/ch05/audio/en/s11.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s12.mp3 b/site/joke-collection/ch05/audio/en/s12.mp3new file mode 100644index 0000000..e15830fBinary files /dev/null and b/site/joke-collection/ch05/audio/en/s12.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s13.mp3 b/site/joke-collection/ch05/audio/en/s13.mp3new file mode 100644index 0000000..524c902Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s13.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/s14.mp3 b/site/joke-collection/ch05/audio/en/s14.mp3new file mode 100644index 0000000..d2ffe19Binary files /dev/null and b/site/joke-collection/ch05/audio/en/s14.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/scene1.mp3 b/site/joke-collection/ch05/audio/en/scene1.mp3new file mode 100644index 0000000..bf55de5Binary files /dev/null and b/site/joke-collection/ch05/audio/en/scene1.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/scene2.mp3 b/site/joke-collection/ch05/audio/en/scene2.mp3new file mode 100644index 0000000..f22967bBinary files /dev/null and b/site/joke-collection/ch05/audio/en/scene2.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/scene3.mp3 b/site/joke-collection/ch05/audio/en/scene3.mp3new file mode 100644index 0000000..bb6eaebBinary files /dev/null and b/site/joke-collection/ch05/audio/en/scene3.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/scene4.mp3 b/site/joke-collection/ch05/audio/en/scene4.mp3new file mode 100644index 0000000..6cbbf2bBinary files /dev/null and b/site/joke-collection/ch05/audio/en/scene4.mp3 differdiff --git a/site/joke-collection/ch05/audio/en/shots.js b/site/joke-collection/ch05/audio/en/shots.jsnew file mode 100644index 0000000..9823800--- /dev/null+++ b/site/joke-collection/ch05/audio/en/shots.js@@ -0,0 +1,14 @@+TIMINGS.scene1 = {"dur": 30.444, "marks": {}, "cues": [[0.222, "One sunny morning, a man bought a fish at the harbour and set off for home.", 4.765], [5.948, "Somebody else had noticed the fish.", 8.221], [19.392, "Oh.", 19.924], [20.567, "Hello.", 21.275], [25.006, "Well...", 25.86], [25.681, "come along, then.", 27.012]], "parts": {"s01": 0, "s02": 5.726, "s03": 9.172, "s04": 22.186, "hush1": 27.944}};+TIMINGS.scene2 = {"dur": 28.482, "marks": {}, "cues": [[3.223, "Excuse me, sir.", 4.662], [5.394, "Is that a penguin?", 6.608], [7.794, "He's been following me all morning.", 9.734], [10.431, "I think he likes me.", 11.771], [14.675, "You should take him to the zoo.", 16.289], [19.894, "Good idea!", 20.835], [23.718, "And off they went.", 25.02]], "parts": {"s05": 0, "s06": 7.574, "s07": 12.652, "s08": 17.274, "s09": 21.896, "hush2": 25.982}};+TIMINGS.scene3 = {"dur": 33.64, "marks": {}, "cues": [[0.222, "The next morning, the policeman was back on his corner.", 3.482], [13.701, "Oi!", 14.265], [14.981, "I thought I told you to take that penguin to the zoo!", 17.748], [18.968, "I did!", 19.773], [21.455, "He had a great time.", 22.918], [27.586, "Today we're going to the beach.", 29.243]], "parts": {"s10": 0, "s11": 4.478, "s12": 18.748, "s13": 23.866, "hush3": 30.14}};+TIMINGS.scene4 = {"dur": 19.834, "marks": {}, "cues": [[10.22, "You should take him to the zoo!", 11.769], [12.445, "He'll love it!", 13.428]], "parts": {"s14": 0, "hush4": 14.334}};+MOUTHS.s03 = [[0.049, "X"], [10.22, "E"], [10.495, "B"], [10.77, "X"], [11.395, "B"], [11.532, "C"], [11.67, "H"], [11.808, "E"], [11.945, "X"]];+MOUTHS.s04 = [[0.049, "X"], [2.82, "F"], [3.003, "C"], [3.187, "H"], [3.37, "X"], [3.495, "B"], [3.548, "E"], [3.601, "A"], [3.654, "C"], [3.708, "D"], [3.845, "H"], [3.983, "E"], [4.12, "B"], [4.345, "B"], [4.528, "C"], [4.712, "B"], [4.895, "X"]];+MOUTHS.s05 = [[0.049, "X"], [3.223, "C"], [3.333, "B"], [3.443, "F"], [3.553, "B"], [3.663, "C"], [3.808, "A"], [3.955, "C"], [4.101, "B"], [4.284, "C"], [4.467, "B"], [4.651, "X"], [5.394, "C"], [5.48, "B"], [5.567, "B"], [5.629, "D"], [5.691, "B"], [5.753, "D"], [5.833, "A"], [5.924, "C"], [6.016, "B"], [6.108, "F"], [6.199, "C"], [6.291, "B"], [6.383, "X"]];+MOUTHS.s07 = [[0.049, "X"], [2.023, "C"], [2.096, "F"], [2.169, "B"], [2.226, "F"], [2.282, "H"], [2.339, "B"], [2.396, "B"], [2.455, "D"], [2.515, "B"], [2.575, "C"], [2.635, "B"], [2.688, "C"], [2.741, "A"], [2.794, "B"], [2.854, "E"], [2.914, "B"], [2.981, "C"], [3.047, "B"], [3.322, "F"], [3.597, "X"]];+MOUTHS.s08 = [[0.049, "X"], [2.62, "B"], [2.687, "F"], [2.753, "B"], [2.82, "C"], [3.003, "B"], [3.187, "C"], [3.37, "X"]];+MOUTHS.s09 = [[0.049, "X"], [1.822, "D"], [1.926, "B"], [2.03, "E"], [2.174, "G"], [2.317, "B"], [2.402, "C"], [2.486, "F"], [2.669, "C"], [2.853, "B"], [3.036, "X"]];+MOUTHS.s11 = [[0.049, "X"], [9.223, "E"], [9.498, "C"], [9.773, "X"], [10.503, "C"], [10.649, "B"], [10.729, "F"], [10.809, "B"], [10.889, "C"], [10.982, "B"], [11.055, "E"], [11.128, "H"], [11.201, "B"], [11.274, "C"], [11.321, "F"], [11.367, "B"], [11.421, "E"], [11.474, "B"], [11.537, "D"], [11.6, "B"], [11.663, "C"], [11.726, "B"], [11.802, "D"], [11.877, "B"], [11.952, "A"], [12.026, "C"], [12.099, "B"], [12.172, "F"], [12.245, "C"], [12.318, "B"], [12.391, "B"], [12.444, "E"], [12.498, "B"], [12.571, "C"], [12.644, "B"], [12.919, "F"], [13.194, "X"]];+MOUTHS.s12 = [[0.22, "C"], [0.395, "B"], [0.578, "C"], [0.762, "B"], [0.945, "X"], [1.399, "X"], [2.707, "B"], [2.808, "C"], [2.908, "B"], [2.966, "D"], [3.024, "B"], [3.082, "D"], [3.158, "B"], [3.278, "C"], [3.399, "B"], [3.52, "B"], [3.658, "C"], [3.795, "A"], [3.932, "C"], [4.07, "X"]];+MOUTHS.s13 = [[0.049, "X"], [3.72, "B"], [3.814, "E"], [3.907, "B"], [4.001, "C"], [4.095, "F"], [4.136, "C"], [4.176, "B"], [4.217, "C"], [4.257, "B"], [4.323, "E"], [4.389, "C"], [4.454, "B"], [4.52, "B"], [4.57, "E"], [4.62, "B"], [4.676, "C"], [4.733, "A"], [4.916, "C"], [5.099, "B"], [5.283, "X"]];+MOUTHS.s14 = [[0.049, "X"], [10.22, "C"], [10.314, "F"], [10.407, "B"], [10.457, "F"], [10.507, "H"], [10.558, "B"], [10.607, "B"], [10.661, "D"], [10.714, "B"], [10.767, "C"], [10.82, "B"], [10.87, "C"], [10.92, "A"], [10.97, "B"], [11.014, "E"], [11.058, "B"], [11.114, "C"], [11.17, "B"], [11.445, "F"], [11.72, "X"], [12.445, "B"], [12.541, "C"], [12.637, "H"], [12.732, "H"], [12.795, "E"], [12.857, "G"], [12.92, "C"], [12.982, "C"], [13.257, "B"], [13.532, "X"]];diff --git a/site/joke-collection/ch05/audio/en/timings.js b/site/joke-collection/ch05/audio/en/timings.jsnew file mode 100644index 0000000..34a44d6--- /dev/null+++ b/site/joke-collection/ch05/audio/en/timings.js@@ -0,0 +1,190 @@+window.TIMINGS = {+ "s01": {+ "dur": 5.376,+ "marks": {},+ "cues": [+ [+ 0.102,+ "One sunny morning, a man bought a fish at the harbour and set off for home."+ ]+ ]+ },+ "s02": {+ "dur": 3.096,+ "marks": {},+ "cues": [+ [+ 0.102,+ "Somebody else had noticed the fish."+ ]+ ]+ },+ "s03": {+ "dur": 2.664,+ "marks": {},+ "cues": [+ [+ 0.1,+ "Oh."+ ],+ [+ 1.275,+ "Hello."+ ]+ ]+ },+ "s04": {+ "dur": 2.808,+ "marks": {},+ "cues": [+ [+ 0.1,+ "Well..."+ ],+ [+ 0.775,+ "come along, then."+ ]+ ]+ },+ "s05": {+ "dur": 4.224,+ "marks": {},+ "cues": [+ [+ 0.103,+ "Excuse me, sir."+ ],+ [+ 2.274,+ "Is that a penguin?"+ ]+ ]+ },+ "s06": {+ "dur": 4.728,+ "marks": {},+ "cues": [+ [+ 0.1,+ "He's been following me all morning."+ ],+ [+ 2.737,+ "I think he likes me."+ ]+ ]+ },+ "s07": {+ "dur": 2.472,+ "marks": {},+ "cues": [+ [+ 0.103,+ "You should take him to the zoo."+ ]+ ]+ },+ "s08": {+ "dur": 1.872,+ "marks": {},+ "cues": [+ [+ 0.1,+ "Good idea!"+ ]+ ]+ },+ "s09": {+ "dur": 2.136,+ "marks": {},+ "cues": [+ [+ 0.102,+ "And off they went."+ ]+ ]+ },+ "s10": {+ "dur": 4.128,+ "marks": {},+ "cues": [+ [+ 0.102,+ "The next morning, the policeman was back on his corner."+ ]+ ]+ },+ "s11": {+ "dur": 4.92,+ "marks": {},+ "cues": [+ [+ 0.103,+ "Oi!"+ ],+ [+ 1.383,+ "I thought I told you to take that penguin to the zoo!"+ ]+ ]+ },+ "s12": {+ "dur": 3.768,+ "marks": {},+ "cues": [+ [+ 0.1,+ "I did!"+ ],+ [+ 1.587,+ "He had a great time."+ ]+ ]+ },+ "s13": {+ "dur": 2.424,+ "marks": {},+ "cues": [+ [+ 0.1,+ "Today we're going to the beach."+ ]+ ]+ },+ "s14": {+ "dur": 3.984,+ "marks": {},+ "cues": [+ [+ 0.1,+ "You should take him to the zoo!"+ ],+ [+ 2.325,+ "He'll love it!"+ ]+ ]+ },+ "hush1": {+ "dur": 2.5,+ "marks": {},+ "cues": []+ },+ "hush2": {+ "dur": 2.5,+ "marks": {},+ "cues": []+ },+ "hush3": {+ "dur": 3.5,+ "marks": {},+ "cues": []+ },+ "hush4": {+ "dur": 5.5,+ "marks": {},+ "cues": []+ }+};diff --git a/site/joke-collection/ch05/audio/sfx/chomp.mp3 b/site/joke-collection/ch05/audio/sfx/chomp.mp3new file mode 100644index 0000000..0f35c2eBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/chomp.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/crickets.mp3 b/site/joke-collection/ch05/audio/sfx/crickets.mp3new file mode 100644index 0000000..bcf7ebbBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/crickets.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/gull1.mp3 b/site/joke-collection/ch05/audio/sfx/gull1.mp3new file mode 100644index 0000000..29ef952Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/gull1.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/gulls.mp3 b/site/joke-collection/ch05/audio/sfx/gulls.mp3new file mode 100644index 0000000..70b723aBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/gulls.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/honk.mp3 b/site/joke-collection/ch05/audio/sfx/honk.mp3new file mode 100644index 0000000..11c07cdBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/honk.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/patter.mp3 b/site/joke-collection/ch05/audio/sfx/patter.mp3new file mode 100644index 0000000..0fd8c7fBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/patter.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/patter1.mp3 b/site/joke-collection/ch05/audio/sfx/patter1.mp3new file mode 100644index 0000000..36c68ccBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/patter1.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/step1.mp3 b/site/joke-collection/ch05/audio/sfx/step1.mp3new file mode 100644index 0000000..45737c4Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/step1.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/sting.mp3 b/site/joke-collection/ch05/audio/sfx/sting.mp3new file mode 100644index 0000000..af1219cBinary files /dev/null and b/site/joke-collection/ch05/audio/sfx/sting.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/tick.mp3 b/site/joke-collection/ch05/audio/sfx/tick.mp3new file mode 100644index 0000000..473ca36Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/tick.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/waves-bed3.mp3 b/site/joke-collection/ch05/audio/sfx/waves-bed3.mp3new file mode 100644index 0000000..6f50182Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/waves-bed3.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/waves.mp3 b/site/joke-collection/ch05/audio/sfx/waves.mp3new file mode 100644index 0000000..159e992Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/waves.mp3 differdiff --git a/site/joke-collection/ch05/audio/sfx/whoosh.mp3 b/site/joke-collection/ch05/audio/sfx/whoosh.mp3new file mode 100644index 0000000..feb4d22Binary files /dev/null and b/site/joke-collection/ch05/audio/sfx/whoosh.mp3 differdiff --git a/site/joke-collection/ch05/index.html b/site/joke-collection/ch05/index.htmlnew file mode 100644index 0000000..71a8dc4--- /dev/null+++ b/site/joke-collection/ch05/index.html@@ -0,0 +1,75 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>The Penguin and the Zoo</title>+<link rel="stylesheet" href="../lib/engine.css">+<link rel="expect" href="#bar" blocking="render">+</head>+<body>+<script src="../lib/engine.js"></script>+<script src="../img/sets/sets.js"></script>+<script src="../img/puppets/baked.js" onerror="0"></script>+<script src="../lib/paper.js"></script>+<script>window.SP_SHUT = .9; // a shut eye keeps its lid line (as episode 3): a full lid left two blank skin ovals</script>+<script src="../lib/cast.js"></script>+<script src="audio/en/timings.js"></script>+<script src="audio/en/mouths.js"></script>+<script src="audio/en/shots.js"></script>+<script src="../lib/shared.js"></script>+<script src="seaside.js"></script>+<script src="scene1.js"></script>+<script src="scene2.js"></script>+<script src="scene3.js"></script>+<script src="scene4.js"></script>+<script>+'use strict';+const CHAPTER = { number: 5, title: 'The Penguin and the Zoo', minutes: 2, language: 'en' };+try { if (localStorage.getItem('captions') === null) setCaptions(true); } catch {}++/* ---------- beats: one per scene ---------- */+const BEATS = [+ ['scene1', 'The follower', (m, D) => scene1(panel(0), D), { lead: false, pre: PRE1 }],+ ['scene2', 'Good idea!', (m, D) => scene2(panel(0), D), { lead: false, pre: PRE2 }],+ ['scene3', 'The next day', (m, D) => scene3(panel(0), D), { lead: false, pre: PRE3 }],+ ['scene4', 'At the beach', (m, D) => scene4(panel(0), D), { lead: false, pre: PRE4 }],+].map(([id, title, run, extra]) => ({ id, title, run, ...extra }));++/* ---------- background music ----------+ The Three Little Pigs' score (Lyria), reused from episode 2's folder: one track per listed scene, its position the+ time since the track's first scene began, so pausing and seeking keep it in step; 0.8 s crossfades; lower under+ speech. The home theme carries the walk through town (scenes 1–2; scene 2 may fade it for its tail with S2_HUSH);+ scene 3 (the punchline) has no music; the march comes in for the beach and stops before the policeman's last stare+ (scene 4 sets S4_STOP). */+const BGM = [['m1-home', ['scene1', 'scene2'], .3], ['m3-chimney', ['scene4'], .3]]+ .map(([n, beats, gain]) => ({ n, beats, gain, a: Object.assign(new Audio(`../ch02/audio/bgm/${n}.mp3`), { preload: 'auto', loop: true, volume: 0 }), v: 0 }));+window.MUSIC_OFF = { scene2: t => t > (window.S2_HUSH ?? 1e9), scene4: t => t > (window.S4_STOP ?? 1e9) };+const beatLen = id => { const b = BEATS.find(x => x.id === id); return (b.pre || 0) + TIMINGS[id].dur + .6; };+let lastTick = performance.now(), duck = .3;+function bgmTick(now) {+ const dt = Math.min(.1, (now - lastTick) / 1000); lastTick = now;+ const id = BEATS[P.i]?.id, on = P.started && P.playing && !P.waiting && !P.done;+ // the music ducks well under the voices for the whole of a scene that has them (its silent opening and tail too, so+ // it does not swell between lines), easing over about half a second+ duck += Math.max(-dt, Math.min(dt, (P.audio ? .3 : .7) - duck));+ const vol = +(document.getElementById('volume')?.value ?? 1) * duck;+ for (const m of BGM) {+ const k = m.beats.indexOf(id), current = on && k >= 0 && !(window.MUSIC_OFF?.[id]?.(P.t));+ m.v = Math.max(0, Math.min(1, m.v + (current ? 1 : -1) * dt / .8));+ m.a.volume = m.v * m.gain * vol;+ if (current) {+ const want = (m.beats.slice(0, k).reduce((s, b) => s + beatLen(b), 0) + P.t) % (m.a.duration || 1e9);+ if (Math.abs(m.a.currentTime - want) > .5) m.a.currentTime = want;+ if (m.a.paused) m.a.play().catch(() => {});+ } else if (m.v === 0 && !m.a.paused) m.a.pause();+ }+ if (!on && !P.done) for (const m of BGM) m.a.pause();+ requestAnimationFrame(bgmTick);+}+requestAnimationFrame(bgmTick);+paperWarm(g => { manPuppet(g, { holds: { fish: fishSVG, bucket: bucketSVG, photo: photoSVG } }); copPuppet(g, { holds: { chips: chipsSVG, chip: chipSVG } }); penguinPuppet(g); prop(g, posterSVG); });+boot();+</script>+</body>+</html>diff --git a/site/joke-collection/ch05/scene1.js b/site/joke-collection/ch05/scene1.jsnew file mode 100644index 0000000..db0902b--- /dev/null+++ b/site/joke-collection/ch05/scene1.js@@ -0,0 +1,124 @@+/* scene1.js — The follower (round 2). Harbour: a man buys a fish and strolls home; a penguin hides behind the left end of+ the fish crates and follows the parcel, ~240 px behind, stopping a half step after every stop of his. Inserts: the+ crates (the head pops up behind the parcel), its face, the fish. Run-gag: he stops, it stops (three times).+ "Oh. Hello." / "Well… come along, then." The man never sees the fish is the reason. Ends on the empty harbour wide.+ Times are beat-clock seconds (PRE1 + audio time). See books/penguin/REWORK.md, scene 1. */+'use strict';+const PRE1 = 1.5;++// shot times+const S1 = { crates: 6.1, face: 8.3, wide2: 9.3, two: 11.0, manS: 11.8, pengCU: 12.6, manS2: 13.4, wideR: 14.0, freeze: 15.8, manS3: 17.0,+ twoShot: 19.0, honkCU: 22.8, fish: 23.9, manS4: 25.0, wide3: 27.3 };++// piecewise-linear path through [time, x] points (constant before the first and after the last)+function s1path(q, pts) {+ if (q <= pts[0][0]) return pts[0][1];+ for (let i = 1; i < pts.length; i++) if (q < pts[i][0]) { const [t0, a] = pts[i - 1], [t1, b] = pts[i]; return a + (b - a) * (q - t0) / (t1 - t0); }+ return pts[pts.length - 1][1];+}+// the man: strolls from the stall at ~110 px/s, stops at 11.4 (x 1150) and 15.6 (x 1262), then hurries out at 170 px/s on "come along"+const S1_MAN = [[3.0, 230], [11.4, 1150], [14.4, 1150], [14.7, 1160], [15.6, 1262], [27.3, 1262], [27.6, 1274], [33, 2192]];+const manX = q => s1path(q, S1_MAN);+// the penguin: behind the crates' left end until 9.3, round it, a hurry to 250 px behind him, a half step late at 11.7 and+// again at 15.8, two steps up to his leg after "Hello." (22.0–22.6), a lean toward the parcel (+15), then after him+const S1_PENG = [[9.3, 620], [9.9, 520], [11.4, 855], [11.7, 901], [14.7, 901], [15.0, 908], [15.8, 1062], [22.0, 1062], [22.6, 1100], [27.9, 1115], [28.2, 1127], [33, 1990]];+const lean = q => 15 * span(q, 24.0, 24.9);+const pengX = q => s1path(q, S1_PENG) + (q < 27.9 ? lean(q) : 0);+// the man's walk with the stride matched to his speed: a foot change every 1/6 s moves him v/6 px, so the legs swing only+// as far as that (a foot lands under him, no skating); his arm swings with them+function s1walk(q, v) {+ const k = spWalk(q).k, A = Math.asin(Math.min(1, v / 6 / 218)) * 180 / Math.PI, u = A / 16;+ return { legL: A * k, legR: -A * k, bob: k > 0 ? -6 * u : 0, armR: -8 * k * u };+}+const moving = (fn, q) => Math.abs(fn(q + .05) - fn(q - .05)) > .4;++sfx('scene1', .05, 'waves', .3);+sfx('scene1', .5, 'gulls', .4);+sfx('scene1', 12.6, 'gull1', .4);+for (let t = 56 / 6; t < 11.7; t += 1 / 6) sfx('scene1', +t.toFixed(3), 'patter1', .8); // out round the crates and after him; the last step (11.667) is the late half step+for (let t = 88 / 6; t < 15.7; t += 1 / 6) sfx('scene1', +t.toFixed(3), 'patter1', .8); // the follow (nothing under the freeze)+sfx('scene1', 15.6, 'whoosh'); // the sound peaks ~0.22 s in: on the whip-round at 15.8+for (let t = 22; t < 22.6; t += 1 / 6) sfx('scene1', +t.toFixed(3), 'patter1', .8); // two waddle steps up to his leg+for (const [a, b] of [[3.0, 11.4], [14.7, 15.6], [27.4, 30.2]]) // the man's own steps, on his foot changes+ for (let t = Math.ceil(a * 6) / 6; t < b; t += 1 / 6) sfx('scene1', +t.toFixed(3), 'step1', .35);+sfx('scene1', 23.0, 'honk');+sfx('scene1', 27.833, 'patter', .8); sfx('scene1', 29.833, 'patter', .6); // after him, out of the frame++function scene1(p, D) {+ const h = harbourSet(p), cam = h.cam;+ // views that depend on where they stand+ const TWO = (m, g) => ({ x: Math.min((m + g) / 2, 1660 - 800 / 1.9), y: 610, z: 1.9 });+ const FISH = { x: 1150, y: 670, z: 4.4 }, WIDE_R = { x: 1030, y: 520, z: 1.35 }, CRATES = { x: 640, y: 660, z: 2.6 };+ const FACE = { x: 660, y: 600, z: 4.4 };++ cam.cut(HARB_WIDE, 0).cut(CRATES, S1.crates).cut(FACE, S1.face).cut(HARB_WIDE, S1.wide2) // 1 wide, 2 crates, 3 face, 4 wide+ .cut(TWO(1112, 830), S1.two).to(TWO(1150, 901), S1.two, .7) // 5 follow shot: he stops, it stops half a step later+ .cut(MAN_SOLO(1150), S1.manS).cut({ x: 871, y: 690, z: 3.4 }, S1.pengCU).cut(MAN_SOLO(1150), S1.manS2) // 6 he glances back, 7 who, me?, 8 shrug+ .cut(WIDE_R, S1.wideR).cut({ x: 1010, y: 690, z: 3.4 }, S1.freeze).cut(MAN_SOLO(1262), S1.manS3) // 9 on, 10 frozen mid-step, 11 stare+ .cut(TWO(1262, 1062), S1.twoShot).cut({ x: 1110, y: 690, z: 3 }, S1.honkCU).cut(FISH, S1.fish) // 12 "Oh. Hello.", 13 honk, 14 the fish+ .cut(MAN_SOLO(1262), S1.manS4).cut(HARB_WIDE, S1.wide3); // 15 "Well… come along", 16 wide, out+ cam.soft(S1.fish, 'all').soft(S1.manS4, false);++ stopClock(D, (q, f) => {+ cam.apply(q, f);+ const mx = manX(q), px = pengX(q), mw = moving(manX, q), pw = moving(pengX, q), w = pengWaddle(q), vm = Math.abs(manX(q + .05) - manX(q - .05)) / .1, wk = s1walk(q, vm);+ const sp = lips(q, 'scene1', PRE1, 's03', 's04'), rn = (a, b) => q >= a && q < b;+ const sm = sp === 'X' ? 'smile' : sp; // the man's mouth moves only on his lines++ /* ---- the man ---- */+ const man = { x: mx, y: 800, s: .9, holdL: 'fish', armL: 10, look: 0, eyeX: 0, eyeY: 0, lids: .15, mouth: 'smile', headR: 0, brow: 0,+ shut: blinking(q, [1.9, 5.2, 9.0, 13.1, 21.4, 25.3]) };+ if (q < 3.0) { const u = Math.sin(Math.PI * span(q, .5, 2.0)); // looks at his parcel, then turns for home+ Object.assign(man, { armL: 10 + 34 * u, look: -.4 + .9 * span(q, 2.2, 3.0), eyeX: -.6 + 1.4 * span(q, 2.2, 3.0), eyeY: .4 * (1 - span(q, 2.2, 3.0)), headR: -3 * u, bob: -.8 * Math.sin(q * 2.2) }); }+ else if (mw) Object.assign(man, { legL: wk.legL, legR: wk.legR, bob: wk.bob, armR: wk.armR, look: .5, eyeX: .8 });+ else Object.assign(man, { bob: -.8 * Math.sin(q * 2.2) });+ if (rn(11.5, 13.4)) Object.assign(man, { look: -1, eyeX: -1, lids: .35, brow: -.15, mouth: 'flat', headR: -4 }); // head right round, eyes narrowed+ if (rn(13.4, 14.4)) Object.assign(man, { look: .4, eyeX: .5, headR: 4 * Math.sin(Math.PI * span(q, 13.4, 14.1)), brow: .3, armR: 22 * Math.sin(Math.PI * span(q, 13.5, 14.1)) }); // shrugs it off+ if (q >= 15.6 && q < 15.7) Object.assign(man, { look: .5, eyeX: .8 });+ if (q >= 15.7 && q < 17.0) Object.assign(man, { look: -.9, eyeX: -1, lids: 0, brow: .3, mouth: 'O' }); // stops dead, whips round+ if (rn(17.0, 19.0)) Object.assign(man, { look: -.4, eyeX: -.4, eyeY: .8, lids: .3 + .5 * Math.sin(Math.PI * span(q, 17.6, 18.5)), shut: Math.sin(Math.PI * span(q, 17.6, 18.5)) > .7, mouth: q > 18.3 ? 'smile' : 'flat', headR: -2 }); // looks down at it, a slow blink, a hint of a smile+ if (rn(19.0, 25.0)) Object.assign(man, { look: -.5, eyeX: -.5, eyeY: .8, lids: .1, mouth: sm, headR: -4 * span(q, 19.0, 19.4), brow: .2 }); // "Oh. Hello." eyes on the penguin all through+ if (rn(25.0, 27.3)) Object.assign(man, { look: -.3, eyeX: -.3, eyeY: .7, lids: .1, brow: .35, headR: -3 - 3 * Math.sin(Math.PI * span(q, 25.0, 26.3)), mouth: sm }); // won over (a slow nod): "Well…"+ if (q >= 27.3) Object.assign(man, { look: .3, eyeX: .5, mouth: sm }); // "…come along, then."+ if (q >= 27.3 && mw) Object.assign(man, { legL: wk.legL, legR: wk.legR, bob: wk.bob, armR: wk.armR, look: .5, eyeX: .8 });+ h.man.pose(man, f);++ /* ---- the penguin ---- */+ const [hx] = handAt(h.man, { x: mx, y: 800, s: .9, armL: 10 }, 'L');+ const trackFish = Math.max(-1, Math.min(1, (hx - px) / 90));+ const pg = { x: HARB.crates, y: HARB.hideY, s: HARB.hideS, bob: 0, eyeX: 1, look: .3, lids: .1, shut: blinking(q, [3.4, 9.5, 12.9, 16.9, 20.2, 25.7, 28.3]) };+ if (q < 9.3) { // behind the crates' left end+ if (q < 4.4) pg.bob = .8 * Math.sin(q * 2.6); // opening: a bit of head top, breathing+ else if (q < 7.5) { pg.bob = 7 * span(q, 4.4, 4.9) * (1 - span(q, 7.0, 7.5)); pg.eyeX = .6 * trackFish; } // ducks while he passes+ else { pg.bob = -42 * span(q, 7.5, 7.8) + .8 * Math.sin(q * 2.6); pg.eyeX = 1; pg.eyeY = .3; pg.lids = 0; pg.look = .5 * Math.max(0, trackFish); } // the head pops up behind the parcel+ if (q >= 8.3) { pg.look = .5 * trackFish; pg.eyeX = trackFish; pg.eyeY = .3; pg.beak = rn(8.6, 8.76) || rn(8.9, 9.06) ? .3 : 0; } // follows the fish; the beak works twice+ } else if (q < 11.7) { // round the left end, then a hurry after him+ const u = span(q, 9.3, 9.7), hur = span(q, 9.9, 10.3);+ Object.assign(pg, { x: px, y: HARB.hideY + (800 - HARB.hideY) * u, s: HARB.hideS + (.9 - HARB.hideS) * u, bob: w.bob,+ rock: w.rock * (1 + .3 * hur), footL: w.footL, footR: w.footR, look: .6, eyeX: 1, eyeY: .2, lids: 0 });+ } else if (q < 14.7) {+ Object.assign(pg, { x: px, y: 800, s: .9, look: .2, bob: -.8 * Math.sin(q * 2.4) });+ if (q < 12.9) Object.assign(pg, { footR: 22, rock: 4, look: .5, eyeX: 1, lids: 0 }); // a half step late, one foot still up+ else Object.assign(pg, { footR: 22 * (1 - span(q, 12.9, 13.2)) });+ if (q >= 11.75) Object.assign(pg, { eyeY: -1, eyeX: 0, look: -.1, flipL: -25, flipR: -25, headR: -3, lids: .25 }); // who, me? (the sky; flippers behind its back)+ } else if (q < S1.freeze) {+ Object.assign(pg, { x: px, y: 800, s: .9, look: .6, eyeX: 1, ...(pw ? { rock: w.rock, footL: w.footL, footR: w.footR, bob: w.bob } : {}) });+ } else if (q < 27.9) {+ Object.assign(pg, { x: px, y: 800, s: .9, look: .3, bob: -1 * Math.sin(q * 2.4) });+ if (q < 17.0) { const u = span(q, 16.2, 16.9); // frozen on one leg, flippers out, then the foot goes down slowly and it looks away+ Object.assign(pg, { footR: 24 * (1 - u), rock: -8 * (1 - u), flipL: 60 * (1 - u), flipR: 60 * (1 - u), eyeX: -1 * span(q, 16.5, 16.9), eyeY: -.6 * span(q, 16.5, 16.9), look: .6 - 1.0 * span(q, 16.5, 16.9), lids: .1 + .2 * u }); }+ else if (q < 19.0) Object.assign(pg, { eyeY: -1, eyeX: -.3, look: -.2, lids: .3 }); // gazes at the sky+ else if (q < 22.8) { // looks up at him; at 22.0–22.6 two steps up to his leg+ Object.assign(pg, { eyeX: .7, eyeY: -.8, look: .6, headR: 5, lids: 0 });+ if (pw) Object.assign(pg, { rock: w.rock, footL: w.footL, footR: w.footR, bob: w.bob }); }+ else if (q < S1.fish) { const t = q - 23.0, wide = (t >= 0 && t < .16) || (t >= .2 && t < .62); // honk: a short pulse, a long one, flippers flap, a stretch+ const u = Math.sin(Math.PI * span(q, 23.0, 23.62));+ Object.assign(pg, { eyeX: .7, eyeY: -.8, look: .6, beak: wide ? .85 : 0, flipL: 45 * u, flipR: 45 * u, bob: -4 * u, headR: 5 - 4 * u, lids: 0 }); }+ else { const u = span(q, 24.0, 24.9); // the eyes slide to the parcel, the head leans, the beak works at it+ Object.assign(pg, { eyeX: .5 + .5 * u, eyeY: -.7 + .9 * u, look: .6 + .2 * u, headR: 5 + 9 * u, beak: Math.sin(q * 11) > 0 ? .5 * u : .1 * u, lids: 0, bob: -2 * u }); }+ } else Object.assign(pg, { x: px, y: 800, s: .9, look: .6, eyeX: 1, eyeY: 0, lids: .1, shut: false, headR: 0, // trots after him at his pace+ ...(pw ? { rock: w.rock * 1.3, footL: w.footL, footR: w.footR, bob: w.bob } : { bob: 0 }) });+ h.front(h.peng, q >= 9.75);+ h.peng.pose(pg, f);+ });+}diff --git a/site/joke-collection/ch05/scene2.js b/site/joke-collection/ch05/scene2.jsnew file mode 100644index 0000000..7cd6be5--- /dev/null+++ b/site/joke-collection/ch05/scene2.js@@ -0,0 +1,142 @@+/* scene2.js — Good idea! The policeman rocks on his corner; the man comes in with the fish, the penguin behind him. The+ policeman's double take, "Is that a penguin?", the man's "I think he likes me" (an insert on the fish the penguin is+ really after), the sigh, "take him to the zoo" and the poster (insert), the man reads it and lights up: "Good idea!".+ He changes the fish to his other hand, the penguin takes his hand in its flipper, off they go past the satisfied+ policeman. Ends on the empty street, the policeman rocking alone. Times are the beat clock (storyboard, scene 2). */+'use strict';+const PRE2 = 2.0;+window.S2_HUSH = 28.0; // the music stops with the hush after "And off they went."++/* ---------- sounds ---------- */+// patter1 is one penguin step; the waddle changes foot every 1/6 s, so the steps follow the feet+for (let k = 3; k <= 27; k++) sfx('scene2', +(k / 6).toFixed(3), 'patter1', .5); // the penguin comes in, 0.5 … 4.5+sfx('scene2', 4.65, 'patter1', .6); // its late last step+sfx('scene2', 3.3, 'whoosh'); // the policeman's snap zoom (the sound peaks 0.22 s in: on 3.5)+for (let k = 0; k <= 25; k++) sfx('scene2', +(k / 6).toFixed(3), 'step1', .3); // the man's shoes, in+for (let k = 147; k <= 149; k++) sfx('scene2', +(k / 6).toFixed(3), 'patter1', .5); // the penguin's steps to his hand, 24.5 … 24.83+for (let k = 150; k <= 180; k++) sfx('scene2', +(k / 6).toFixed(3), 'step1', .3); // the man's shoes, out+for (let k = 150; k <= 180; k++) sfx('scene2', +(k / 6).toFixed(3), 'patter1', .5); // off they go, from 25.0 to 30.0++/* ---------- timeline (beat clock) ---------- */+const S2 = { glanceL: 2.7, back: 3.0, snap: 3.5, manStop: 4.3, pengStop: 4.65,+ lookDown: 7.2, sighIn: 15.1, sigh: 15.7, point: 17.35, pointEnd: 18.4,+ nodMan: 20.9, pass: 22.7, flip: 24.4, walk: 25.0, step: 25.4, salute: 25.6, copBack: 28.0 };+// the man strolls in at 150 px/s and stops at 860; after the hand-in-flipper he sets off (short start-up, then 195 px/s)+const s2manX = q => q < S2.walk ? 860 - 150 * Math.max(0, S2.manStop - q)+ : 860 + 195 * (q - S2.walk < .3 ? (q - S2.walk) ** 2 / .6 : q - S2.walk - .15);+const s2pengX = q => 620 - 150 * Math.max(0, S2.pengStop - q); // the penguin trails ~240-290 px behind and stops half a step late (the running gag)++function scene2(p, D) {+ const s = squareSet(p), cam = s.cam;+ // the fish insert: between the parcel (hanging from the man's left mitten) and the penguin's head, his face out of frame+ const fh = handAt(s.man, { x: SQ.man, y: 800, s: .9, armL: 10 }, 'L');+ const INS_FISH = { x: (fh[0] + SQ.peng) / 2 + 10, y: (fh[1] + 600) / 2 + 80, z: 3.6 }; // low enough that his face is out of frame+ const TWO = { x: 718, y: 580, z: 2.0 }; // the man and the penguin: his cap clear of the top edge, the policeman's edge nearly out++ /* ---------- shots ---------- */+ cam.cut(SQ_WIDE, 0) // the street: policeman on his corner, the two walk in+ .cut(COP_CU(SQ.cop), 2.6).to({ z: 2.8 }, S2.snap, .15) // him: glance, glance back, double take (snap zoom)+ .cut(SQ_THREE, 4.1) // the man stops, the penguin half a step later+ .cut(COP_SOLO(SQ.cop), 5.1) // "Excuse me, sir. Is that a penguin?"+ .cut(TWO, 8.3) // the man and the penguin: "he's been following me"+ .cut(MAN_SOLO(SQ.man), 12.0) // "I think he likes me."+ .cut(INS_FISH, 13.6) // insert: the penguin has eyes only for the parcel+ .cut(COP_SOLO(SQ.cop), 14.6) // his look, the sigh, "take him to the zoo"+ .cut(SQ_POSTER, 18.3).to({ ...POSTER_PENG, x: POSTER_PENG.x - 45 }, 18.4, 1.0) // insert: the poster, pushing in on the penguins in it+ .cut(MAN_SOLO(SQ.man), 19.5) // he looks, nods briskly: "Good idea!", then down at the penguin+ .cut(TWO, 22.6) // the fish changes hands, the flipper takes his hand+ .cut(SQ_WIDE, S2.walk) // off they go; he steps back and salutes them past+ .cut(COP_SOLO(SQ.cop), 28.3) // his satisfied nod (both have passed out of this frame)+ .cut(SQ_WIDE, 29.2); // the street: the policeman rocking again, they walk out+ cam.soft(13.6, 'all').soft(14.6, false);++ cam.stage.appendChild(s.cop.g); // drawn last: the pair walk behind him at the end+ stopClock(D, (q, f) => {+ cam.apply(q, f);+ const nearTo = (a, b) => q >= a && q < b;+ const hide = nearTo(18.3, 19.5); // the poster insert has no policeman in it+ const mx = s2manX(q);+ // the pair step back (y 775, s .86) and pass BEHIND the policeman, as in scene 3, then come forward again+ const dep = span(q, 25.4, 25.7) * (1 - span(q, 27.6, 28.2)), my = 800 - 25 * dep, ms = .9 - .04 * dep;++ /* ---- the policeman ---- */+ {+ const talk = lips(q, 'scene2', PRE2, 's07'), ask = lips(q, 'scene2', PRE2, 's05');+ const rock = -3 * (.5 - .5 * Math.cos(2 * Math.PI * q / 1.2)); // up on his toes and back, 1.2 s a rock+ const c = { x: SQ.cop, y: 800, s: .9, armL: -20, armR: -20, lids: .3, brow: 0, look: 0, eyeX: 0, eyeY: 0, mouth: 'flat', bob: rock, squash: 0, headR: 0,+ shut: blinking(q, [1.0, 6.6, 8.6, 12.9, 16.2, 20.8, 26.0, 27.9, 29.6]) };+ if (q < S2.glanceL) { /* eyes front, rocking */ }+ else if (q < S2.back) Object.assign(c, { look: -.35, eyeX: -1 }); // a glance down the road+ else if (q < S2.snap) Object.assign(c, { look: .1, eyeX: .2 }); // ...and back+ else if (q < 5.1) Object.assign(c, { look: -.8, eyeX: -1, lids: 0, brow: .5, mouth: 'O' }); // the double take: eyes wide+ else if (q < 8.3) { // "Excuse me, sir. Is that a penguin?"+ const down = nearTo(S2.lookDown, 8.3);+ Object.assign(c, { look: down ? -.7 : -.5, eyeX: -1, eyeY: down ? .55 : 0, lids: .2, brow: .35, headR: down ? -3 : 0, mouth: ask === 'X' ? 'flat' : ask, squash: down ? -.02 : 0 });+ } else if (q < 14.6) Object.assign(c, { look: -.6, eyeX: -1, eyeY: .3, lids: .3 }); // listening (cut by the frame edge: eyes and blinks stay alive)+ else if (q < S2.pointEnd) { // the look, the sigh, "take him to the zoo", the point+ const toMan = q > 15.4, pt = span(q, S2.point, S2.point + .3) * (1 - span(q, S2.pointEnd, S2.pointEnd + .5));+ Object.assign(c, { look: -.5 + 1.0 * span(q, S2.point, S2.point + .25), eyeX: -1 + 2 * span(q, S2.point, S2.point + .2), eyeY: toMan ? 0 : .6,+ lids: q < S2.point ? .55 : .3, brow: 0, // lids .3 while pointing: the eyes show turning to the poster+ squash: -.025 * span(q, S2.sighIn, S2.sighIn + .5) + .065 * span(q, S2.sigh, S2.sigh + .4) * (1 - span(q, S2.sigh + .5, S2.sigh + 1.0)),+ armR: -20 + 108 * pt, headR: 2 * pt, mouth: talk === 'X' ? (q > 15.6 && q < 16.5 ? 'frown' : 'flat') : talk });+ } else if (q < S2.walk) Object.assign(c, { armR: -20 + 108 * (1 - span(q, 18.4, 18.9)), look: .3 * span(q, 21, 22.5), eyeX: .5 }); // (arm down while the camera is elsewhere)+ else {+ // they come and go past him: he steps back half a step (y 775, s .87) and half-salutes (the mitten beside his head), eyes following+ const back = span(q, S2.step, S2.step + .4) * (1 - span(q, S2.copBack, S2.copBack + .5));+ const sal = span(q, S2.salute, S2.salute + .3) * (1 - span(q, 27.0, 27.4));+ const follow = Math.max(-1, Math.min(1, (mx - SQ.cop) / 160)), watch = 1 - span(q, 29.0, 29.4);+ const nodDip = nearTo(28.4, 28.8) ? .05 * Math.sin(Math.PI * (q - 28.4) / .4) : 0;+ Object.assign(c, { y: 800, s: .9, armR: -20 + 140 * sal, headR: 2 * sal,+ look: .5 * watch * (follow > 0 ? 1 : .4), eyeX: follow * watch, lids: .3, brow: 0, mouth: q > 26.8 && watch > .5 ? 'smile' : 'flat', squash: nodDip });+ }+ vis(s.cop.g, !hide);+ s.cop.pose(c, f);+ }++ /* ---- the man ---- */+ const walking = q < S2.manStop || q >= S2.walk;+ const w = spWalk(q);+ const speak = lips(q, 'scene2', PRE2, 's06', 's08');+ const pass = nearTo(S2.pass, S2.pass + .6) ? manPass((q - S2.pass) / .6, 'fish', { restL: 10, restR: 0 }) : null;+ const swapped = q >= S2.pass + .6;+ const man = { x: mx, y: my, s: ms, look: 0, eyeX: 0, eyeY: 0, lids: .2, brow: 0, headR: 0, mouth: 'smile', bob: 0, squash: 0,+ holdL: swapped ? null : 'fish', hold: swapped ? 'fish' : null, armL: swapped ? 10 - 6 * span(q, S2.pass + .6, S2.pass + 1.0) : 10, armR: 0,+ shut: blinking(q, [2.2, 6.4, 10.4, 12.9, 16.0, 20.0, 23.9, 28.0]) };+ if (pass) Object.assign(man, pass);+ if (walking) Object.assign(man, { legL: w.legL, legR: w.legR, bob: w.bob, armR: swapped ? 0 : w.armR, look: .35, eyeX: 1 });+ if (q >= S2.manStop && q < S2.walk) {+ const speaking = speak !== 'X';+ if (q < 8.0) Object.assign(man, { look: .5, eyeX: 1, brow: .25 }); // polite, to the policeman+ else if (q < 14.7) Object.assign(man, { look: -.45, eyeX: -1, eyeY: .55, headR: -3, brow: q > 12 ? .4 : .25 }); // fondly down at the penguin+ else if (q < 18.1) Object.assign(man, { look: .5, eyeX: 1, brow: .25 }); // listens to the policeman+ else if (q < 22.5) { // one look at the poster, a brisk nod, "Good idea!"+ const nod = nearTo(S2.nodMan, S2.nodMan + .35) ? Math.sin(Math.PI * (q - S2.nodMan) / .35) : 0;+ Object.assign(man, { look: .6, eyeX: 1, eyeY: -.3 + .5 * nod, headR: -2 * nod, squash: .035 * nod });+ } else Object.assign(man, { look: -.4, eyeX: -1, eyeY: .5, headR: -3, brow: .3 }); // down at the penguin: shall we?+ if (speaking) man.mouth = speak;+ }+ if (q >= S2.walk) Object.assign(man, { look: .5, eyeX: 1, brow: .2 });+ s.man.pose(man, f);++ /* ---- the penguin: whenever it stands by the man it looks up-right at the parcel ---- */+ const pw = pengWaddle(q);+ const pg = { x: s2pengX(q), y: my, s: ms, look: .4, eyeX: 1, eyeY: -.4, lids: 0, bob: -1.2 * Math.sin(q * 2.6),+ shut: blinking(q, [1.4, 5.7, 9.4, 14.8, 21.3, 26.2]) };+ if (q < S2.pengStop) Object.assign(pg, { look: .5, eyeX: 1, eyeY: -.2, rock: pw.rock, footL: pw.footL, footR: pw.footR, bob: pw.bob });+ else if (q >= 13.6 && q < 14.6) Object.assign(pg, { headR: 6, eyeY: -.5, beak: onTwos(q) > 0 ? .5 : 0 }); // smacking its beak at the parcel+ else if (q >= 23.6 && q < S2.walk) Object.assign(pg, { eyeY: .3, headR: 4 }); // sees the free hand+ if (q >= S2.flip && q < S2.walk) Object.assign(pg, { rock: pw.rock, footL: pw.footL, footR: pw.footR, bob: pw.bob }); // it waddles over to take it+ // a foot still up as it stops (half a step late)+ if (nearTo(S2.pengStop, S2.pengStop + .25)) Object.assign(pg, { footR: 22, rock: 6 });+ let pose = pg;+ if (q >= S2.flip) { // the flipper rises into the man's hand+ const u = span(q, S2.flip, S2.flip + .4), h = pengHand(s.man, man, { ...pg, flipR: 0 });+ pose = { ...pg, x: pg.x + (h.x - pg.x) * u, flipR: h.flipR * u };+ }+ if (q >= S2.walk) { // hand in flipper: follows the hand, waddling+ const h = pengHand(s.man, man, { ...pg, rock: pw.rock, footL: pw.footL, footR: pw.footR, bob: pw.bob, look: .5, eyeX: 1, eyeY: 0 });+ pose = { ...h, shut: pg.shut };+ }+ s.peng.pose(pose, f);+ });+}diff --git a/site/joke-collection/ch05/scene3.js b/site/joke-collection/ch05/scene3.jsnew file mode 100644index 0000000..3c8d543--- /dev/null+++ b/site/joke-collection/ch05/scene3.js@@ -0,0 +1,117 @@+/* scene3.js — the punchline (round 2). Next morning in the town street: the policeman alone, yawning; he hears+ footsteps, sees the man and the penguin wearing the souvenirs (balloon insert, sticker insert, his face working it+ out), marches over ("Oi!"), points at the poster (the slogan insert pays the clue off), the man's "I did!", the photo+ (out of the pocket, the insert, the silence with the photo held between them), "Today we're going to the beach."+ (the shades drop), they cross in front of the frozen policeman and go; he ends looking off right, not at us.+ Beat clock throughout (storyboard times, heard word times): the speech starts PRE3 s in. */+'use strict';+const PRE3 = 1.0;+const S3 = { yawn: 2.4, wide2: 6.2, cop2: 8.2, balloon: 9.2, cop3: 10.1, sticker: 10.7, cop4: 11.6, three: 12.3, march: 12.6, man1: 13.7, oi: 14.5,+ pengA: 17.1, point: 17.7, poster: 18.0, man2: 18.9, two1: 20.4, manCU: 21.4, photo: 22.2, still: 24.4, pengB: 25.4, twitch: 25.9, putaway: 26.7,+ two2: 27.6, pengC: 29.4, shades: 29.6, copO: 29.9, wide3: 30.4, end: 34.1 };+const W3 = 30.4; // the pair set off (the wide cuts in on the first step)+sfx('scene3', .05, 'waves-bed3', .3, 24.35); // a low bed that stops by 24.4: the stare is silent+sfx('scene3', .5, 'gulls', .5);+for (let t = 29 / 6; t < 8; t += 1 / 6) sfx('scene3', +t.toFixed(3), 'patter1', Math.min(.5, .25 + .08 * (t - 4.8))); // the arrival, one step per foot change+for (let t = 183 / 6; t < S3.end; t += 1 / 6) sfx('scene3', +t.toFixed(3), 'patter1', Math.max(.1, .5 - .1 * (t - 30.4))); // the exit, fading+sfx('scene3', 14.3, 'whoosh', .35);+sfx('scene3', 25.8, 'gull1', .4);+sfx('scene3', S3.shades, 'tick', 1.6);+sfx('scene3', 29.9, 'waves', .15, 32); // the sea comes back after the shades and carries into scene 4+// the man's and the policeman's footsteps (every other foot change), quieter than the penguin's patter+for (let t = 15 / 3; t < 8; t += 1 / 3) sfx('scene3', +t.toFixed(3), 'step1', Math.min(.3, .15 + .05 * (t - 5)));+for (let t = 38 / 3; t < 13.6; t += 1 / 3) sfx('scene3', +t.toFixed(3), 'step1', .35); // his march+for (let t = 92 / 3; t < 34.1; t += 1 / 3) sfx('scene3', +t.toFixed(3), 'step1', Math.max(.08, .25 - .05 * (t - 30.4))); // the exit++// the man leads: eager 205 px/s in from the left (unseen until 6.2), stops dead at x 860 at 8.0; at 30.4 he sets off right at 180 px/s, BEHIND the frozen policeman (y 775, s .86), so the policeman stays readable+const s3manX = q => q < 8 ? SQ.man - 205 * (8 - q) : q < W3 ? SQ.man : SQ.man + 180 * (q - W3);+const s3walking = q => q < 8 || q >= W3;+const s3clamp = (x, a, b) => Math.max(a, Math.min(b, x));++function scene3(p, D) {+ const s = squareSet(p), cam = s.cam, photo = photoInsert(p);+ cam.stage.appendChild(s.cop.g); // drawn last: the pair walk behind him at the end+ const PGB = { balloon: true, sticker: true, ring: true };+ const COPX = 1090;+ // the screen-left hand: down, into the pocket (-40), out with the photo (70), held up between them, back in the pocket, down again+ const handL = q => q < 20.4 ? [12, null] : q < 20.8 ? [12 - 52 * span(q, 20.4, 20.8), null] : q < 21.4 ? [-40 + 110 * span(q, 20.8, 21.4), 'photo']+ : q < 26.7 ? [70, 'photo'] : q < 27.1 ? [70 - 110 * span(q, 26.7, 27.1), q < 26.95 ? 'photo' : null] : [-40 + 52 * span(q, 27.1, 27.6), null];+ const manAt = q => {+ const w = s3walking(q) ? spWalk(q) : null, [armL, holdL] = handL(q), say = lips(q, 'scene3', PRE3, 's12', 's13');+ const toPeng = q >= S3.two2 && q < S3.shades, step = span(q, W3, W3 + .3);+ const nod = (q > 24.65 && q < 24.85) || (q > 25.05 && q < 25.25) || (q > 19.97 && q < 20.2) ? 5 : 0;+ return { x: s3manX(q), y: 800 - 25 * step, s: .9 - .04 * step, look: w ? .5 : toPeng ? -.3 : .6, eyeX: toPeng ? -.7 : 1, eyeY: toPeng ? .6 : 0,+ lids: q >= 18.9 ? 0 : .15, brow: q >= 19 ? .5 : 0, headR: toPeng ? 3 : 0, hold: 'bucket', holdL, armL,+ armR: (w ? w.armR : 0) + 60 * span(q, 29.4, 29.6) * (1 - span(q, 29.8, 30.2)), bob: (w ? w.bob : 0) + nod, legL: w ? w.legL : 0, legR: w ? w.legR : 0,+ mouth: say !== 'X' ? say : 'smile', shut: blinking(q, [3.3, 8.9, 13.2, 17.2, 21.9, 26.0, 30.6]) };+ };+ // the penguin: waddles beside him, stops with him; in his flipper except while he fetches and shows the photo+ const pengAt = q => {+ const w = s3walking(q) ? pengWaddle(q) : {}, m = manAt(q), r = span(q, 20.4, 20.8) * (1 - span(q, 27.2, 27.6));+ const breath = s3walking(q) ? 0 : -1.5 * Math.sin(q * 2 * Math.PI / 2.4 + 1); // it breathes while it stands+ // the balloon insert: up at the balloon, then to the policeman; the sticker insert: down at the sticker, then up again+ const ins = q >= S3.balloon && q < S3.cop3 ? [q < 9.6 ? -.9 : .1, q < 9.6 ? .6 : 1] : q >= S3.sticker && q < S3.cop4 ? [q < 11.1 ? .9 : -.5, q < 11.1 ? .3 : 1] : null;+ const up = q >= S3.pengB && q < S3.twitch || q >= S3.two2 && q < S3.shades;+ const base = { ...PGB, ...w, y: m.y, s: m.s, shades: q >= S3.shades ? 'on' : 'up', look: .5, eyeX: ins ? ins[1] : 1, eyeY: ins ? ins[0] : up ? -.8 : -.3, bob: (w.bob || 0) + breath, headR: q >= S3.pengB && q < S3.twitch ? 4 : 0,+ squash: .12 * span(q, 29.7, 29.8) * (1 - span(q, 29.85, 30)), shut: blinking(q, [3.9, 9.85, 11.3, 15.6, 22.3, 25.75, 31.2]) };+ const ref = pengHand(s.man, { ...m, armL: 12 }, base);+ return { ...base, x: ref.x, flipR: ref.flipR * (1 - r) + 3 * r };+ };+ const PX = pengAt(8).x; // where the penguin stands for the whole scene+ const copAt = q => {+ const walk = q >= S3.march && q < 13.6, w = walk ? spWalk(q) : {}, x = q < S3.march ? 1180 : COPX + 90 * (1 - span(q, S3.march, 13.6));+ const say = lips(q, 'scene3', PRE3, 's11'), mx = s3manX(q);+ const o = { x, y: 800, s: .9, armL: -20, armR: -20, lids: .3, mouth: 'flat', brow: 0, look: 0, eyeX: 0, eyeY: 0, headR: 0, ...w,+ bob: walk ? w.bob : -3 * Math.sin(q * 2 * Math.PI / 1.2), shut: blinking(q, [1.6, 4.4, 7.0, 12.8, 16.4, 19.6, 24.8, 25.25, 28.2, 31.5]) };+ const set = d => Object.assign(o, d);+ if (q < S3.yawn) set({});+ else if (q < 3.4) set({ mouth: 'D', lids: .85, eyeY: -.6, brow: .3, bob: 0 }); // the yawn+ else if (q < 5.6) set({ mouth: 'smile', lids: .35 }); // contented rocking+ else if (q < S3.cop2) set({ look: -.6, eyeX: -1, lids: .05, bob: 0 }); // footsteps: he looks left and freezes+ else if (q < S3.cop3) set({ look: -.6, eyeX: -1, lids: 0, brow: .6, mouth: 'O', bob: 0 }); // eyes wide, a small O+ else if (q < S3.cop4) set({ look: -.6, eyeX: -1, eyeY: .5, lids: 0, brow: .5, mouth: 'O', bob: 0 }); // down the string+ else if (q < S3.oi) set({ look: -.5, eyeX: -1, lids: .1, brow: -.6, mouth: q < 11.9 ? 'flat' : 'frown', bob: walk ? w.bob : -3 * Math.sin(q * 5.2) * .3 });+ else if (q < S3.point) set({ look: -.3, eyeX: -1, eyeY: .2, lids: .1, brow: -.5, headR: -4, mouth: say !== 'X' ? say : 'frown' });+ else if (q < S3.man2) { // the arm snaps to the poster on "zoo", down again by 18.9+ const a = -20 + 108 * span(q, 17.7, 17.9) * (1 - span(q, 18.3, 18.9));+ set({ look: .3, eyeX: 1, eyeY: -.1, lids: .1, brow: -.5, headR: -4 * (1 - span(q, 18.3, 18.9)), mouth: say !== 'X' ? say : 'frown', armR: a });+ } else if (q < S3.still) set({ look: -.3, eyeX: -1, lids: .3, brow: -.2, mouth: 'flat' });+ else if (q < S3.twitch) set({ look: -.5, eyeX: -1, eyeY: .2, lids: .45, brow: -.15, bob: 0 }); // the silence: he stares at the photo+ else if (q < S3.putaway) { // eyelid and moustache twitch+ const tw = (q >= 26.0 && q < 26.2) || (q >= 26.35 && q < 26.55);+ set({ look: -.5, eyeX: -1, eyeY: .3, lids: tw ? .2 : .4, brow: -.2, mouth: tw ? 'wobble' : 'flat', bob: 0 });+ } else if (q < S3.two2) set({ look: -.5, eyeX: -1, eyeY: .2 + .7 * span(q, 26.7, 27.3), lids: .4, brow: -.15, bob: 0 }); // his eyes follow the photo down+ else if (q < S3.copO) set({ look: -.4, eyeX: -1, lids: .4, brow: -.15, bob: 0 });+ else if (q < S3.wide3) set({ look: .3, eyeX: 1, eyeY: 0, lids: 0, brow: .4, bob: 0, armR: -20 + 150 * span(q, 29.9, 30.15),+ mouth: q < 30.05 || q >= 30.2 ? 'O' : 'flat' }); // a finger up beside his face; he starts to speak twice; nothing comes out+ else { // frozen, finger half up, his eyes follow them off right+ const e = s3clamp((mx - COPX) / 150, -1, 1), blink = span(q, 34.12, 34.3) * (1 - span(q, 34.3, 34.5));+ set({ look: .6 * e, eyeX: e, lids: .4 + .5 * blink, brow: .15, mouth: 'flat', bob: 0, armR: 130 });+ }+ return o;+ };++ // ---- the shots: [from, name, view, soft] ----+ const CSP = { x: COPX + 55, y: 430, z: 4 }; // policeman single clear of the man's cap at the left edge+ const SH = [[0, 'wide', SQ_WIDE], [S3.yawn, 'cop', COP_CU(1180)], [S3.wide2, 'wide', SQ_WIDE], [S3.cop2, 'cop', COP_SOLO(1180)],+ [S3.balloon, 'balloon', PENG_BALLOON(PX), 'all'], [S3.cop3, 'cop', COP_SOLO(1180)], [S3.sticker, 'sticker', PENG_STICKER(PX), 'all'], [S3.cop4, 'cop', COP_SOLO(1180)],+ [S3.three, 'three', { x: 960, y: 560, z: 1.45 }], [S3.man1, 'man', MAN_SOLO(SQ.man)], [S3.oi, 'cop', CSP], [S3.pengA, 'peng', PENG_CU(PX)],+ [S3.point, 'cop', CSP], [S3.poster, 'poster', SQ_POSTER, 'all'], [S3.man2, 'man', MAN_SOLO(SQ.man)], [S3.two1, 'two', { ...TWO_MP(SQ.man, PX), y: 575 }],+ [S3.manCU, 'man', { x: 745, y: 450, z: 3 }], [S3.photo, 'photo'], [S3.still, 'both', MAN_COP(SQ.man, COPX)], [S3.pengB, 'peng', PENG_CU(PX)],+ [S3.twitch, 'cop', { ...CSP, z: 4.4 }], [S3.putaway, 'both', MAN_COP(SQ.man, COPX)], [S3.two2, 'two', { ...TWO_MP(SQ.man, PX), y: 575 }],+ [S3.pengC, 'peng', PENG_CU(PX)], [S3.copO, 'cop', { x: COPX + 70, y: 420, z: 3.6 }], [S3.wide3, 'wide', SQ_WIDE], [S3.end, 'cop', { x: COPX - 50, y: 440, z: 3.8 }]];+ for (const [t, , v, soft] of SH) if (v) cam.cut(v, t).soft(t, soft || false);+ cam.to(POSTER_SLOGAN, S3.poster, .6); // the poster insert pushes in on "A great day out!"+ cam.shake(S3.oi + .15, .35, 5);++ stopClock(D, (q, f) => {+ let shot = 'wide'; for (const sh of SH) if (q >= sh[0]) shot = sh[1];+ vis(photo, shot === 'photo'); vis(cam.root, shot !== 'photo');+ photoZoom(photo, 1 + .25 * span(q, S3.photo, 24.2)); // a slow push on the penguin's ice-cream smile+ cam.apply(q, f);+ vis(s.cop.g, shot !== 'poster');+ s.cop.pose(copAt(q), f);+ s.man.pose(manAt(q), f);+ s.peng.pose(pengAt(q), f);+ });+}diff --git a/site/joke-collection/ch05/scene4.js b/site/joke-collection/ch05/scene4.jsnew file mode 100644index 0000000..2e85ff2--- /dev/null+++ b/site/joke-collection/ch05/scene4.js@@ -0,0 +1,99 @@+/* scene4.js — the tag, at the beach (PRE4 2.0; round 2). Cut in on the floating penguin, the wide (the policeman is on+ this beach too), he eats a chip, the second penguin comes along the shore from the right to his chips, he finds it+ looking up, steps away, it follows a beat late, then looks innocent; the man calls from the sea; the policeman's+ stare at us (the film's only look at the camera); title card. */+'use strict';+const PRE4 = 2.0;+window.S4_STOP = 14.8; // the music's fade ends under "He'll love it!", before the stare++/* ---------- timeline (beat clock) ---------- */+const S4 = { wide: 1.8, cop1: 4.2, two: 5.2, chips: 7.6, cop2: 8.4, two2: 9.4, swim: 11.9, snap: 12.05, two3: 13.3, man2: 14.2, stare: 15.4, card: 18.3,+ chomp: 4.55, sigh: 5.4, reach: 7.6, step: [9.6, 10.0], follow: [10.0, 10.5], steps: [9.667, 9.833, 10.0], honk: 16.6 };+const S4_FLOAT = { x: 1420, y: 585, z: 4.6 }; // BEACH_FLOAT nudged right so the man's sleeve is out of frame+const S4_LOOK = { x: 470, y: 570, z: 2.6 }; // tight two-shot of the look: his face and its face+const S4_SEA = { x: 1200, y: 450, z: 3 }; // the man in the sea, framed so the cap is not cut+const S4_CHIPS = { x: 570, y: 690, z: 3.8 }; // insert: the chips and the second penguin's head+sfx('scene4', .05, 'waves', .35);+sfx('scene4', .05, 'gulls', .3);+for (let t = 32 / 6; t < 7.4; t += 1 / 6) sfx('scene4', +t.toFixed(3), 'patter1', .5); // its walk in from the right, the last step at the stop+S4.steps.forEach(t => sfx('scene4', t, 'step1', .35)); // his big step to the left+for (let t = 10.0; t < 10.5; t += 1 / 6) sfx('scene4', +t.toFixed(3), 'patter1', .4); // its three small steps after him, on the waddle's foot changes+sfx('scene4', 10.833, 'patter1', .4); // its foot comes down+sfx('scene4', S4.chomp, 'chomp');+sfx('scene4', 11.85, 'whoosh', .4); // its peak lands on the snap, before "You"+sfx('scene4', S4.honk, 'honk');+sfx('scene4', S4.card, 'sting');++function scene4(p, D) {+ const b = beachSet(p), cam = b.cam, card = titleCard(p);+ vis(card.children[1], false); // the kit's few-pixel peek: replaced by our own, behind the strip+ const tc = mk('g', { 'clip-path': 'url(#s4Peek)' }, card), tp = penguinPuppet(tc);+ mk('rect', { x: 0, y: 0, width: 1600, height: 440 }, mk('clipPath', { id: 's4Peek' }, card));+ card.insertBefore(tc, card.lastChild);+ const COP2 = COP_CU(380);+ cam.cut(S4_FLOAT, 0).cut(BEACH_WIDE, S4.wide).cut(COP_CU(BEACH.cop), S4.cop1).cut(BEACH_TWO, S4.two).cut(S4_CHIPS, S4.chips).cut(COP_CU(BEACH.cop), S4.cop2)+ .cut(BEACH_TWO, S4.two2).cut(S4_LOOK, 10.5).cut(BEACH_TWO, 11.2).cut(BEACH_SWIM, S4.swim).to(S4_SEA, S4.snap, .15).cut(BEACH_TWO, S4.two3).cut(S4_SEA, S4.man2).cut(COP2, S4.stare);++ stopClock(D, (q, f) => {+ const onCard = q >= S4.card;+ vis(cam.root, !onCard); card.at(q, S4.card);+ cam.apply(q, f); b.roll(q);+ const blink = (...t) => blinking(q, t);++ /* the man in the sea: treads water, looks to the shore; he raises his hand at 11.9, then waves with the whole arm while he calls */+ const speak = q >= 12.05 && q < 15.2, wave = ease((q - 11.9) / .2);+ b.man.pose({ x: BEACH.man, y: BEACH.sea + b.bob(q), s: BEACH.ss, look: -.5, eyeX: -1, eyeY: .1, lids: speak ? 0 : .1, brow: speak ? .4 : 0,+ mouth: speak ? lips(q, 'scene4', PRE4, 's14') : 'smile', shut: blink(1.6, 5.9, 9.4, 13.8),+ armR: 10 * (1 - wave) + wave * (135 + 18 * Math.sin((q - 11.9) * 9)), armL: 15 + 8 * Math.sin(q * 3), headR: speak ? 3 * Math.sin(q * 3) : 0 }, f);+ /* the penguin floats in its ring, shades on, flippers paddling; on "He'll love it!" it waves a flipper */+ const hi = span(q, 14.3, 14.5) * (1 - span(q, 15.2, 15.4));+ b.peng.pose({ x: BEACH.peng, y: BEACH.float + b.bob(q + .7), s: BEACH.ss, ring: true, shades: 'on', sticker: true, look: -.2,+ flipL: 50 + 9 * Math.sin(q * 3.1), flipR: 50 + 9 * Math.sin(q * 2.7 + 1) + hi * (40 + 25 * Math.sin((q - 14.3) * 11)), headR: 4 * Math.sin(q * 1.2) }, f);++ /* the policeman: chips in his screen-left hand; one chip to the mouth (eat 1 = in the mouth, .5 = halfway) */+ const e = (q < S4.cop1 ? 0 : q < S4.chomp ? ease((q - S4.cop1) / .35) : q < S4.chomp + .1 ? 1 : q < 4.85 ? 1 - ease((q - S4.chomp - .1) / .2) : q < S4.reach ? 0 :+ q < S4.cop2 ? .3 * ease((q - S4.reach) / .8) : .3 + .3 * ease((q - S4.cop2) / .4));+ const copX = BEACH.cop - 90 * span(q, ...S4.step), stepping = q >= S4.step[0] && q < S4.step[1] + .1, w = stepping ? spWalk(q) : {};+ const chewing = q >= 4.7 && q < 5.35;+ const sighA = Math.sin(Math.PI * span(q, S4.sigh, S4.sigh + .8)) + Math.sin(Math.PI * span(q, 2.2, 2.9)); // two sighs: in the wide, after the bite+ const down = span(q, 8.6, 9.1) * (1 - span(q, 12.2, 12.6)), sea = span(q, 12.2, 12.6) * (1 - span(q, 13.3, 13.5)) + span(q, 13.5, 13.7) * (1 - span(q, S4.stare, S4.stare + .7)) ;+ const toCam = span(q, S4.stare, S4.stare + .7);+ // 9.4-11.9: he looks down at the penguin, 13.3-14.2 both turn to the sea+ const seaLook = (q >= 13.3 && q < 14.4) ? 1 : 0, sd = down * (1 - seaLook), glum = 1 - sd - toCam - seaLook;+ const co = { ...w, x: copX, y: 800 + 2 * Math.sin(q * 5.2) + (stepping ? 0 : 0), s: .9, holdL: 'chips', armL: -40, eat: e, hold: (q >= S4.cop1 && q < S4.chomp + .1) || q >= S4.reach ? 'chip' : null, armR: -50,+ look: .25 * glum + .1 * sd + .35 * seaLook, eyeX: .8 * glum + .5 * sd + seaLook, eyeY: -.1 * glum + .7 * sd - .1 * seaLook,+ lids: q >= S4.stare ? .25 - .07 * toCam : .45 * glum + .2 * sd + .35 * seaLook, brow: .4 * sd + (q >= S4.cop2 && q < 9.4 ? .4 : 0), headR: 3 * sd, squash: .04 * sighA + .012 * Math.sin(q * 2.4),+ mouth: chewing && Math.floor(q * 6) % 2 ? 'flat' : chewing ? 'chew' : sighA > .1 ? 'frown' : 'flat',+ shut: blink(1.0, 3.3, 6.5, 8.0, 10.2, 12.9, 16.2, 17.6), bob: stepping ? w.bob || 0 : 0 };+ // the look: he looks down at it, eyes on it (10.5-10.95); when it looks away his eyes narrow (brow cross) on the penguin+ if (q >= 10.5 && q < 10.95) Object.assign(co, { eyeX: .9, eyeY: .8, headR: 4, lids: .3, brow: .4 });+ else if (q >= 10.95 && q < 12.2) Object.assign(co, { eyeX: .8, eyeY: .7, headR: 3, lids: .22, brow: -.3 });+ b.cop.pose(co, f);++ /* the second penguin: along the shore from the right (it is in the cut's frame only as it walks in), stops at 640 at+ 7.4; in the chips insert it looks at the chips, then at him; when he steps left it follows three small steps+ (to 560, ~180 px off) and stops with a foot up (10.5-10.8), they look at each other (10.5-10.9), then it snaps its+ gaze to the sky with its flippers behind its back (from 10.9); at the stare it pulls up into his frame and honks */+ const F = S4.follow, walking1 = q >= S4.two && q < 7.4, walking2 = q >= F[0] && q < F[1];+ const px = q < 7.4 ? Math.max(640, 1070 - 195 * (q - S4.two)) : 640 - 80 * span(q, ...F);+ const wd = walking1 || walking2 ? pengWaddle(q) : { rock: 0, footL: 0, footR: 0, bob: 0 };+ const late = q >= F[1] && q < 10.833, mutual = q >= 10.5 && q < 10.95, sky = q >= 10.95 && q < 13.3, seaB = q >= 13.3 && q < 14.4;+ const chipLook = q >= 7.6 && q < 8.1, nod = Math.sin(Math.PI * span(q, 8.1, 8.4));+ const camT = span(q, 15.6, 16.0), pull = span(q, 15.8, 16.3);+ vis(b.peng2.g, q >= S4.two);+ const hon = (q >= S4.honk && q < S4.honk + .16) || (q >= S4.honk + .2 && q < S4.honk + .62);+ const gaze = walking1 ? [.6, -.3, .6] : // [eyeX, eyeY, look]+ q >= 15.6 ? [0, 0, 0] : seaB ? [1, -.1, .3] : sky ? [.5, -1, .4] : mutual || (q >= F[1] && q < 10.5) ? [-.6, -.9, -.45] :+ walking2 ? [-.4, -.3, -.5] : chipLook ? [-.5, -.9, -.45] : q >= 8.4 && q < 10.0 ? [-.5, -.7, -.45] : [0, -.2, 0];+ b.peng2.pose({ ...wd, footR: late ? 22 : wd.footR, rock: late ? 6 : wd.rock, x: px, y: 800 - 38 * pull, s: .9,+ look: gaze[2], eyeX: gaze[0], eyeY: gaze[1], lids: sky ? .1 : 0,+ headR: -3 * (chipLook ? 1 : 0) + 4 * nod + (sky ? 5 : 0) - (hon ? 6 : 0), beak: hon ? .8 : q >= 7.6 && q < 8.4 ? .3 + .25 * Math.sin(q * 16) : 0,+ bob: wd.bob + (walking1 || walking2 ? 0 : .8 * Math.sin(q * 2.4)) + (hon ? -4 : 0), shut: blink(8.9, 11.6, 13.0, 15.8),+ flipL: sky ? -28 : 6, flipR: sky ? -28 : 6 }, f);++ /* the title card's penguin: the card's own peek is a few pixels, so a bigger one rises behind the strip at 18.9 and blinks */+ const up = span(q, 18.9, 19.3);+ vis(tp.g, onCard);+ tp.pose({ x: 1452, y: 640 - 175 * up, s: .85, look: -.6, eyeX: -1, eyeY: .3, shut: blink(19.9, 21.0) }, f);+ });+}diff --git a/site/joke-collection/ch05/seaside.js b/site/joke-collection/ch05/seaside.jsnew file mode 100644index 0000000..c337174--- /dev/null+++ b/site/joke-collection/ch05/seaside.js@@ -0,0 +1,321 @@+/* seaside.js — episode 5's cast, props and places: the man (flat cap, V-neck jumper and tie), the policeman (an+ English bobby: tall helmet, moustache), the penguin (front-facing, waddles; balloon, zoo sticker, rubber ring and+ sunglasses for day two), the fish parcel, bucket, chips, the zoo poster and the zoo photo; the harbour, the town+ street and the beach, each built by one function so every shot of a place stages it identically. The series+ helpers are in ../lib/shared.js, the puppets' base in ../lib/cast.js. */+'use strict';++/* ---------- the two grown-ups (pose keys as in cast.js; built like the aunt: ~446 px tall at s 1, used at s .9) ----------+ Hands behind the back: armL = armR = -20. Pointing to the screen-right: armR 80…95. Waving: armR 120…150 swinging.+ brow < 0 is cross, > 0 worried/raised (cast.js). */+// The man: a brown tweed flat cap over ginger hair, a green V-neck jumper over a white shirt and a red tie, brown trousers.+SHAPES.pman = { ...SHAPES.aunt, sx: 64,+ body: 'M-50,-284 C-74,-270 -82,-150 -78,-100 Q-38,-88 0,-88 Q38,-88 78,-100 C82,-150 74,-270 50,-284 Z',+ extra: '<path d="M-20,-283 L0,-256 L20,-283 Z" fill="#f6f3ea"/><path d="M-5,-262 L5,-262 L8,-232 L0,-224 L-8,-232 Z" fill="#b23a2e"/>' ++ '<rect x="-78" y="-112" width="156" height="18" fill="#3f6a3c"/>' + [-60, -40, -20, 0, 20, 40, 60].map(x => `<path d="M${x},-112 v18" stroke="#2f5230" stroke-width="3"/>`).join(''),+ hair: ['#b8642e', 'M-88,-372 C-92,-410 -60,-430 0,-430 C60,-430 92,-410 88,-372 L84,-330 Q78,-344 72,-346 L70,-390 Q0,-404 -70,-390 L-72,-346 Q-78,-344 -84,-330 Z'],+ hat: '<path d="M-94,-410 C-100,-464 -52,-480 0,-480 C52,-480 100,-464 94,-410 Q0,-426 -94,-410 Z" fill="#8a7458"/>' ++ [[-50, -458], [-10, -466], [30, -456], [-30, -440], [10, -444], [52, -440]].map(([x, y]) => `<path d="M${x},${y} l10,3" stroke="#6a5840" stroke-width="3"/>`).join('') ++ '<path d="M-100,-412 Q0,-432 100,-412 L96,-400 Q0,-418 -96,-400 Z" fill="#5f4e3a"/>' };+// A blink shows a closed lid: the lid covers the eye and a curved lash line sits where it was (a lid that stops short+// left blank skin ovals). Wraps pose: `shut` becomes lids 1 plus the lash line.+function closedEyes(pup) {+ const [ex, ey, erx, ery] = pup.S.eyes, feat = pup.g.querySelector('[data-p="feat"]');+ const line = mk('g', {}, feat); line.innerHTML = [-1, 1].map(s => `<path d="M${s * ex - erx},${ey - ery * .1} Q${s * ex},${ey + ery * .75} ${s * ex + erx},${ey - ery * .1}" fill="none" stroke="${SP_INK}" stroke-width="4" stroke-linecap="round"/>`).join('');+ const base = pup.pose;+ pup.pose = (o, f) => { base(o.shut ? { ...o, shut: false, lids: 1 } : o, f); vis(line, !!o.shut); };+ return pup;+}+const manPuppet = (p, o) => closedEyes(spKid(p, 'pman', { skin: '#f4d2b4', coat: '#4f7d4a', stripe: '#3f6a3c', pants: '#7a5a3c', ...o }));+// The policeman: a tall dark-blue custodian helmet with a silver star, a high-collared tunic with silver buttons and a+// whistle chain, a belt, a big brown moustache.+SHAPES.cop = { ...SHAPES.aunt, sx: 64,+ body: 'M-52,-284 C-72,-270 -76,-130 -72,-80 Q-36,-70 0,-70 Q36,-70 72,-80 C76,-130 72,-270 52,-284 Z',+ extra: '<rect x="-34" y="-292" width="68" height="18" rx="5" fill="#1a2440"/>' + [-250, -215, -180, -110].map(y => `<circle cx="0" cy="${y}" r="5" fill="#cfd6de"/>`).join('') ++ '<path d="M0,-215 Q-22,-196 -42,-232" stroke="#cfd6de" stroke-width="3" fill="none"/><rect x="-58" y="-244" width="34" height="8" fill="#1a2440"/><rect x="24" y="-244" width="34" height="8" fill="#1a2440"/>' ++ '<rect x="-74" y="-156" width="148" height="16" fill="#141a28"/><rect x="-12" y="-158" width="24" height="20" rx="3" fill="#cfd6de"/>',+ hair: ['#5a3a24', 'M-88,-372 L-84,-330 Q-78,-344 -72,-346 L-70,-392 Q-82,-394 -88,-372 Z M88,-372 L84,-330 Q78,-344 72,-346 L70,-392 Q82,-394 88,-372 Z'],+ hat: '<path d="M-86,-414 C-92,-490 -62,-566 0,-572 C62,-566 92,-490 86,-414 Q0,-426 -86,-414 Z" fill="#1e2a44"/>' ++ '<path d="M-92,-418 Q0,-432 92,-418 L90,-404 Q0,-418 -90,-404 Z" fill="#141c30"/><circle cx="0" cy="-572" r="10" fill="#cfd6de"/>' ++ '<path d="M0,-498 l8,16 l18,2 l-13,12 l4,18 l-17,-9 l-17,9 l4,-18 l-13,-12 l18,-2 Z" fill="#d8dde4"/>' };+// eat (0…1) lifts his screen-right hand from wherever armR puts it to his mouth: .5 holds a chip at his chest ("halfway"),+// .8 at his chin, 1 in his mouth (chew with mouth 'chew'/'A' on twos). From .7 on the mitten and its chip are drawn in+// front of his face (an arm raised that far goes behind the big head). Give hold: 'chip' to show the chip below .7.+const COP_EAT = -152; // armR at eat 1+function copPuppet(p, o) {+ const pup = closedEyes(spKid(p, 'cop', { skin: '#f2cfae', coat: '#22304f', stripe: '#22304f', pants: '#1c2236', ...o }));+ // the moustache sits on the face (it slides with the features), just above the mouth+ pup.g.querySelector('[data-p="feat"] .mouth').insertAdjacentHTML('beforebegin',+ '<path d="M-42,-322 Q-30,-344 -8,-334 Q0,-340 8,-334 Q30,-344 42,-322 Q46,-312 34,-316 Q16,-322 0,-318 Q-16,-322 -34,-316 Q-46,-312 -42,-322 Z" fill="#6a4228"/>');+ const all = pup.g.querySelector('[data-p="all"]'), hand = mk('g', {}, all);+ hand.innerHTML = `<g transform="translate(-6,-16)">${chipSVG}</g><g filter="url(#paper)"><circle r="18" fill="#f2efe6"/><ellipse cx="14" cy="-10" rx="7" ry="10" fill="#f2efe6"/></g>`;+ bakeAll(hand);+ const base = pup.pose, S = pup.S;+ pup.pose = (o, f) => {+ const e = Math.max(0, Math.min(1, o.eat || 0)), armR = e ? (o.armR || 0) * (1 - e) + COP_EAT * e : o.armR;+ base(e ? { ...o, armR, hold: e >= .7 ? null : o.hold } : o, f);+ vis(hand, e >= .7);+ if (e >= .7) { const a = (-24 - armR) * Math.PI / 180; tf(hand, `translate(${(S.sx - 72 * Math.sin(a)).toFixed(1)},${(S.sy + 72 * Math.cos(a)).toFixed(1)})`); }+ };+ return pup;+}++// Where a grown-up's mitten is in the world for a pose (side 'R' = screen-right arm, 'L' = screen-left): for a hand+// that meets something (the penguin's flipper, the photo).+function handAt(pup, o, side = 'R') {+ const S = pup.S, s = o.s ?? 1, a = (side === 'R' ? -24 - (o.armR || 0) : 24 + (o.armL || 0)) * Math.PI / 180;+ const lx = (side === 'R' ? S.sx : -S.sx) - 72 * Math.sin(a), ly = S.sy + 72 * Math.cos(a) + (o.bob || 0);+ return [(o.x || 0) + s * lx, (o.y || 0) + s * ly];+}++// A visible hand-to-hand pass for the man (the fish from his screen-left hand to his screen-right one, or back): u 0…1+// over ~0.6 s. Both mittens swing in to meet in front of his belly (arms -62), the prop changes hands there at u .5,+// and they swing back to their rest angles. Spread the result into his pose: { ...pose, ...manPass(u) }.+function manPass(u, key = 'fish', { from = 'L', restL = 10, restR = 0 } = {}) {+ const k = Math.sin(Math.PI * Math.max(0, Math.min(1, u))), got = u >= .5;+ const inL = from === 'L' ? !got : got;+ return { armL: restL + (-62 - restL) * k, armR: restR + (-62 - restR) * k, holdL: inL ? key : null, hold: inL ? null : key };+}++/* ---------- the penguin ----------+ Front-facing, built at its feet (0, 0), about 236 tall at s 1 (used at s .9: ~212, the man's waist). pose(o, f): x, y,+ s; look (-1…1, the face slides toward where it looks), eyeX/eyeY (-1…1), lids (0…1), shut (blink), beak (0 shut … 1+ wide: a honk), headR (degrees, + tilts toward the screen-right), rock (degrees, the waddle's tilt; + leans right),+ footL/footR (px a foot is lifted), bob, squash (+ flattens: a landing), flipL/flipR (degrees, + raises the flipper+ outward; 0 hangs, 90 straight out, 150 up), hold (prop key in the screen-right flipper), sticker (the zoo sticker on+ its chest), ring (a rubber ring round its waist), shades (false, 'up' on its head, 'on' over its eyes), balloon (a+ ZOO balloon tied to its screen-left flipper; it sways by itself; balX shifts it sideways, + to the screen-right). pengWaddle(q) gives a waddle on twos. */+const PENG = { ink: '#25282e', belly: '#f6f3ea', beak: '#f0a030', beak2: '#c9741c', feet: '#f0a030' };+const REST_PENG = { x: 0, y: 0, s: 1, look: 0, eyeX: 0, eyeY: 0, lids: 0, shut: false, beak: 0, headR: 0, rock: 0, footL: 0, footR: 0,+ bob: 0, squash: 0, flipL: 0, flipR: 0, hold: null, sticker: false, ring: false, shades: false, balloon: false };+const PENG_FLIP = { x: 58, y: -130, len: 96, rest: 10 }; // the flippers' shoulder pins and length+function penguinPuppet(parent, { holds = {} } = {}) {+ const g = mk('g', {}, parent), id = 'pgc' + (++spClip), C = PENG;+ const eye = sx => `<ellipse cx="${sx * 15}" cy="-196" rx="14" ry="17"`;+ const flip = side => `<g data-p="flip${side}"><g filter="url(#paper)"><path d="M-8,0 C10,-4 24,40 16,96 C14,104 4,104 2,98 C-2,60 -12,30 -8,0 Z" fill="${C.ink}" transform="scale(${side === 'R' ? 1 : -1},1)"/></g>+ ${side === 'L' ? `<g data-p="bal" transform="translate(${-8},94)"><path data-p="balStr" d="M0,0" stroke="#5a5a5a" stroke-width="1.6" fill="none"/>+ <g data-p="balloon"><g filter="url(#paper)"><path d="M0,-84 C-40,-84 -44,-36 -26,-14 C-16,-2 -6,2 0,4 C6,2 16,-2 26,-14 C44,-36 40,-84 0,-84 Z" fill="#d8403a"/><path d="M-6,8 L6,8 L0,2 Z" fill="#b83030"/>+ <ellipse cx="-14" cy="-60" rx="7" ry="12" fill="#f6b0a0" opacity=".7"/>+ <text x="0" y="-32" font-family="Rockwell, Georgia, serif" font-size="20" font-weight="700" text-anchor="middle" fill="#fbf6ea">ZOO</text></g></g></g>` : ''}+ ${Object.entries(holds).map(([k, s]) => `<g data-p="hold${side}_${k}" transform="translate(${side === 'R' ? 8 : -8},94)">${s}</g>`).join('')}</g>`;+ g.innerHTML = `<ellipse data-p="shadow" cx="8" cy="-2" rx="78" ry="13" fill="url(#spShadow)"/><g data-p="all">+ <g data-p="footL"><g filter="url(#paper)"><path d="M-46,-2 Q-40,-16 -22,-14 Q-4,-14 -2,-2 Q-24,6 -46,-2 Z" fill="${C.feet}"/></g></g>+ <g data-p="footR"><g filter="url(#paper)"><path d="M46,-2 Q40,-16 22,-14 Q4,-14 2,-2 Q24,6 46,-2 Z" fill="${C.feet}"/></g></g>+ <g data-p="ringB"><path d="M-94,-70 A94,26 0 0 1 94,-70" fill="none" stroke="#b8322a" stroke-width="24"/></g>+ ${flip('L')}${flip('R')}+ <g filter="url(#paper)"><ellipse cx="0" cy="-102" rx="70" ry="98" fill="${C.ink}"/><ellipse cx="0" cy="-84" rx="53" ry="78" fill="${C.belly}"/></g>+ <g data-p="sticker"><g filter="url(#paper)"><circle cx="-26" cy="-118" r="17" fill="#f6c843"/><circle cx="-26" cy="-118" r="14" fill="none" stroke="#c8402f" stroke-width="1.6"/>+ <text x="-26" y="-121" font-family="Rockwell, Georgia, serif" font-size="8" font-weight="700" text-anchor="middle" fill="#c8402f">I ♥</text>+ <text x="-26" y="-111" font-family="Rockwell, Georgia, serif" font-size="8.5" font-weight="700" text-anchor="middle" fill="#2f4f7a">ZOO</text></g></g>+ <g data-p="ringF"><g filter="url(#paper)"><path d="M-94,-70 A94,26 0 0 0 94,-70" fill="none" stroke="#e8463a" stroke-width="26"/>+ <path d="M-94,-70 A94,26 0 0 0 94,-70" fill="none" stroke="#fbf6ea" stroke-width="26" stroke-dasharray="22 40" stroke-dashoffset="10"/></g></g>+ <g data-p="head">+ <g filter="url(#paper)"><circle cx="0" cy="-186" r="50" fill="${C.ink}"/></g>+ <g data-p="feat">+ <g data-p="whites" filter="url(#paper)">${eye(-1)} fill="#fff"/>${eye(1)} fill="#fff"/></g>+ <g data-p="pupils"><circle cx="-15" cy="-196" r="4.6" fill="${SP_INK}"/><circle cx="15" cy="-196" r="4.6" fill="${SP_INK}"/></g>+ <clipPath id="${id}e">${eye(-1)}/>${eye(1)}/></clipPath>+ <g clip-path="url(#${id}e)"><g data-p="lids"><rect x="-32" y="-248" width="64" height="34" fill="${C.ink}"/><path d="M-32,-214 H32" stroke="#555" stroke-width="2.5"/></g></g>+ ${eye(-1)} fill="none" stroke="#111" stroke-width="2"/>${eye(1)} fill="none" stroke="#111" stroke-width="2"/>+ <g data-p="mouth"><path d="M-13,0 L13,0 L10,1 L-10,1 Z" fill="#4a1a16"/></g>+ <g data-p="beakL"><g filter="url(#paper)"><path d="M-12,-152 L12,-152 Q9,-136 0,-134 Q-9,-136 -12,-152 Z" fill="${C.beak2}"/></g></g>+ <g data-p="beakU"><g filter="url(#paper)"><path d="M-17,-177 Q0,-182 17,-177 L12,-160 Q0,-153 -12,-160 Z" fill="${C.beak}"/></g></g>+ <g data-p="shades"><g filter="url(#paper)"><ellipse cx="-16" cy="-196" rx="18" ry="14" fill="#16181c"/><ellipse cx="16" cy="-196" rx="18" ry="14" fill="#16181c"/>+ <path d="M-2,-198 Q0,-202 2,-198" stroke="#16181c" stroke-width="4" fill="none"/>+ <ellipse cx="-16" cy="-196" rx="18" ry="14" fill="none" stroke="#e8c858" stroke-width="2.5"/><ellipse cx="16" cy="-196" rx="18" ry="14" fill="none" stroke="#e8c858" stroke-width="2.5"/>+ <path d="M-26,-201 l7,-5 M6,-201 l7,-5" stroke="#f4f6f8" stroke-width="3" stroke-linecap="round"/></g></g>+ </g></g></g>`;+ bakeAll(g);+ const P = pieces(g), holdKeys = Object.keys(holds);+ return { g, pose(o, f) {+ o = { ...REST_PENG, ...o };+ const j = k => .35 * jit(f >> 1, k);+ tf(g, `translate(${(o.x + j(1) * .8).toFixed(1)},${(o.y + j(2) * .6).toFixed(1)}) scale(${o.s})`);+ tf(P.all, `translate(0,${o.bob.toFixed(1)}) rotate(${(o.rock + j(3) * .4).toFixed(2)},0,-8) scale(${(1 + .5 * o.squash).toFixed(3)},${(1 - o.squash).toFixed(3)})`);+ // a lifted foot also swings out from under the belly, so it shows (footR 20+ reads as "one foot up")+ tf(P.footL, `translate(${(-.9 * o.footL).toFixed(1)},${(-.8 * o.footL).toFixed(1)}) rotate(${(o.footL * .6).toFixed(1)},-24,-6)`);+ tf(P.footR, `translate(${(.9 * o.footR).toFixed(1)},${(-.8 * o.footR).toFixed(1)}) rotate(${(-o.footR * .6).toFixed(1)},24,-6)`);+ const aL = PENG_FLIP.rest + o.flipL + j(6) * .6, aR = PENG_FLIP.rest + o.flipR + j(7) * .6;+ tf(P.flipL, `translate(${-PENG_FLIP.x},${PENG_FLIP.y}) rotate(${aL.toFixed(2)})`);+ tf(P.flipR, `translate(${PENG_FLIP.x},${PENG_FLIP.y}) rotate(${(-aR).toFixed(2)})`);+ for (const k of holdKeys) { vis(P[`holdR_${k}`], o.hold === k); vis(P[`holdL_${k}`], false); tf(P[`holdR_${k}`], `translate(8,94) rotate(${aR.toFixed(2)})`); }+ // the balloon floats up on its string from the left flipper's tip, drifting a little on its own+ vis(P.bal, o.balloon);+ if (o.balloon) {+ const t = f / FPS, sw = 10 * Math.sin(t * 1.3) + 4 * Math.sin(t * 2.9) - o.rock * 2, bx = -26 + sw + (o.balX || 0), by = -196;+ tf(P.bal, `translate(-8,94) rotate(${(-aL).toFixed(2)})`);+ const d = `M0,0 Q${(bx * .3 + 6).toFixed(1)},${(by * .5).toFixed(1)} ${bx.toFixed(1)},${(by + 8).toFixed(1)}`;+ if (P.balStr._d !== d) P.balStr.setAttribute('d', P.balStr._d = d);+ tf(P.balloon, `translate(${bx.toFixed(1)},${by}) rotate(${(sw * .5).toFixed(2)})`);+ }+ vis(P.sticker, o.sticker); vis(P.ringB, o.ring); vis(P.ringF, o.ring);+ tf(P.head, `rotate(${(o.headR + j(8) * .6).toFixed(2)},0,-150)`);+ tf(P.feat, `translate(${(o.look * 14).toFixed(1)},0)`);+ tf(P.pupils, `translate(${(o.eyeX * 6).toFixed(1)},${(o.eyeY * 7).toFixed(1)})`);+ tf(P.lids, `translate(0,${((o.shut ? 1 : o.lids) * 34).toFixed(1)})`);+ // the upper mandible stays put (under the eyes); the lower drops away from it and the dark mouth shows between+ tf(P.beakL, `translate(0,${(-12 + 26 * o.beak).toFixed(1)})`);+ vis(P.mouth, o.beak > .05); tf(P.mouth, `translate(0,-162) scale(1,${(1 + 26 * o.beak).toFixed(1)})`);+ vis(P.shades, !!o.shades); tf(P.shades, o.shades === 'up' ? 'translate(0,-38)' : '');+ } };+}+// A waddle on twos: the body tips from foot to foot and the lifted foot clears the ground. Slide x yourself+// (~110 px/s at s .9; ~150 px/s hurrying to keep up with the man) and point the face where it goes (look ±.6).+function pengWaddle(q) { const k = Math.floor(q * FPS / 2) % 2 ? 1 : -1; return { rock: 5 * k, footL: k > 0 ? 9 : 0, footR: k < 0 ? 9 : 0, bob: -2, k }; }+// Where a flipper's tip is in the world for a pose ('R' screen-right, 'L' screen-left): where the man's hand holds it.+function flipAt(o, side = 'R') {+ const s = o.s ?? 1, a = (PENG_FLIP.rest + (side === 'R' ? o.flipR || 0 : o.flipL || 0)) * Math.PI / 180, sg = side === 'R' ? 1 : -1;+ return [(o.x || 0) + s * sg * (PENG_FLIP.x + PENG_FLIP.len * Math.sin(a)), (o.y || 0) + s * (PENG_FLIP.y + (o.bob || 0) + PENG_FLIP.len * Math.cos(a))];+}++// Hand in flipper: returns the penguin's pose `po` with x and flipR set so its screen-right flipper tip is in the man's+// screen-left mitten (man pose `mo`; keep the man's armL small, 0…15, so the hand hangs low). The man leads; the+// penguin follows the hand wherever he walks.+function pengHand(man, mo, po) {+ const [hx, hy] = handAt(man, mo, 'L'), s = po.s ?? 1, c = Math.max(-1, Math.min(1, ((hy - (po.y || 0)) / s - PENG_FLIP.y - (po.bob || 0)) / PENG_FLIP.len));+ const a = Math.acos(c);+ return { ...po, flipR: a * 180 / Math.PI - PENG_FLIP.rest, x: hx - s * (PENG_FLIP.x + PENG_FLIP.len * Math.sin(a)) };+}++/* ---------- props (puppet pieces: give them to holds, or prop() them onto a stage) ---------- */+// The fish wrapped in paper, carried by its string: the parcel hangs just below the mitten, its tail to the screen-right.+// Keep the penguin ~200 px away from the man (or it stands under the parcel); in a two-shot it looks up at it.+const fishSVG = `<path d="M0,6 L-6,22 M0,6 L8,22" stroke="#a07a4a" stroke-width="2.4"/>${artSVG('fish', -66, 18, 132, 43)}`;+// The red bucket with a yellow spade, held by its handle.+const bucketSVG = artSVG('bucket', -32, -8, 64, 100);+// A paper cone of fish and chips, held round the cone.+const chipsSVG = artSVG('chips', -30, -62, 58, 108);+// One chip, held up between finger and thumb (the policeman eats them one by one).+const chipSVG = '<g filter="url(#paper)"><rect x="-4" y="-26" width="8" height="28" rx="3" fill="#e8b84a" transform="rotate(-12)"/></g>';+// The zoo photo as it is held in a hand (small: its insert is photoInsert below), held by its bottom edge.+const photoSVG = `<g filter="url(#paper)"><rect x="-38" y="-92" width="76" height="90" fill="#fbf8f0"/></g><image href="../img/props/zoo-pool.webp" x="-32" y="-86" width="64" height="64"/>`;+// The zoo poster: the painted picture with its words, top-left at (0, 0), 230 x 307.+const POSTER = { x: 1300, y: 320, w: 230, h: 307 };+const posterSVG = `<g filter="url(#paper)"><rect x="-6" y="-6" width="${POSTER.w + 12}" height="${POSTER.h + 12}" fill="#e2d6bc"/></g>${artSVG('poster-zoo', 0, 0, POSTER.w, POSTER.h)}+ <text x="${POSTER.w / 2}" y="52" font-family="Rockwell, Georgia, serif" font-size="40" font-weight="700" text-anchor="middle" fill="#2f5a3a">CITY ZOO</text>+ <text x="${POSTER.w / 2}" y="${POSTER.h - 24}" font-family="Rockwell, Georgia, serif" font-size="23" font-style="italic" font-weight="700" text-anchor="middle" fill="#b8402f">A great day out!</text>+ <circle cx="10" cy="10" r="4" fill="#c8a040"/><circle cx="${POSTER.w - 10}" cy="10" r="4" fill="#c8a040"/>`;++/* ---------- the insert of the zoo photo (scene 3) ----------+ photoInsert(p) → a full-frame group: the town street blurred behind, the man's mitten holding up a big+ polaroid: the penguin pool at the zoo, and in front of its railing — on the visitors' side — the man and the penguin+ grinning, the penguin with an ice cream, its sticker and balloon. A photo does not move: show and hide it whole. */+const iceSVG = '<g filter="url(#paper)"><path d="M-12,-6 L12,-6 L0,30 Z" fill="#d8a45a"/><circle cx="0" cy="-14" r="13" fill="#f6e2ea"/><circle cx="-6" cy="-24" r="9" fill="#f3c6d6"/></g>';+function photoInsert(p) {+ const g = mk('g', {}, p);+ g.innerHTML = `<image href="../img/sets/square/bg-soft.webp" x="-1300" y="-600" width="3440" height="1936" preserveAspectRatio="none"/>`;+ const card = mk('g', { transform: 'translate(800,470) rotate(-3)' }, g);+ card.innerHTML = `<g filter="url(#paper)"><rect x="-300" y="-340" width="600" height="700" fill="#fbf8f0"/></g>+ <image href="../img/props/zoo-pool.webp" x="-268" y="-308" width="536" height="536"/>+ <text x="0" y="300" font-family="Chalkboard SE, Comic Sans MS, sans-serif" font-size="36" text-anchor="middle" fill="#3a4f86">City Zoo — Tuesday</text>`;+ const clip = mk('clipPath', { id: 'photoClip' }, card); mk('rect', { x: -268, y: -308, width: 536, height: 536 }, clip);+ const inner = mk('g', { 'clip-path': 'url(#photoClip)' }, card);+ // the two of them in front of the railing, grinning (a photo: posed once, frame 0)+ const man = manPuppet(inner), peng = penguinPuppet(inner, { holds: { ice: iceSVG } });+ man.pose({ x: -90, y: 330, s: .95, mouth: 'grin', armR: 40, look: .2 }, 0);+ peng.pose({ x: 90, y: 250, s: 1.05, look: -.2, flipR: 60, hold: 'ice', sticker: true, balloon: true, balX: 150, eyeY: -.2 }, 0);+ // his screen-left mitten holds the photo up by its bottom-left corner (the other hand has the bucket)+ const hands = mk('g', {}, g);+ hands.innerHTML = `<g transform="translate(800,470) rotate(-3)"><g filter="url(#paper)"><rect x="-340" y="380" width="80" height="200" rx="30" fill="#4f7d4a"/><circle cx="-300" cy="350" r="46" fill="#f2efe6"/></g></g>`;+ bakeAll(g);+ // photoZoom(g, z, [x, y]): push in on a point of the photo (1 = as built); PHOTO_SMILE is the penguin with its ice cream+ return g;+}+const PHOTO_SMILE = [915, 520];+const photoZoom = (g, z, [x, y] = PHOTO_SMILE) => tf(g, z === 1 ? '' : `translate(${x},${y}) scale(${z.toFixed(4)}) translate(${-x},${-y})`);++/* ---------- places ----------+ Everyone stands on y 800 at s .9 (the penguin too); x positions and framings below. Close-up helpers take the+ puppet's x: MAN_CU(x), COP_CU(x), PENG_CU(x) (whole penguin), PENG_FACE(x) (its head, an insert), TWO_MP(xm, xp)+ (the man and the penguin). Close-ups need soft(t, true). */+const SEA = { s: .9, ground: 800 };+const MAN_CU = x => ({ x, y: 480, z: 2.4 }), COP_CU = x => ({ x, y: 470, z: 2.3 });+// singles once they stand close (the policeman walked over, the penguin beside the man): one face, at most a shoulder+const MAN_SOLO = x => ({ x: x - 45, y: 455, z: 3.8 }), COP_SOLO = x => ({ x: x + 45, y: 445, z: 3.8 });+// the man and the policeman face to face (scene 3, after he walks over: man 860, policeman ~1090)+const MAN_COP = (xm, xc) => ({ x: (xm + xc) / 2, y: 465, z: 2.1 });+const PENG_CU = x => ({ x, y: 690, z: 3.0 }), PENG_FACE = x => ({ x, y: 630, z: 5.5 });+// inserts on the day-two souvenirs: the balloon on its string (penguin at x), the sticker on its chest+const PENG_BALLOON = x => ({ x: x - 50, y: 600, z: 3.4 }), PENG_STICKER = x => ({ x: x - 24, y: 700, z: 5 });+const TWO_MP = (xm, xp) => ({ x: (xm + xp) / 2, y: 610, z: 1.9 });++/* The harbour (scene 1): the fish stall on the far left (the man starts there, x 230), a stack of fish crates at+ x 540…802 standing back on the quay (bottom y 754; a cut-out: whoever is in cam.stage stands behind it, whoever is in+ cam.stageAt.crates in front). The penguin hides behind their left end (x HARB.crates 620, y HARB.hideY 745, s+ HARB.hideS .85: the top of its head just shows; lift it with bob ≈ -42 to peek over); coming out round the left end it+ steps down to y 800, s .9 (ease y and s over ~0.4 s). front(pup, true|false) moves a puppet in front of / behind the+ crates; the man walks on y 800, in front of them. */+const HARB = { stall: 230, crates: 620, hideY: 745, hideS: .85, ground: 800 };+const HARB_WIDE = { x: 800, y: 450, z: 1 }, HARB_CRATES = { x: 680, y: 620, z: 2.6 };+function harbourSet(p) {+ const cam = paperCam(p, 'harbour', {}, { after: 'bg', stages: ['crates'] });+ const peng = penguinPuppet(cam.stage), man = manPuppet(cam.stageAt.crates, { holds: { fish: fishSVG } });+ const front = (pup, on) => { const want = on ? cam.stageAt.crates : cam.stage; if (pup.g.parentNode !== want) want.appendChild(pup.g); };+ return { cam, man, peng, front };+}++/* The town street (scenes 2 and 3): shops along the back, the lamppost at x 330, the plain wall on the right with the+ zoo poster (POSTER, x 1300…1530, y 320…627). The policeman's corner is x 1180 (he faces us, poster at his left+ shoulder, screen-right); the man stops at x 860 and the penguin at x 620 (well clear of the fish parcel). */+const SQ = { cop: 1180, man: 860, peng: 620, ground: 800 };+const SQ_WIDE = { x: 800, y: 450, z: 1 }, SQ_THREE = { x: 940, y: 560, z: 1.45 }, SQ_POSTER = { x: 1400, y: 474, z: 2.9 }; // poster insert: hide the policeman in it (the frame edge would cut his helmet)+// pushes on the poster: to the penguins painted in it (scene 2: "the zoo is where penguins live") and to its slogan+// (scene 3: the clue paid off). cam.to(...) from SQ_POSTER over ~0.6–1 s.+const POSTER_PENG = { x: 1470, y: 495, z: 5 }, POSTER_SLOGAN = { x: 1415, y: 598, z: 4.5 };+function squareSet(p) {+ const cam = paperCam(p, 'square');+ const poster = prop(cam.stage, posterSVG); tf(poster, `translate(${POSTER.x},${POSTER.y})`);+ const cop = copPuppet(cam.stage, { holds: { chips: chipsSVG } });+ const peng = penguinPuppet(cam.stage);+ const man = manPuppet(cam.stage, { holds: { fish: fishSVG, bucket: bucketSVG, photo: photoSVG } });+ return { cam, man, cop, peng, poster };+}++/* The beach (scene 4): the FISH & CHIPS kiosk on the left; the policeman eats his lunch in front of it (x 470); the+ second penguin comes in from the left to x 640. Out in the sea, smaller and further away (s .55, feet y 660, hidden+ under a strip of paper waves that rolls by itself), the man (x 1180) and the penguin floating in its ring (x 1340;+ pose it with y ≈ BEACH.float). The umbrella at x 900 is painted. */+const BEACH = { cop: 470, peng2: 640, man: 1180, peng: 1340, ss: .55, sea: 660, float: 648 };+const BEACH_WIDE = { x: 800, y: 450, z: 1 }, BEACH_SWIM = { x: 1260, y: 560, z: 2.6 }, BEACH_FLOAT = { x: 1415, y: 585, z: 4.2 },+ BEACH_MAN = { x: 1180, y: 520, z: 3.2 }, BEACH_TWO = { x: 560, y: 600, z: 1.85 };+function beachSet(p) {+ const cam = paperCam(p, 'beach');+ const man = manPuppet(cam.stage, { holds: { bucket: bucketSVG } }), peng = penguinPuppet(cam.stage);+ // the water in front of the swimmers is the painted sea itself (a clipped copy of the set, so it matches), hiding+ // their legs; only the paper foam line on it rolls to and fro (roll). Keep soft(…, 'all') off on the beach: the copy+ // stays sharp.+ const crest = Array.from({ length: 5 }, () => 'q20,-7 40,0 t40,0').join(' ');+ const sea = mk('g', {}, cam.stage);+ sea.innerHTML = `<clipPath id="seaFront"><path d="M1000,666 L1012,640 Q1040,624 1080,622 ${crest} Q1560,624 1590,640 L1600,666 Z"/></clipPath>+ <image href="../img/sets/beach/bg.webp" x="-60" y="-34" width="1720" height="968" preserveAspectRatio="none" clip-path="url(#seaFront)"/>`;+ const waves = prop(cam.stage, `<g filter="url(#paper)"><path d="M1080,622 ${crest}" fill="none" stroke="#f4f6f2" stroke-width="5" stroke-linecap="round"/></g>`);+ const cop = copPuppet(cam.stage, { holds: { chips: chipsSVG, chip: chipSVG } }), peng2 = penguinPuppet(cam.stage);+ // call every frame: the strip rolls, the swimmers bob with it (add bob(q) to their y)+ const roll = q => tf(waves, `translate(${(10 * Math.sin(q * 1.1)).toFixed(1)},${(3 * Math.sin(q * 2.2)).toFixed(1)})`);+ const bob = q => 5 * Math.sin(q * 2.2 + .6);+ return { cam, man, peng, cop, peng2, roll, bob };+}++// The title card at the end: black, a torn paper strip with the title, the series line under it. card.at(q, t0) every+// frame: hidden before t0, then the strip springs up (0.35 s) and at t0 + 1.2 a small penguin peeks over its right end.+function titleCard(p) {+ const card = mk('g', {}, p);+ card.innerHTML = `<rect width="1600" height="900" fill="#0d0b0a"/>+ <g filter="url(#paper)"><path d="M140,330 L260,318 L420,334 L600,316 L800,332 L1000,317 L1200,333 L1380,318 L1470,330 L1460,430 L1370,444 L1180,428 L1000,444 L800,430 L600,446 L400,430 L240,446 L136,432 Z" fill="#f3ead6"/></g>+ <text x="800" y="418" font-family="Chalkboard SE, Avenir Next Heavy, sans-serif" font-size="86" font-weight="800" text-anchor="middle" fill="#1d1a1a">The Penguin and the Zoo</text>+ <text x="800" y="510" font-family="Avenir Next, sans-serif" font-size="38" letter-spacing="4" text-anchor="middle" fill="#cfc6b4">Joke Collection · Episode 5</text>`;+ const strip = mk('g', {}, card); [...card.children].slice(1, 4).forEach(c => strip.appendChild(c));+ // the penguin rises behind the strip, clipped at the strip's middle so it never shows below it+ const clip = mk('clipPath', { id: 'titlePeek' }, card); mk('rect', { x: 0, y: 0, width: 1600, height: 400 }, clip);+ const wrap = mk('g', { 'clip-path': 'url(#titlePeek)' }, card), peek = mk('g', {}, wrap), pg = penguinPuppet(peek); card.insertBefore(wrap, strip);+ pg.pose({ x: 1380, y: 440, s: .7, look: -.6, eyeX: -1, eyeY: .3 }, 0);+ bakeAll(card);+ card.at = (q, t0) => {+ vis(card, q >= t0); if (q < t0) return;+ const u = span(q, t0, t0 + .35), o = Math.sin(Math.PI * Math.min(1, u * 1.4)) * 12 * (1 - u);+ tf(strip, `translate(0,${((1 - u) * 80 - o).toFixed(1)})`);+ tf(peek, `translate(0,${(130 * (1 - span(q, t0 + 1.2, t0 + 1.5))).toFixed(1)})`);+ };+ return card;+}+Object.assign(SFX_BED, { waves: 32, 'waves-bed3': 24.35 }); // called once per scene; a seek or deep link into the middle joins them part-waydiff --git a/site/joke-collection/img/props/bucket.webp b/site/joke-collection/img/props/bucket.webpnew file mode 100644index 0000000..a0c5138Binary files /dev/null and b/site/joke-collection/img/props/bucket.webp differdiff --git a/site/joke-collection/img/props/chips.webp b/site/joke-collection/img/props/chips.webpnew file mode 100644index 0000000..8331b72Binary files /dev/null and b/site/joke-collection/img/props/chips.webp differdiff --git a/site/joke-collection/img/props/fish.webp b/site/joke-collection/img/props/fish.webpnew file mode 100644index 0000000..b3bffe4Binary files /dev/null and b/site/joke-collection/img/props/fish.webp differdiff --git a/site/joke-collection/img/props/poster-zoo.webp b/site/joke-collection/img/props/poster-zoo.webpnew file mode 100644index 0000000..0d3b982Binary files /dev/null and b/site/joke-collection/img/props/poster-zoo.webp differdiff --git a/site/joke-collection/img/props/zoo-pool.webp b/site/joke-collection/img/props/zoo-pool.webpnew file mode 100644index 0000000..08524b3Binary files /dev/null and b/site/joke-collection/img/props/zoo-pool.webp differdiff --git a/site/joke-collection/img/puppets/111ad6f0.webp b/site/joke-collection/img/puppets/111ad6f0.webpnew file mode 100644index 0000000..d7b9356Binary files /dev/null and b/site/joke-collection/img/puppets/111ad6f0.webp differdiff --git a/site/joke-collection/img/puppets/1c642e56.webp b/site/joke-collection/img/puppets/1c642e56.webpnew file mode 100644index 0000000..58b4f85Binary files /dev/null and b/site/joke-collection/img/puppets/1c642e56.webp differdiff --git a/site/joke-collection/img/puppets/214f412a.webp b/site/joke-collection/img/puppets/214f412a.webpnew file mode 100644index 0000000..1865859Binary files /dev/null and b/site/joke-collection/img/puppets/214f412a.webp differdiff --git a/site/joke-collection/img/puppets/2ad2e9bd.webp b/site/joke-collection/img/puppets/2ad2e9bd.webpnew file mode 100644index 0000000..16ef339Binary files /dev/null and b/site/joke-collection/img/puppets/2ad2e9bd.webp differdiff --git a/site/joke-collection/img/puppets/31de108c.webp b/site/joke-collection/img/puppets/31de108c.webpnew file mode 100644index 0000000..c8616fdBinary files /dev/null and b/site/joke-collection/img/puppets/31de108c.webp differdiff --git a/site/joke-collection/img/puppets/38d9e24c.webp b/site/joke-collection/img/puppets/38d9e24c.webpnew file mode 100644index 0000000..9395e0dBinary files /dev/null and b/site/joke-collection/img/puppets/38d9e24c.webp differdiff --git a/site/joke-collection/img/puppets/4c652102.webp b/site/joke-collection/img/puppets/4c652102.webpnew file mode 100644index 0000000..708ebadBinary files /dev/null and b/site/joke-collection/img/puppets/4c652102.webp differdiff --git a/site/joke-collection/img/puppets/4ef77af1.webp b/site/joke-collection/img/puppets/4ef77af1.webpnew file mode 100644index 0000000..0ac39ecBinary files /dev/null and b/site/joke-collection/img/puppets/4ef77af1.webp differdiff --git a/site/joke-collection/img/puppets/5b449065.webp b/site/joke-collection/img/puppets/5b449065.webpnew file mode 100644index 0000000..a943d76Binary files /dev/null and b/site/joke-collection/img/puppets/5b449065.webp differdiff --git a/site/joke-collection/img/puppets/6303efac.webp b/site/joke-collection/img/puppets/6303efac.webpnew file mode 100644index 0000000..c58592dBinary files /dev/null and b/site/joke-collection/img/puppets/6303efac.webp differdiff --git a/site/joke-collection/img/puppets/64646773.webp b/site/joke-collection/img/puppets/64646773.webpnew file mode 100644index 0000000..a2cecd2Binary files /dev/null and b/site/joke-collection/img/puppets/64646773.webp differdiff --git a/site/joke-collection/img/puppets/6c955f82.webp b/site/joke-collection/img/puppets/6c955f82.webpnew file mode 100644index 0000000..560c02eBinary files /dev/null and b/site/joke-collection/img/puppets/6c955f82.webp differdiff --git a/site/joke-collection/img/puppets/709f972a.webp b/site/joke-collection/img/puppets/709f972a.webpnew file mode 100644index 0000000..b56ed86Binary files /dev/null and b/site/joke-collection/img/puppets/709f972a.webp differdiff --git a/site/joke-collection/img/puppets/7338febb.webp b/site/joke-collection/img/puppets/7338febb.webpnew file mode 100644index 0000000..c8795e8Binary files /dev/null and b/site/joke-collection/img/puppets/7338febb.webp differdiff --git a/site/joke-collection/img/puppets/76414f9a.webp b/site/joke-collection/img/puppets/76414f9a.webpnew file mode 100644index 0000000..2b273faBinary files /dev/null and b/site/joke-collection/img/puppets/76414f9a.webp differdiff --git a/site/joke-collection/img/puppets/7e4ff796.webp b/site/joke-collection/img/puppets/7e4ff796.webpnew file mode 100644index 0000000..c443decBinary files /dev/null and b/site/joke-collection/img/puppets/7e4ff796.webp differdiff --git a/site/joke-collection/img/puppets/90137872.webp b/site/joke-collection/img/puppets/90137872.webpnew file mode 100644index 0000000..e904b40Binary files /dev/null and b/site/joke-collection/img/puppets/90137872.webp differdiff --git a/site/joke-collection/img/puppets/96bcd7c9.webp b/site/joke-collection/img/puppets/96bcd7c9.webpnew file mode 100644index 0000000..2ea719eBinary files /dev/null and b/site/joke-collection/img/puppets/96bcd7c9.webp differdiff --git a/site/joke-collection/img/puppets/a0579821.webp b/site/joke-collection/img/puppets/a0579821.webpnew file mode 100644index 0000000..6d3acb4Binary files /dev/null and b/site/joke-collection/img/puppets/a0579821.webp differdiff --git a/site/joke-collection/img/puppets/a157bba8.webp b/site/joke-collection/img/puppets/a157bba8.webpnew file mode 100644index 0000000..b023d1cBinary files /dev/null and b/site/joke-collection/img/puppets/a157bba8.webp differdiff --git a/site/joke-collection/img/puppets/a75e5aea.webp b/site/joke-collection/img/puppets/a75e5aea.webpnew file mode 100644index 0000000..9850731Binary files /dev/null and b/site/joke-collection/img/puppets/a75e5aea.webp differdiff --git a/site/joke-collection/img/puppets/a92694c7.webp b/site/joke-collection/img/puppets/a92694c7.webpnew file mode 100644index 0000000..7561eacBinary files /dev/null and b/site/joke-collection/img/puppets/a92694c7.webp differdiff --git a/site/joke-collection/img/puppets/a9effc98.webp b/site/joke-collection/img/puppets/a9effc98.webpnew file mode 100644index 0000000..4317625Binary files /dev/null and b/site/joke-collection/img/puppets/a9effc98.webp differdiff --git a/site/joke-collection/img/puppets/aff78998.webp b/site/joke-collection/img/puppets/aff78998.webpnew file mode 100644index 0000000..e05f61dBinary files /dev/null and b/site/joke-collection/img/puppets/aff78998.webp differdiff --git a/site/joke-collection/img/puppets/baked.js b/site/joke-collection/img/puppets/baked.jsindex 23e90d3..b61cf79 100644--- a/site/joke-collection/img/puppets/baked.js+++ b/site/joke-collection/img/puppets/baked.js@@ -1 +1 @@-window.BAKED = {"f0e2b031": "f0e2b031.webp", "124b5f31": "124b5f31.webp", "0d6134f9": "0d6134f9.webp", "a457f521": "a457f521.webp", "d28ec985": "d28ec985.webp", "03c68b5a": "03c68b5a.webp", "ebb471fa": "ebb471fa.webp", "6aa2c9f0": "6aa2c9f0.webp", "7727d770": "7727d770.webp", "b1bba1ca": "b1bba1ca.webp", "b15d03b3": "b15d03b3.webp", "46d33b12": "46d33b12.webp", "ebc38456": "ebc38456.webp", "69e4ff32": "69e4ff32.webp", "a45377e3": "a45377e3.webp", "a3e8b09b": "a3e8b09b.webp", "94308d71": "94308d71.webp", "6aa24676": "6aa24676.webp", "c26aa82e": "c26aa82e.webp", "5814fc79": "5814fc79.webp", "f692b475": "f692b475.webp", "b1676e6c": "b1676e6c.webp", "1a5c60bb": "1a5c60bb.webp", "b445b18f": "b445b18f.webp", "52999469": "52999469.webp", "42025885": "42025885.webp", "5d270884": "5d270884.webp", "abee4c66": "abee4c66.webp", "a3c3fd04": "a3c3fd04.webp", "e9388cee": "e9388cee.webp", "b8df4825": "b8df4825.webp", "5e6a1ad9": "5e6a1ad9.webp", "99012789": "99012789.webp", "13be1416": "13be1416.webp", "0350b307": "0350b307.webp", "1acc237c": "1acc237c.webp", "2dbe309c": "2dbe309c.webp", "b7a25c1a": "b7a25c1a.webp", "f039a696": "f039a696.webp", "0c1d51d0": "0c1d51d0.webp", "5a381261": "5a381261.webp", "5b8192de": "5b8192de.webp", "a8a1631f": "a8a1631f.webp", "c867c2bc": "c867c2bc.webp", "60dc68f7": "60dc68f7.webp", "419ba86b": "419ba86b.webp", "d2f420e7": "d2f420e7.webp", "e1f413c7": "e1f413c7.webp", "ab40532c": "ab40532c.webp", "fb885bbf": "fb885bbf.webp", "85c7ab4d": "85c7ab4d.webp", "c4c607a6": "c4c607a6.webp", "8aba41ce": "8aba41ce.webp", "2f966492": "2f966492.webp", "f0fa69c1": "f0fa69c1.webp", "57f5857f": "57f5857f.webp", "17f77aa8": "17f77aa8.webp", "fc38e90e": "fc38e90e.webp", "bbcbf5cf": "bbcbf5cf.webp", "4c7beb8d": "4c7beb8d.webp", "3efa3000": "3efa3000.webp", "2905b9e3": "2905b9e3.webp", "2f5d3cf3": "2f5d3cf3.webp", "0104ccb2": "0104ccb2.webp", "8fc29343": "8fc29343.webp", "9a4f7476": "9a4f7476.webp", "2c8bb592": "2c8bb592.webp", "d4fbb7e0": "d4fbb7e0.webp", "670aff5c": "670aff5c.webp", "31da6bc7": "31da6bc7.webp", "60d9342c": "60d9342c.webp", "1741e580": "1741e580.webp", "429b48d1": "429b48d1.webp", "96cfe19e": "96cfe19e.webp", "62b75d9c": "62b75d9c.webp", "666f08a0": "666f08a0.webp", "7ffe606e": "7ffe606e.webp", "5622e8b6": "5622e8b6.webp", "7a172edc": "7a172edc.webp", "523ca076": "523ca076.webp", "4d0ca735": "4d0ca735.webp", "d0c32627": "d0c32627.webp", "eacc874b": "eacc874b.webp", "98c1d29b": "98c1d29b.webp", "bdc7df1e": "bdc7df1e.webp", "d820935e": "d820935e.webp", "101c8d3e": "101c8d3e.webp", "4c43f571": "4c43f571.webp", "bd535b5d": "bd535b5d.webp", "ccad6309": "ccad6309.webp", "fe16e4fb": "fe16e4fb.webp", "21e90356": "21e90356.webp", "38ce736c": "38ce736c.webp", "ab2a4457": "ab2a4457.webp", "96b31089": "96b31089.webp", "a8faa710": "a8faa710.webp", "da33b9dd": "da33b9dd.webp", "f892d758": "f892d758.webp", "9b806969": "9b806969.webp", "c5b07bc1": "c5b07bc1.webp", "fed95569": "fed95569.webp", "dc192ce9": "dc192ce9.webp", "8619dfee": "8619dfee.webp", "517198da": "517198da.webp", "a46a1837": "a46a1837.webp", "8700eb94": "8700eb94.webp", "b970efff": "b970efff.webp", "4a50ee8c": "4a50ee8c.webp", "d2ce2072": "d2ce2072.webp", "83d8688f": "83d8688f.webp", "5ac6e9b8": "5ac6e9b8.webp", "61f7188a": "61f7188a.webp", "6342691e": "6342691e.webp", "8e1d92b1": "8e1d92b1.webp", "6863b6d6": "6863b6d6.webp", "8e119cca": "8e119cca.webp", "3b87b70c": "3b87b70c.webp", "76afd053": "76afd053.webp", "c1195262": "c1195262.webp", "4b18dc04": "4b18dc04.webp", "96c9c2e5": "96c9c2e5.webp", "faa47c6e": "faa47c6e.webp", "86dfe479": "86dfe479.webp", "457bac26": "457bac26.webp", "0be490bd": "0be490bd.webp", "2a8fcb2f": "2a8fcb2f.webp", "2b65ee19": "2b65ee19.webp", "8ac27d82": "8ac27d82.webp", "a5b509dd": "a5b509dd.webp", "c37bd40c": "c37bd40c.webp", "db8bd465": "db8bd465.webp", "0d075977": "0d075977.webp", "0b325be5": "0b325be5.webp", "d0358b33": "d0358b33.webp", "fad2fad4": "fad2fad4.webp", "b9eb5366": "b9eb5366.webp", "7b636f93": "7b636f93.webp", "35f370ad": "35f370ad.webp", "ef50fa69": "ef50fa69.webp", "77eca2a4": "77eca2a4.webp", "a76d2da6": "a76d2da6.webp", "481a24b9": "481a24b9.webp", "9516ff56": "9516ff56.webp", "47b17ae4": "47b17ae4.webp", "2107f680": "2107f680.webp", "5a8050ac": "5a8050ac.webp", "66cba9aa": "66cba9aa.webp", "f8ce0638": "f8ce0638.webp", "7c5f2261": "7c5f2261.webp", "ef8c8b3f": "ef8c8b3f.webp", "b1655c07": "b1655c07.webp", "2faf6f05": "2faf6f05.webp", "719512d0": "719512d0.webp", "da6cb2b1": "da6cb2b1.webp", "87552bfd": "87552bfd.webp", "bcd778e8": "bcd778e8.webp", "23240ff2": "23240ff2.webp", "d1d73c37": "d1d73c37.webp", "880975f2": "880975f2.webp", "48128e44": "48128e44.webp", "66aeb1cb": "66aeb1cb.webp", "94bbe1c2": "94bbe1c2.webp", "5b80513f": "5b80513f.webp", "a25d5db4": "a25d5db4.webp", "a0c1131a": "a0c1131a.webp", "83661e80": "83661e80.webp", "b07d7f39": "b07d7f39.webp", "ca2512b4": "ca2512b4.webp", "f264b060": "f264b060.webp", "2e9dd179": "2e9dd179.webp", "a9ec29bd": "a9ec29bd.webp", "f7c9e08a": "f7c9e08a.webp", "cad407e6": "cad407e6.webp", "fbcb25a2": "fbcb25a2.webp", "1abcffee": "1abcffee.webp", "b761ed8e": "b761ed8e.webp", "596baa7d": "596baa7d.webp", "b7aff701": "b7aff701.webp", "fc588798": "fc588798.webp", "d59ca44c": "d59ca44c.webp", "117274d2": "117274d2.webp", "b8bdd67c": "b8bdd67c.webp", "648c7874": "648c7874.webp", "7e2f650b": "7e2f650b.webp", "9a0ee38e": "9a0ee38e.webp", "b4976cb3": "b4976cb3.webp", "92a80549": "92a80549.webp", "e7f49f0f": "e7f49f0f.webp", "08572f45": "08572f45.webp", "4492dd7d": "4492dd7d.webp", "89dcd688": "89dcd688.webp", "911eca8e": "911eca8e.webp", "56fb2456": "56fb2456.webp", "8e53c786": "8e53c786.webp", "2c3542f4": "2c3542f4.webp", "fee8308c": "fee8308c.webp", "d26d2397": "d26d2397.webp", "eae29045": "eae29045.webp", "f48681dd": "f48681dd.webp", "836ff762": "836ff762.webp", "7860beb3": "7860beb3.webp", "d898b982": "d898b982.webp", "1ea0db12": "1ea0db12.webp", "129b62f0": "129b62f0.webp", "f58938d3": "f58938d3.webp", "0286ac75": "0286ac75.webp", "44e93b94": "44e93b94.webp", "88816e54": "88816e54.webp", "3bac069a": "3bac069a.webp", "a83414ca": "a83414ca.webp", "eaf50ec1": "eaf50ec1.webp", "7a6b6779": "7a6b6779.webp"};+window.BAKED = {"f0e2b031": "f0e2b031.webp", "124b5f31": "124b5f31.webp", "0d6134f9": "0d6134f9.webp", "a457f521": "a457f521.webp", "d28ec985": "d28ec985.webp", "03c68b5a": "03c68b5a.webp", "ebb471fa": "ebb471fa.webp", "6aa2c9f0": "6aa2c9f0.webp", "7727d770": "7727d770.webp", "b1bba1ca": "b1bba1ca.webp", "b15d03b3": "b15d03b3.webp", "46d33b12": "46d33b12.webp", "ebc38456": "ebc38456.webp", "69e4ff32": "69e4ff32.webp", "a45377e3": "a45377e3.webp", "a3e8b09b": "a3e8b09b.webp", "94308d71": "94308d71.webp", "6aa24676": "6aa24676.webp", "c26aa82e": "c26aa82e.webp", "5814fc79": "5814fc79.webp", "f692b475": "f692b475.webp", "b1676e6c": "b1676e6c.webp", "1a5c60bb": "1a5c60bb.webp", "b445b18f": "b445b18f.webp", "52999469": "52999469.webp", "42025885": "42025885.webp", "5d270884": "5d270884.webp", "abee4c66": "abee4c66.webp", "a3c3fd04": "a3c3fd04.webp", "e9388cee": "e9388cee.webp", "b8df4825": "b8df4825.webp", "5e6a1ad9": "5e6a1ad9.webp", "99012789": "99012789.webp", "13be1416": "13be1416.webp", "0350b307": "0350b307.webp", "1acc237c": "1acc237c.webp", "2dbe309c": "2dbe309c.webp", "b7a25c1a": "b7a25c1a.webp", "f039a696": "f039a696.webp", "0c1d51d0": "0c1d51d0.webp", "5a381261": "5a381261.webp", "5b8192de": "5b8192de.webp", "a8a1631f": "a8a1631f.webp", "c867c2bc": "c867c2bc.webp", "60dc68f7": "60dc68f7.webp", "419ba86b": "419ba86b.webp", "d2f420e7": "d2f420e7.webp", "e1f413c7": "e1f413c7.webp", "ab40532c": "ab40532c.webp", "fb885bbf": "fb885bbf.webp", "85c7ab4d": "85c7ab4d.webp", "c4c607a6": "c4c607a6.webp", "8aba41ce": "8aba41ce.webp", "2f966492": "2f966492.webp", "f0fa69c1": "f0fa69c1.webp", "57f5857f": "57f5857f.webp", "17f77aa8": "17f77aa8.webp", "fc38e90e": "fc38e90e.webp", "bbcbf5cf": "bbcbf5cf.webp", "4c7beb8d": "4c7beb8d.webp", "3efa3000": "3efa3000.webp", "2905b9e3": "2905b9e3.webp", "2f5d3cf3": "2f5d3cf3.webp", "0104ccb2": "0104ccb2.webp", "8fc29343": "8fc29343.webp", "9a4f7476": "9a4f7476.webp", "2c8bb592": "2c8bb592.webp", "d4fbb7e0": "d4fbb7e0.webp", "670aff5c": "670aff5c.webp", "31da6bc7": "31da6bc7.webp", "60d9342c": "60d9342c.webp", "1741e580": "1741e580.webp", "429b48d1": "429b48d1.webp", "96cfe19e": "96cfe19e.webp", "62b75d9c": "62b75d9c.webp", "666f08a0": "666f08a0.webp", "7ffe606e": "7ffe606e.webp", "5622e8b6": "5622e8b6.webp", "7a172edc": "7a172edc.webp", "523ca076": "523ca076.webp", "4d0ca735": "4d0ca735.webp", "d0c32627": "d0c32627.webp", "eacc874b": "eacc874b.webp", "98c1d29b": "98c1d29b.webp", "bdc7df1e": "bdc7df1e.webp", "d820935e": "d820935e.webp", "101c8d3e": "101c8d3e.webp", "4c43f571": "4c43f571.webp", "bd535b5d": "bd535b5d.webp", "ccad6309": "ccad6309.webp", "fe16e4fb": "fe16e4fb.webp", "21e90356": "21e90356.webp", "38ce736c": "38ce736c.webp", "ab2a4457": "ab2a4457.webp", "96b31089": "96b31089.webp", "a8faa710": "a8faa710.webp", "da33b9dd": "da33b9dd.webp", "f892d758": "f892d758.webp", "9b806969": "9b806969.webp", "c5b07bc1": "c5b07bc1.webp", "fed95569": "fed95569.webp", "dc192ce9": "dc192ce9.webp", "8619dfee": "8619dfee.webp", "517198da": "517198da.webp", "a46a1837": "a46a1837.webp", "8700eb94": "8700eb94.webp", "b970efff": "b970efff.webp", "4a50ee8c": "4a50ee8c.webp", "d2ce2072": "d2ce2072.webp", "83d8688f": "83d8688f.webp", "5ac6e9b8": "5ac6e9b8.webp", "61f7188a": "61f7188a.webp", "6342691e": "6342691e.webp", "8e1d92b1": "8e1d92b1.webp", "6863b6d6": "6863b6d6.webp", "8e119cca": "8e119cca.webp", "3b87b70c": "3b87b70c.webp", "76afd053": "76afd053.webp", "c1195262": "c1195262.webp", "4b18dc04": "4b18dc04.webp", "96c9c2e5": "96c9c2e5.webp", "faa47c6e": "faa47c6e.webp", "86dfe479": "86dfe479.webp", "457bac26": "457bac26.webp", "0be490bd": "0be490bd.webp", "2a8fcb2f": "2a8fcb2f.webp", "2b65ee19": "2b65ee19.webp", "8ac27d82": "8ac27d82.webp", "a5b509dd": "a5b509dd.webp", "c37bd40c": "c37bd40c.webp", "db8bd465": "db8bd465.webp", "0d075977": "0d075977.webp", "0b325be5": "0b325be5.webp", "d0358b33": "d0358b33.webp", "fad2fad4": "fad2fad4.webp", "b9eb5366": "b9eb5366.webp", "7b636f93": "7b636f93.webp", "35f370ad": "35f370ad.webp", "ef50fa69": "ef50fa69.webp", "77eca2a4": "77eca2a4.webp", "a76d2da6": "a76d2da6.webp", "481a24b9": "481a24b9.webp", "9516ff56": "9516ff56.webp", "47b17ae4": "47b17ae4.webp", "2107f680": "2107f680.webp", "5a8050ac": "5a8050ac.webp", "66cba9aa": "66cba9aa.webp", "f8ce0638": "f8ce0638.webp", "7c5f2261": "7c5f2261.webp", "ef8c8b3f": "ef8c8b3f.webp", "b1655c07": "b1655c07.webp", "2faf6f05": "2faf6f05.webp", "719512d0": "719512d0.webp", "da6cb2b1": "da6cb2b1.webp", "87552bfd": "87552bfd.webp", "bcd778e8": "bcd778e8.webp", "23240ff2": "23240ff2.webp", "d1d73c37": "d1d73c37.webp", "880975f2": "880975f2.webp", "48128e44": "48128e44.webp", "66aeb1cb": "66aeb1cb.webp", "94bbe1c2": "94bbe1c2.webp", "5b80513f": "5b80513f.webp", "a25d5db4": "a25d5db4.webp", "a0c1131a": "a0c1131a.webp", "83661e80": "83661e80.webp", "b07d7f39": "b07d7f39.webp", "ca2512b4": "ca2512b4.webp", "f264b060": "f264b060.webp", "2e9dd179": "2e9dd179.webp", "a9ec29bd": "a9ec29bd.webp", "f7c9e08a": "f7c9e08a.webp", "cad407e6": "cad407e6.webp", "fbcb25a2": "fbcb25a2.webp", "1abcffee": "1abcffee.webp", "b761ed8e": "b761ed8e.webp", "596baa7d": "596baa7d.webp", "b7aff701": "b7aff701.webp", "fc588798": "fc588798.webp", "d59ca44c": "d59ca44c.webp", "117274d2": "117274d2.webp", "b8bdd67c": "b8bdd67c.webp", "648c7874": "648c7874.webp", "7e2f650b": "7e2f650b.webp", "9a0ee38e": "9a0ee38e.webp", "b4976cb3": "b4976cb3.webp", "92a80549": "92a80549.webp", "e7f49f0f": "e7f49f0f.webp", "08572f45": "08572f45.webp", "4492dd7d": "4492dd7d.webp", "89dcd688": "89dcd688.webp", "911eca8e": "911eca8e.webp", "56fb2456": "56fb2456.webp", "8e53c786": "8e53c786.webp", "2c3542f4": "2c3542f4.webp", "fee8308c": "fee8308c.webp", "d26d2397": "d26d2397.webp", "eae29045": "eae29045.webp", "f48681dd": "f48681dd.webp", "836ff762": "836ff762.webp", "7860beb3": "7860beb3.webp", "d898b982": "d898b982.webp", "1ea0db12": "1ea0db12.webp", "129b62f0": "129b62f0.webp", "f58938d3": "f58938d3.webp", "0286ac75": "0286ac75.webp", "44e93b94": "44e93b94.webp", "88816e54": "88816e54.webp", "3bac069a": "3bac069a.webp", "a83414ca": "a83414ca.webp", "eaf50ec1": "eaf50ec1.webp", "7a6b6779": "7a6b6779.webp", "bf086947": "bf086947.webp", "db813713": "db813713.webp", "fe15a98f": "fe15a98f.webp", "90137872": "90137872.webp", "4c652102": "4c652102.webp", "e4f44338": "e4f44338.webp", "64646773": "64646773.webp", "be1f0cb7": "be1f0cb7.webp", "6c955f82": "6c955f82.webp", "31de108c": "31de108c.webp", "111ad6f0": "111ad6f0.webp", "7e4ff796": "7e4ff796.webp", "be3f2a65": "be3f2a65.webp", "a75e5aea": "a75e5aea.webp", "c33662b0": "c33662b0.webp", "ffd01988": "ffd01988.webp", "a157bba8": "a157bba8.webp", "cbf10610": "cbf10610.webp", "709f972a": "709f972a.webp", "aff78998": "aff78998.webp", "6303efac": "6303efac.webp", "7338febb": "7338febb.webp", "ec54638d": "ec54638d.webp", "a92694c7": "a92694c7.webp", "5b449065": "5b449065.webp", "96bcd7c9": "96bcd7c9.webp", "2ad2e9bd": "2ad2e9bd.webp", "ca1d9c3d": "ca1d9c3d.webp", "f3fe813a": "f3fe813a.webp", "1c642e56": "1c642e56.webp", "a0579821": "a0579821.webp", "76414f9a": "76414f9a.webp", "214f412a": "214f412a.webp", "a9effc98": "a9effc98.webp", "38d9e24c": "38d9e24c.webp", "4ef77af1": "4ef77af1.webp"};diff --git a/site/joke-collection/img/puppets/be1f0cb7.webp b/site/joke-collection/img/puppets/be1f0cb7.webpnew file mode 100644index 0000000..29b6ca3Binary files /dev/null and b/site/joke-collection/img/puppets/be1f0cb7.webp differdiff --git a/site/joke-collection/img/puppets/be3f2a65.webp b/site/joke-collection/img/puppets/be3f2a65.webpnew file mode 100644index 0000000..2137d1cBinary files /dev/null and b/site/joke-collection/img/puppets/be3f2a65.webp differdiff --git a/site/joke-collection/img/puppets/bf086947.webp b/site/joke-collection/img/puppets/bf086947.webpnew file mode 100644index 0000000..eab94adBinary files /dev/null and b/site/joke-collection/img/puppets/bf086947.webp differdiff --git a/site/joke-collection/img/puppets/c33662b0.webp b/site/joke-collection/img/puppets/c33662b0.webpnew file mode 100644index 0000000..6b32197Binary files /dev/null and b/site/joke-collection/img/puppets/c33662b0.webp differdiff --git a/site/joke-collection/img/puppets/ca1d9c3d.webp b/site/joke-collection/img/puppets/ca1d9c3d.webpnew file mode 100644index 0000000..e907123Binary files /dev/null and b/site/joke-collection/img/puppets/ca1d9c3d.webp differdiff --git a/site/joke-collection/img/puppets/cbf10610.webp b/site/joke-collection/img/puppets/cbf10610.webpnew file mode 100644index 0000000..f790034Binary files /dev/null and b/site/joke-collection/img/puppets/cbf10610.webp differdiff --git a/site/joke-collection/img/puppets/db813713.webp b/site/joke-collection/img/puppets/db813713.webpnew file mode 100644index 0000000..b5712d4Binary files /dev/null and b/site/joke-collection/img/puppets/db813713.webp differdiff --git a/site/joke-collection/img/puppets/e4f44338.webp b/site/joke-collection/img/puppets/e4f44338.webpnew file mode 100644index 0000000..e9b68e1Binary files /dev/null and b/site/joke-collection/img/puppets/e4f44338.webp differdiff --git a/site/joke-collection/img/puppets/ec54638d.webp b/site/joke-collection/img/puppets/ec54638d.webpnew file mode 100644index 0000000..8cc1403Binary files /dev/null and b/site/joke-collection/img/puppets/ec54638d.webp differdiff --git a/site/joke-collection/img/puppets/f3fe813a.webp b/site/joke-collection/img/puppets/f3fe813a.webpnew file mode 100644index 0000000..55e2c8dBinary files /dev/null and b/site/joke-collection/img/puppets/f3fe813a.webp differdiff --git a/site/joke-collection/img/puppets/fe15a98f.webp b/site/joke-collection/img/puppets/fe15a98f.webpnew file mode 100644index 0000000..eb9371aBinary files /dev/null and b/site/joke-collection/img/puppets/fe15a98f.webp differdiff --git a/site/joke-collection/img/puppets/ffd01988.webp b/site/joke-collection/img/puppets/ffd01988.webpnew file mode 100644index 0000000..ec92c11Binary files /dev/null and b/site/joke-collection/img/puppets/ffd01988.webp differdiff --git a/site/joke-collection/img/sets/beach/bg-soft.webp b/site/joke-collection/img/sets/beach/bg-soft.webpnew file mode 100644index 0000000..926f9d3Binary files /dev/null and b/site/joke-collection/img/sets/beach/bg-soft.webp differdiff --git a/site/joke-collection/img/sets/beach/bg.webp b/site/joke-collection/img/sets/beach/bg.webpnew file mode 100644index 0000000..ac46fceBinary files /dev/null and b/site/joke-collection/img/sets/beach/bg.webp differdiff --git a/site/joke-collection/img/sets/harbour/bg-soft.webp b/site/joke-collection/img/sets/harbour/bg-soft.webpnew file mode 100644index 0000000..473fa96Binary files /dev/null and b/site/joke-collection/img/sets/harbour/bg-soft.webp differdiff --git a/site/joke-collection/img/sets/harbour/bg.webp b/site/joke-collection/img/sets/harbour/bg.webpnew file mode 100644index 0000000..1161fa6Binary files /dev/null and b/site/joke-collection/img/sets/harbour/bg.webp differdiff --git a/site/joke-collection/img/sets/harbour/crates-soft.webp b/site/joke-collection/img/sets/harbour/crates-soft.webpnew file mode 100644index 0000000..1da6471Binary files /dev/null and b/site/joke-collection/img/sets/harbour/crates-soft.webp differdiff --git a/site/joke-collection/img/sets/harbour/crates.webp b/site/joke-collection/img/sets/harbour/crates.webpnew file mode 100644index 0000000..706f1dcBinary files /dev/null and b/site/joke-collection/img/sets/harbour/crates.webp differdiff --git a/site/joke-collection/img/sets/sets.js b/site/joke-collection/img/sets/sets.jsindex f111a35..7f60d50 100644--- a/site/joke-collection/img/sets/sets.js+++ b/site/joke-collection/img/sets/sets.js@@ -1 +1 @@-window.SETS = {"town": [{"name": "ground", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "stall": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "rain", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "snow", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "cart", "k": 1, "box": [1010, 386, 470, 414], "soft": true}], "classBack": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "classFront": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "desk", "k": 1, "box": [1020, 568, 400, 337], "soft": true}], "loo": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "street": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "shop": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "counter", "k": 1, "box": [750, 406, 820, 394], "soft": true}], "road": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "road2": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}]};+window.SETS = {"town": [{"name": "ground", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "stall": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "rain", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "snow", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "cart", "k": 1, "box": [1010, 386, 470, 414], "soft": true}], "classBack": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "classFront": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "desk", "k": 1, "box": [1020, 568, 400, 337], "soft": true}], "loo": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "street": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "shop": [{"name": "wall", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "counter", "k": 1, "box": [750, 406, 820, 394], "soft": true}], "road": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "road2": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "harbour": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}, {"name": "crates", "k": 1, "box": [540, 566, 262, 188], "soft": true}], "square": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}], "beach": [{"name": "bg", "k": 1, "box": [-60, -34, 1720, 968], "soft": true}]};diff --git a/site/joke-collection/img/sets/square/bg-soft.webp b/site/joke-collection/img/sets/square/bg-soft.webpnew file mode 100644index 0000000..c64fbd2Binary files /dev/null and b/site/joke-collection/img/sets/square/bg-soft.webp differdiff --git a/site/joke-collection/img/sets/square/bg.webp b/site/joke-collection/img/sets/square/bg.webpnew file mode 100644index 0000000..4d8ab20Binary files /dev/null and b/site/joke-collection/img/sets/square/bg.webp differdiff --git a/site/joke-collection/index.html b/site/joke-collection/index.htmlindex 7281e1c..b12e2ae 100644--- a/site/joke-collection/index.html+++ b/site/joke-collection/index.html@@ -4,7 +4,7 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Joke Collection</title>-<meta name="description" content="Short animated jokes: painted sets from an image model, paper puppets moved by code. Three episodes so far, and how they were made.">+<meta name="description" content="Short animated jokes: painted sets from an image model, paper puppets moved by code. Five episodes so far, and how they were made."><style>:root { --ink: #2f2418; --soft: #6b5a46; --paper: #fbf5e8; --card: #fffaf0; --line: #e4d6bb; --accent: #2f5aa8; --ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif; --serif: "Iowan Old Style", Palatino, Georgia, serif; color-scheme: light; }* { box-sizing: border-box; }@@ -66,6 +66,7 @@<li><a href="ch02/"><span class="thumb"><img src="making/ep2-veggie.webp" width="800" height="450" alt="The customer hears “reji” as “veggie”."></span><small>Episode 2 · 2 minutes</small><b>Do You Need a Bag?</b><span>A convenience store in Fukuoka. A clerk who speaks no English, a customer who speaks no Japanese, and me in line behind them with a hundred-yen coffee. Also true.</span></a></li><li><a href="ch03/"><span class="thumb"><img src="making/ep3-hay.webp" width="800" height="450" alt="The cow walks after hay hung from a rod on its own back."></span><small>Episode 3 · 2 minutes</small><b>How to Move a Cow</b><span>A Chinese man, an Indian man and an American are stuck behind a cow that won’t budge. Each has his own way to make it walk. An old joke, with a newer ending.</span></a></li><li><a href="ch04/"><span class="thumb"><img src="making/ep4-glasses.webp" width="800" height="450" alt="The dog on the desk between Me and Bo, in glasses, a pencil in its mouth."></span><small>Episode 4 · 2 minutes</small><b>The Dog Ate My Homework</b><span>My deskmate Bo never did his homework, but he always had an excuse. Then he rented a dog to prove one. I did my homework every morning, at breakfast.</span></a></li>+ <li><a href="ch05/"><span class="thumb"><img src="making/ep5-photo.webp" width="800" height="450" alt="The man shows the policeman a photo from the zoo, the penguin beside him."></span><small>Episode 5 · 2 minutes</small><b>The Penguin and the Zoo</b><span>A man buys a fish at the harbour, and a penguin follows it. A policeman tells him to take it to the zoo. The next day, there they are again.</span></a></li></ul><p class="soon">More jokes coming.</p>@@ -82,6 +83,8 @@<img src="making/ep4-exhibit.webp" width="800" height="450" alt="Episode 4: Exhibit A, the dog, on the desk in class." loading="lazy"><img src="making/ep4-bites.webp" width="800" height="450" alt="Episode 4: the dog takes a bite out of the wrong homework." loading="lazy"><img src="making/ep4-detention.webp" width="800" height="450" alt="Episode 4: detention in the evening light, two boys and a dog." loading="lazy">+ <img src="making/ep5-harbour.webp" width="800" height="450" alt="Episode 5: the man stops, and the penguin behind him stops half a step late." loading="lazy">+ <img src="making/ep5-beach.webp" width="800" height="450" alt="Episode 5: at the beach, a second penguin eyes the policeman's chips." loading="lazy"></div><h2>Two ways, then a third</h2>@@ -116,12 +119,15 @@<h3>Episode 4, filmed twice</h3><p>The fourth joke was cut right after the first one, then shelved: the story worked, the filming didn't. Every object the jokes hang on (an oil drop, a blank sheet, three bites) was a few pixels in a wide shot, and the main gag played in one locked frame. A review compared it shot by shot with the episodes above, and four agents filmed each scene again: the main scene went from 6 shots to 22, with a close-up for every object a joke needs and a reaction for every joke. Same script, same voices, no new paintings.</p>+ <h3>Episode 5, nobody in the loop</h3>+ <p>For the fifth, the user said only: make one, without me. Claude picked an old joke, and a coordinator ran the rest with agents: one wrote the script and built the harbour, the street, the beach and three new puppets; four filmed a scene each; then a director, two picture reviewers and a sound reviewer watched every scene against the episodes above and sent them back, three rounds in all. The running gag (he stops, the penguin stops half a step late) came out of the first review. Its painting cost $0.18.</p>+<h2>The numbers</h2><div class="numbers">- <div><b>4</b><span>episodes, about 2 minutes each</span></div>- <div><b>~30</b><span>painted pictures</span></div>- <div><b>$0.60</b><span>for all the painting</span></div>- <div><b>9</b><span>painted sets</span></div>+ <div><b>5</b><span>episodes, about 2 minutes each</span></div>+ <div><b>~40</b><span>painted pictures</span></div>+ <div><b>$0.78</b><span>for all the painting</span></div>+ <div><b>12</b><span>painted sets</span></div></div><div class="verdict"><p><b>Why we're keeping this one.</b> The paintings carry the look, the puppets carry the acting, and neither has to do the other's job. The sets and props carry over to the next joke. This is the method we're building the Papermorph Skill's picture books on.</p>diff --git a/site/joke-collection/lib/shared.js b/site/joke-collection/lib/shared.jsindex 6221bff..f5568d7 100644--- a/site/joke-collection/lib/shared.js+++ b/site/joke-collection/lib/shared.js@@ -134,22 +134,30 @@ const dusk = p => { const g = mk('g', { 'pointer-events': 'none' }, p);sfx(beat, at, name, vol): play audio/sfx/<name>.mp3 when the clock of beat `beat` passes `at` in normal playback(seeking past it does not fire it). Pausing holds them; a seek stops them. */const SFX = [], sfxOn = [];-const sfx = (beat, at, name, vol = 1) => SFX.push({ beat, at, name, vol });+const SFX_BED = {}; // file name -> length in s, for long ambience called once (a seek into the middle starts it part-way)+const sfx = (beat, at, name, vol = 1, bed = SFX_BED[name] || 0) => SFX.push({ beat, at, name, vol, bed });let sfxLast = { i: -1, t: 0 };function sfxTick() {const id = BEATS[P.i]?.id, on = P.started && P.playing && !P.waiting && !P.done;// the clock ran on (or stood still, paused) in the same beat; anything else is a seek, a replay or a new scene,// and what was playing belongs to another moment- const same = sfxLast.i === P.i && P.t >= sfxLast.t && P.t - sfxLast.t < .5;+ const same = sfxLast.i === P.i && P.t >= sfxLast.t && P.t - Math.max(0, sfxLast.t) < .5;if (!same) while (sfxOn.length) sfxOn.pop().pause();- if (on && same)- for (const e of SFX) if (e.beat === id && e.at > sfxLast.t && e.at <= P.t) {+ // a scene that has just begun (or begins again) fires its effects from 0 on, those at 0 too; a seek fires nothing it skipped+ const from = same ? sfxLast.t : P.t < .25 ? -1 : P.t;+ const seeked = !same || sfxLast.pend; // pend: a seek that happened while paused, now playing+ if (on)+ for (const e of SFX) if (e.beat === id && (e.at > from && e.at <= P.t || seeked && e.bed && e.at < P.t && P.t < e.at + e.bed)) {const a = new Audio(`audio/sfx/${e.name}.mp3`); a.volume = .5 * e.vol * +(document.getElementById('volume')?.value ?? 1); // effects sit under the voicesa.playbackRate = P.rate || 1;a.play().catch(() => {}); sfxOn.push(a); a.onended = () => sfxOn.splice(sfxOn.indexOf(a), 1);+ if (e.at <= from || e.at > P.t) a.addEventListener('loadedmetadata', () => { a.currentTime = P.t - e.at; }, { once: true }); // a long bed joined mid-way}- for (const a of sfxOn) if (on === a.paused) on ? a.play().catch(() => {}) : a.pause(); // a pause holds them, play resumes- sfxLast = { i: P.i, t: P.t };+ for (const a of sfxOn) { a.playbackRate = P.rate || 1; if (on === a.paused) on ? a.play().catch(() => {}) : a.pause(); } // a pause holds them, play resumes+ sfxLast = { i: P.i, t: on ? P.t : from, pend: !on && (!same || !!sfxLast.pend) };+ // the music follows the playback speed, so the chapter's bgmTick need not re-seek it at 0.75× or 1.5× (BGM is the+ // chapter's own list, when it has one)+ if (typeof BGM !== 'undefined') for (const m of BGM) if (m.a.playbackRate !== (P.rate || 1)) m.a.playbackRate = P.rate || 1;requestAnimationFrame(sfxTick);}addEventListener('load', () => requestAnimationFrame(sfxTick)); // after the chapter's own scripts define BEATSdiff --git a/site/joke-collection/making/ep5-beach.webp b/site/joke-collection/making/ep5-beach.webpnew file mode 100644index 0000000..a7a581dBinary files /dev/null and b/site/joke-collection/making/ep5-beach.webp differdiff --git a/site/joke-collection/making/ep5-harbour.webp b/site/joke-collection/making/ep5-harbour.webpnew file mode 100644index 0000000..2f28501Binary files /dev/null and b/site/joke-collection/making/ep5-harbour.webp differdiff --git a/site/joke-collection/making/ep5-photo.webp b/site/joke-collection/making/ep5-photo.webpnew file mode 100644index 0000000..17cb171Binary files /dev/null and b/site/joke-collection/making/ep5-photo.webp differ