Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

fix(site): Joke Collection episode 3 review round, episode 2 captions

yzr01beda3257b2
diff --git a/site/joke-collection/ch02/audio/en/shots.js b/site/joke-collection/ch02/audio/en/shots.js
index 60470ac..c9caa07 100644
--- a/site/joke-collection/ch02/audio/en/shots.js
+++ b/site/joke-collection/ch02/audio/en/shots.js
@@ -1,7 +1,7 @@
-TIMINGS.scene1 = {"dur": 33.376, "marks": {}, "cues": [[0.102, "Fukuoka."], [1.914, "A convenience store."], [4.141, "I was in line for my usual: a hundred-yen coffee."], [9.932, "In front of me, an American girl was buying a drink."], [13.919, "She spoke no Japanese."], [16.601, "At all."], [18.46, "Reji-bukuro wa go-riy\u014d desu ka? (Do you need a bag?)"], [24.1, "Um\u2026 I'm not vegetarian."], [29.23, "I could have helped."], [31.146, "But this was too good."]], "parts": {"s01": 0, "s02": 8.63, "s03": 18.46, "s04": 21.802, "s05": 27.928}};
-TIMINGS.scene2 = {"dur": 15.474, "marks": {}, "cues": [[0, "\u4e21\u66ff\u306f\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002 (We don't do currency exchange.)"], [6.048, "I'd like to pay by credit card."], [8.868, "\u3042\u3001\u306f\u3044\uff01 (Oh! Yes!)"], [11.09, "\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01 (Thank you very much!)"]], "parts": {"s06": 0, "s07": 4.95, "s08": 8.868, "s09": 11.09}};
-TIMINGS.scene3 = {"dur": 34.548, "marks": {}, "cues": [[1.298, "And this is for you!"], [7.192, "In Japan, nobody tips."], [10.085, "Nobody."], [11.686, "She had no idea what that coin was for."], [15.456, "Ah, she's my friend. She's paying for my coffee too. It's fine."], [27.326, "\u3042\u3063\u3001\u305d\u3046\u3067\u3057\u305f\u304b\uff01 (Oh, I see! Thank you very much!)"]], "parts": {"s10": 0, "s11": 3.59, "s12": 15.456, "s13": 27.326, "hush2": 32.548}};
-TIMINGS.scene4 = {"dur": 13.05, "marks": {}, "cues": [[2.602, "Nobody understood anybody."], [5.182, "Everybody was happy."], [7.344, "And my coffee was free."]], "parts": {"s14": 0, "hush3": 10.05}};
+TIMINGS.scene1 = {"dur": 33.376, "marks": {}, "cues": [[0.102, "Fukuoka.", 2.213], [1.914, "A convenience store.", 4.44], [4.141, "I was in line for my usual: a hundred-yen coffee.", 7.636], [9.932, "In front of me, an American girl was buying a drink.", 14.218], [13.919, "She spoke no Japanese.", 16.9], [16.601, "At all.", 17.473], [18.96, "Reji-bukuro wa go-riy\u014d desu ka? (Do you need a bag?)", 20.97, 1], [24.102, "Um\u2026 I'm not vegetarian.", 27.047], [29.23, "I could have helped.", 31.445], [31.146, "But this was too good.", 32.756]], "parts": {"s01": 0, "s02": 8.63, "s03": 18.46, "s04": 21.802, "s05": 27.928}};
+TIMINGS.scene2 = {"dur": 15.474, "marks": {}, "cues": [[2.3, "\u4e21\u66ff\u306f\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002 (We don't do currency exchange.)", 4.081, 1], [6.05, "I'd like to pay by credit card.", 7.936], [8.968, "\u3042\u3001\u306f\u3044\uff01 (Oh! Yes!)", 10.088, 1], [13.39, "\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01 (Thank you very much!)", 14.971, 1]], "parts": {"s06": 0, "s07": 4.95, "s08": 8.868, "s09": 11.09}};
+TIMINGS.scene3 = {"dur": 34.548, "marks": {}, "cues": [[1.3, "And this is for you!", 2.702], [7.192, "In Japan, nobody tips.", 10.384], [10.085, "Nobody.", 11.985], [11.686, "She had no idea what that coin was for.", 14.447], [18.556, "Ah, she's my friend. She's paying for my coffee too. It's fine.", 26.368, 1], [28.026, "\u3042\u3063\u3001\u305d\u3046\u3067\u3057\u305f\u304b\uff01 (Oh, I see! Thank you very much!)", 31.709, 1]], "parts": {"s10": 0, "s11": 3.59, "s12": 15.456, "s13": 27.326, "hush2": 32.548}};
+TIMINGS.scene4 = {"dur": 13.05, "marks": {}, "cues": [[2.602, "Nobody understood anybody.", 5.481], [5.182, "Everybody was happy.", 7.643], [7.344, "And my coffee was free.", 9.056]], "parts": {"s14": 0, "hush3": 10.05}};
MOUTHS.s02 = [[0.049, "X"], [1.302, "C"], [1.4, "B"], [1.497, "G"], [1.563, "B"], [1.628, "E"], [1.693, "B"], [1.758, "E"], [1.81, "G"], [1.862, "A"], [2.109, "C"], [2.357, "D"], [2.389, "B"], [2.422, "D"], [2.487, "A"], [2.552, "C"], [2.617, "B"], [2.682, "C"], [2.747, "B"], [2.812, "D"], [2.878, "B"], [2.943, "B"], [3.024, "C"], [3.105, "B"], [3.187, "H"], [3.268, "F"], [3.329, "D"], [3.39, "B"], [3.451, "A"], [3.548, "F"], [3.646, "C"], [3.744, "B"], [3.841, "D"], [3.906, "B"], [4.09, "C"], [4.273, "B"], [4.456, "X"], [5.289, "B"], [5.419, "C"], [5.549, "B"], [5.632, "A"], [5.716, "E"], [5.799, "B"], [5.882, "C"], [5.966, "B"], [6.076, "E"], [6.187, "B"], [6.256, "D"], [6.325, "A"], [6.393, "D"], [6.462, "B"], [6.531, "C"], [6.599, "B"], [6.668, "C"], [6.737, "X"], [7.971, "D"], [8.068, "B"], [8.166, "D"], [8.441, "H"], [8.716, "X"]];
MOUTHS.s03 = [[0.049, "X"], [0.521, "D"], [0.656, "C"], [0.792, "D"], [1.134, "D"], [1.252, "D"], [1.393, "D"], [1.553, "C"], [1.712, "D"], [1.818, "C"], [1.924, "D"], [2.474, "X"]];
MOUTHS.s04 = [[0.049, "X"], [2.298, "F"], [2.573, "A"], [2.848, "X"], [3.594, "C"], [3.702, "A"], [3.811, "B"], [3.891, "E"], [3.971, "B"], [4.051, "G"], [4.106, "C"], [4.161, "B"], [4.216, "C"], [4.271, "B"], [4.326, "D"], [4.381, "B"], [4.436, "C"], [4.491, "D"], [4.546, "B"], [4.601, "X"]];
diff --git a/site/joke-collection/ch02/audio/en/timings.js b/site/joke-collection/ch02/audio/en/timings.js
index 77a491f..0a431e2 100644
--- a/site/joke-collection/ch02/audio/en/timings.js
+++ b/site/joke-collection/ch02/audio/en/timings.js
@@ -41,9 +41,10 @@ window.TIMINGS = {
"cues": [
[
0,
- "Reji-bukuro wa go-riy\u014d desu ka? (Do you need a bag?)"
+ "Reji-bukuro wa go-riyō desu ka? (Do you need a bag?)"
]
- ]
+ ],
+ "forced": true
},
"s04": {
"dur": 3.576,
@@ -51,7 +52,7 @@ window.TIMINGS = {
"cues": [
[
0.098,
- "Um\u2026 I'm not vegetarian."
+ "Um… I'm not vegetarian."
]
]
},
@@ -75,9 +76,10 @@ window.TIMINGS = {
"cues": [
[
0,
- "\u4e21\u66ff\u306f\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u3002 (We don't do currency exchange.)"
+ "両替はしておりません。 (We don't do currency exchange.)"
]
- ]
+ ],
+ "forced": true
},
"s07": {
"dur": 2.568,
@@ -95,9 +97,10 @@ window.TIMINGS = {
"cues": [
[
0,
- "\u3042\u3001\u306f\u3044\uff01 (Oh! Yes!)"
+ "あ、はい! (Oh! Yes!)"
]
- ]
+ ],
+ "forced": true
},
"s09": {
"dur": 2.184,
@@ -105,9 +108,10 @@ window.TIMINGS = {
"cues": [
[
0,
- "\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01 (Thank you very much!)"
+ "ありがとうございました! (Thank you very much!)"
]
- ]
+ ],
+ "forced": true
},
"s10": {
"dur": 2.04,
@@ -145,7 +149,8 @@ window.TIMINGS = {
0,
"Ah, she's my friend. She's paying for my coffee too. It's fine."
]
- ]
+ ],
+ "forced": true
},
"s13": {
"dur": 4.272,
@@ -153,9 +158,10 @@ window.TIMINGS = {
"cues": [
[
0,
- "\u3042\u3063\u3001\u305d\u3046\u3067\u3057\u305f\u304b\uff01 (Oh, I see! Thank you very much!)"
+ "あっ、そうでしたか! (Oh, I see! Thank you very much!)"
]
- ]
+ ],
+ "forced": true
},
"s14": {
"dur": 7.2,
diff --git a/site/joke-collection/ch03/audio/bgm/m-s2-standoff.mp3 b/site/joke-collection/ch03/audio/bgm/m-s2-standoff.mp3
new file mode 100644
index 0000000..408e371
Binary files /dev/null and b/site/joke-collection/ch03/audio/bgm/m-s2-standoff.mp3 differ
diff --git a/site/joke-collection/ch03/audio/en/mouths.js b/site/joke-collection/ch03/audio/en/mouths.js
index 26018ef..beb7a57 100644
--- a/site/joke-collection/ch03/audio/en/mouths.js
+++ b/site/joke-collection/ch03/audio/en/mouths.js
@@ -1 +1 @@
-window.MOUTHS = {"s01":[[0.102,"D"],[0.232,"B"],[0.321,"C"],[0.41,"B"],[0.499,"C"],[0.588,"B"],[0.677,"C"],[0.766,"A"],[0.949,"D"],[1.133,"B"],[1.365,"D"],[1.43,"B"],[1.495,"C"],[1.584,"B"],[1.672,"C"],[1.761,"D"],[1.849,"B"],[1.938,"A"],[2.064,"D"],[2.19,"B"],[2.316,"D"],[2.374,"B"],[2.433,"D"],[2.478,"B"],[2.524,"D"],[2.591,"A"],[2.657,"C"],[2.724,"B"],[2.791,"C"],[2.858,"B"],[2.924,"D"],[2.991,"B"],[3.058,"F"],[3.094,"C"],[3.129,"B"],[3.165,"C"],[3.201,"B"],[3.336,"F"],[3.47,"B"],[3.605,"E"],[3.663,"B"],[3.722,"D"],[3.787,"B"],[3.888,"F"],[3.989,"B"],[4.09,"C"],[4.191,"B"],[4.328,"E"],[4.466,"D"],[4.603,"B"],[4.741,"X"],[5.547,"D"],[5.69,"B"],[5.859,"F"],[6.029,"F"],[6.094,"D"],[6.159,"B"],[6.224,"B"],[6.32,"D"],[6.417,"B"],[6.513,"C"],[6.609,"B"],[6.706,"C"],[6.738,"B"],[6.771,"B"],[6.81,"C"],[6.849,"A"],[6.904,"C"],[6.958,"B"],[7.013,"H"],[7.068,"C"],[7.122,"E"],[7.194,"G"],[7.266,"C"],[7.541,"B"],[7.816,"X"]],"s02":[[0.141,"A"],[0.416,"F"],[0.691,"X"]],"s03":[[0.102,"C"],[0.187,"B"],[0.271,"F"],[0.328,"H"],[0.384,"B"],[0.441,"B"],[0.523,"E"],[0.606,"B"],[0.688,"A"],[0.826,"E"],[0.963,"G"],[1.101,"C"],[1.238,"X"],[2.109,"B"],[2.233,"E"],[2.357,"B"],[2.441,"C"],[2.526,"D"],[2.612,"B"],[2.698,"F"],[2.784,"C"],[2.87,"B"],[2.956,"D"],[3.021,"A"],[3.086,"F"],[3.151,"B"],[3.216,"B"],[3.268,"C"],[3.32,"A"],[3.433,"C"],[3.546,"B"],[3.659,"F"],[3.73,"C"],[3.802,"B"],[3.861,"E"],[3.919,"A"],[3.978,"D"],[4.036,"B"],[4.095,"C"],[4.154,"C"],[4.212,"B"],[4.271,"F"],[4.408,"D"],[4.546,"H"],[4.683,"B"],[4.821,"X"]],"s04":[[0.1,"C"],[0.283,"B"],[0.467,"C"],[0.65,"X"],[1.675,"F"],[1.817,"D"],[1.958,"B"],[2.1,"B"],[2.283,"C"],[2.467,"B"],[2.65,"X"]],"s05":[[0.141,"A"],[0.416,"F"],[0.691,"X"]],"s06":[[0.098,"D"],[0.374,"D"],[0.519,"D"],[0.794,"C"],[1.069,"X"]],"s07":[[0.103,"D"],[0.223,"C"],[0.343,"D"],[0.449,"C"],[0.555,"D"],[0.693,"C"],[0.83,"E"],[0.968,"B"],[1.105,"X"],[1.273,"D"],[1.372,"C"],[1.47,"E"],[1.569,"B"],[1.667,"D"],[1.765,"D"],[1.885,"C"],[2.005,"E"],[2.124,"D"],[2.262,"C"],[2.399,"E"],[2.537,"B"],[2.674,"X"]],"s08":[[0.098,"D"],[0.374,"D"],[0.555,"D"],[0.83,"C"],[1.105,"X"]],"s09":[[0.102,"B"],[0.185,"C"],[0.267,"B"],[0.349,"C"],[0.389,"B"],[0.428,"F"],[0.484,"D"],[0.54,"B"],[0.597,"B"],[0.655,"C"],[0.714,"B"],[0.806,"C"],[0.897,"B"],[0.989,"C"],[1.081,"B"],[1.172,"C"],[1.274,"A"],[1.4,"D"],[1.526,"B"],[1.652,"B"],[1.835,"F"],[2.018,"B"],[2.202,"X"],[3.008,"B"],[3.105,"C"],[3.203,"B"],[3.271,"D"],[3.34,"A"],[3.408,"C"],[3.477,"A"],[3.581,"D"],[3.685,"B"],[3.789,"F"],[3.832,"C"],[3.876,"B"],[3.919,"D"],[3.997,"G"],[4.086,"C"],[4.174,"B"],[4.263,"C"],[4.352,"B"],[4.44,"B"],[4.566,"E"],[4.692,"B"],[4.818,"D"],[4.883,"B"],[4.948,"D"],[5.026,"A"],[5.102,"F"],[5.177,"B"],[5.253,"H"],[5.328,"C"],[5.404,"E"],[5.462,"G"],[5.521,"B"],[5.796,"C"],[6.071,"X"]],"s10":[[0.102,"B"],[0.2,"C"],[0.297,"B"],[0.415,"C"],[0.532,"B"],[0.649,"B"],[0.688,"C"],[0.727,"B"],[0.864,"C"],[1.001,"B"],[1.066,"E"],[1.131,"B"],[1.189,"C"],[1.248,"B"],[1.431,"F"],[1.615,"B"],[1.873,"D"],[1.918,"B"],[1.964,"B"],[2.016,"C"],[2.068,"B"],[2.181,"E"],[2.294,"B"],[2.407,"B"],[2.452,"E"],[2.498,"B"],[2.557,"C"],[2.615,"B"],[2.745,"F"],[2.876,"B"],[3.006,"A"],[3.189,"D"],[3.372,"B"],[3.556,"X"]],"s11":[[0.098,"D"],[0.326,"C"],[0.555,"D"],[0.651,"D"],[1.201,"X"],[1.43,"D"],[1.599,"D"],[1.737,"C"],[1.875,"D"],[2.079,"C"],[2.284,"D"],[2.776,"D"],[2.909,"D"],[3.053,"D"],[3.269,"C"],[3.486,"D"],[3.726,"C"],[3.966,"D"],[4.183,"D"],[4.733,"X"]],"s12":[[0.102,"A"],[0.159,"F"],[0.215,"B"],[0.271,"A"],[0.334,"C"],[0.397,"G"],[0.46,"E"],[0.523,"B"],[0.586,"C"],[0.649,"H"],[0.832,"E"],[1.016,"B"],[1.313,"B"],[1.372,"C"],[1.43,"B"],[1.593,"F"],[1.756,"F"],[1.818,"E"],[1.881,"B"],[1.943,"C"],[2.006,"B"],[2.068,"B"],[2.131,"E"],[2.195,"A"],[2.258,"C"],[2.321,"B"],[2.384,"C"],[2.448,"B"],[2.511,"F"],[2.786,"B"],[3.061,"X"],[3.776,"B"],[3.859,"F"],[3.941,"C"],[4.023,"G"],[4.106,"C"],[4.188,"B"],[4.271,"G"],[4.379,"D"],[4.488,"B"],[4.596,"C"],[4.648,"B"],[4.701,"F"],[4.792,"D"],[4.884,"H"],[4.976,"B"],[5.067,"C"],[5.159,"B"],[5.352,"C"],[5.404,"B"],[5.456,"F"],[5.517,"H"],[5.577,"B"],[5.638,"B"],[5.706,"C"],[5.773,"G"],[5.841,"C"],[5.909,"B"],[5.977,"B"],[6.081,"C"],[6.185,"B"],[6.289,"B"],[6.359,"D"],[6.428,"B"],[6.497,"B"],[6.772,"C"],[7.047,"X"]],"s13":[[0.102,"B"],[0.239,"E"],[0.376,"B"],[0.441,"C"],[0.506,"B"],[0.662,"F"],[0.818,"B"],[0.875,"C"],[0.931,"B"],[0.988,"F"],[1.036,"B"],[1.085,"D"],[1.134,"B"],[1.183,"C"],[1.274,"F"],[1.365,"B"],[1.456,"A"],[1.517,"C"],[1.578,"E"],[1.639,"A"],[1.699,"H"],[1.76,"C"],[1.821,"C"],[1.886,"B"],[1.951,"B"],[2.052,"C"],[2.153,"B"],[2.254,"D"],[2.355,"B"],[2.524,"D"],[2.693,"H"],[2.862,"H"],[2.971,"C"],[3.08,"B"],[3.188,"G"],[3.326,"H"],[3.463,"D"],[3.601,"B"],[3.738,"X"]],"s14":[[0.098,"D"],[0.326,"D"],[0.453,"C"],[0.579,"D"],[0.771,"C"],[0.963,"D"],[1.108,"D"],[1.3,"C"],[1.492,"D"],[1.767,"C"],[2.042,"X"],[2.5,"D"],[2.648,"C"],[2.796,"E"],[2.945,"D"],[3.077,"D"],[3.352,"C"],[3.678,"D"],[3.834,"D"],[3.942,"D"],[4.183,"D"],[4.429,"C"],[4.676,"D"],[5.226,"X"]],"s15":[[0.1,"A"],[0.375,"C"],[0.65,"X"]]};
+window.MOUTHS = {"s01":[[0.102,"D"],[0.232,"B"],[0.321,"C"],[0.41,"B"],[0.499,"C"],[0.588,"B"],[0.677,"C"],[0.766,"A"],[0.949,"D"],[1.133,"B"],[1.365,"D"],[1.43,"B"],[1.495,"C"],[1.584,"B"],[1.672,"C"],[1.761,"D"],[1.849,"B"],[1.938,"A"],[2.064,"D"],[2.19,"B"],[2.316,"D"],[2.374,"B"],[2.433,"D"],[2.478,"B"],[2.524,"D"],[2.591,"A"],[2.657,"C"],[2.724,"B"],[2.791,"C"],[2.858,"B"],[2.924,"D"],[2.991,"B"],[3.058,"F"],[3.094,"C"],[3.129,"B"],[3.165,"C"],[3.201,"B"],[3.336,"F"],[3.47,"B"],[3.605,"E"],[3.663,"B"],[3.722,"D"],[3.787,"B"],[3.888,"F"],[3.989,"B"],[4.09,"C"],[4.191,"B"],[4.328,"E"],[4.466,"D"],[4.603,"B"],[4.741,"X"],[5.547,"D"],[5.69,"B"],[5.859,"F"],[6.029,"F"],[6.094,"D"],[6.159,"B"],[6.224,"B"],[6.32,"D"],[6.417,"B"],[6.513,"C"],[6.609,"B"],[6.706,"C"],[6.738,"B"],[6.771,"B"],[6.81,"C"],[6.849,"A"],[6.904,"C"],[6.958,"B"],[7.013,"H"],[7.068,"C"],[7.122,"E"],[7.194,"G"],[7.266,"C"],[7.541,"B"],[7.816,"X"]],"s02":[[0.141,"A"],[0.416,"F"],[0.691,"X"]],"s03":[[0.102,"C"],[0.187,"B"],[0.271,"F"],[0.328,"H"],[0.384,"B"],[0.441,"B"],[0.523,"E"],[0.606,"B"],[0.688,"A"],[0.826,"E"],[0.963,"G"],[1.101,"C"],[1.238,"X"],[2.109,"B"],[2.233,"E"],[2.357,"B"],[2.441,"C"],[2.526,"D"],[2.612,"B"],[2.698,"F"],[2.784,"C"],[2.87,"B"],[2.956,"D"],[3.021,"A"],[3.086,"F"],[3.151,"B"],[3.216,"B"],[3.268,"C"],[3.32,"A"],[3.433,"C"],[3.546,"B"],[3.659,"F"],[3.73,"C"],[3.802,"B"],[3.861,"E"],[3.919,"A"],[3.978,"D"],[4.036,"B"],[4.095,"C"],[4.154,"C"],[4.212,"B"],[4.271,"F"],[4.408,"D"],[4.546,"H"],[4.683,"B"],[4.821,"X"]],"s04":[[0.1,"C"],[0.283,"B"],[0.467,"C"],[0.65,"X"],[1.675,"F"],[1.817,"D"],[1.958,"B"],[2.1,"B"],[2.283,"C"],[2.467,"B"],[2.65,"X"]],"s05":[[0.141,"A"],[0.416,"F"],[0.691,"X"]],"s06":[[0.098,"D"],[0.374,"D"],[0.519,"D"],[0.794,"C"],[1.069,"X"]],"s07":[[0.103,"D"],[0.223,"C"],[0.343,"D"],[0.449,"C"],[0.555,"D"],[0.693,"C"],[0.83,"E"],[0.968,"B"],[1.105,"X"],[1.273,"D"],[1.372,"C"],[1.47,"E"],[1.569,"B"],[1.667,"D"],[1.765,"D"],[1.885,"C"],[2.005,"E"],[2.124,"D"],[2.262,"C"],[2.399,"E"],[2.537,"B"],[2.674,"X"]],"s08":[[0.098,"D"],[0.374,"D"],[0.555,"D"],[0.83,"C"],[1.105,"X"]],"s09":[[0.102,"B"],[0.185,"C"],[0.267,"B"],[0.349,"C"],[0.389,"B"],[0.428,"F"],[0.484,"D"],[0.54,"B"],[0.597,"B"],[0.655,"C"],[0.714,"B"],[0.806,"C"],[0.897,"B"],[0.989,"C"],[1.081,"B"],[1.172,"C"],[1.274,"A"],[1.4,"D"],[1.526,"B"],[1.652,"B"],[1.835,"F"],[2.018,"B"],[2.202,"X"],[3.008,"B"],[3.105,"C"],[3.203,"B"],[3.271,"D"],[3.34,"A"],[3.408,"C"],[3.477,"A"],[3.581,"D"],[3.685,"B"],[3.789,"F"],[3.832,"C"],[3.876,"B"],[3.919,"D"],[3.997,"G"],[4.086,"C"],[4.174,"B"],[4.263,"C"],[4.352,"B"],[4.44,"B"],[4.566,"E"],[4.692,"B"],[4.818,"D"],[4.883,"B"],[4.948,"D"],[5.026,"A"],[5.102,"F"],[5.177,"B"],[5.253,"H"],[5.328,"C"],[5.404,"E"],[5.462,"G"],[5.521,"B"],[5.796,"C"],[6.071,"X"]],"s10":[[0.102,"B"],[0.2,"C"],[0.297,"B"],[0.415,"C"],[0.532,"B"],[0.649,"B"],[0.688,"C"],[0.727,"B"],[0.864,"C"],[1.001,"B"],[1.066,"E"],[1.131,"B"],[1.189,"C"],[1.248,"B"],[1.431,"F"],[1.615,"B"],[1.873,"D"],[1.918,"B"],[1.964,"B"],[2.016,"C"],[2.068,"B"],[2.181,"E"],[2.294,"B"],[2.407,"B"],[2.452,"E"],[2.498,"B"],[2.557,"C"],[2.615,"B"],[2.745,"F"],[2.876,"B"],[3.006,"A"],[3.189,"D"],[3.372,"B"],[3.556,"X"]],"s11":[[0.098,"D"],[0.326,"C"],[0.555,"D"],[0.651,"D"],[1.201,"X"],[1.43,"D"],[1.599,"D"],[1.737,"C"],[1.875,"D"],[2.079,"C"],[2.284,"D"],[2.776,"D"],[2.909,"D"],[3.053,"D"],[3.269,"C"],[3.486,"D"],[3.726,"C"],[3.966,"D"],[4.183,"D"],[4.733,"X"]],"s12":[[0.102,"A"],[0.159,"F"],[0.215,"B"],[0.271,"A"],[0.334,"C"],[0.397,"G"],[0.46,"E"],[0.523,"B"],[0.586,"C"],[0.649,"H"],[0.832,"E"],[1.016,"B"],[1.313,"B"],[1.372,"C"],[1.43,"B"],[1.593,"F"],[1.756,"F"],[1.818,"E"],[1.881,"B"],[1.943,"C"],[2.006,"B"],[2.068,"B"],[2.131,"E"],[2.195,"A"],[2.258,"C"],[2.321,"B"],[2.384,"C"],[2.448,"B"],[2.511,"F"],[2.786,"B"],[3.061,"X"],[3.776,"B"],[3.859,"F"],[3.941,"C"],[4.023,"G"],[4.106,"C"],[4.188,"B"],[4.271,"G"],[4.379,"D"],[4.488,"B"],[4.596,"C"],[4.648,"B"],[4.701,"F"],[4.792,"D"],[4.884,"H"],[4.976,"B"],[5.067,"C"],[5.159,"B"],[5.352,"C"],[5.404,"B"],[5.456,"F"],[5.517,"H"],[5.577,"B"],[5.638,"B"],[5.706,"C"],[5.773,"G"],[5.841,"C"],[5.909,"B"],[5.977,"B"],[6.081,"C"],[6.185,"B"],[6.289,"B"],[6.359,"D"],[6.428,"B"],[6.497,"B"],[6.772,"C"],[7.047,"X"]],"s13":[[0.102,"B"],[0.239,"E"],[0.376,"B"],[0.441,"C"],[0.506,"B"],[0.662,"F"],[0.818,"B"],[0.875,"C"],[0.931,"B"],[0.988,"F"],[1.036,"B"],[1.085,"D"],[1.134,"B"],[1.183,"C"],[1.274,"F"],[1.365,"B"],[1.456,"A"],[1.517,"C"],[1.578,"E"],[1.639,"A"],[1.699,"H"],[1.76,"C"],[1.821,"C"],[1.886,"B"],[1.951,"B"],[2.052,"C"],[2.153,"B"],[2.254,"D"],[2.355,"B"],[2.524,"D"],[2.693,"H"],[2.862,"H"],[2.971,"C"],[3.08,"B"],[3.188,"G"],[3.326,"H"],[3.463,"D"],[3.601,"B"],[3.738,"X"]],"s13b":[[0.102,"H"],[0.25,"C"],[0.397,"B"],[0.545,"G"],[0.646,"H"],[0.747,"D"],[0.848,"B"],[0.948,"A"],[1.057,"C"],[1.165,"B"],[1.274,"C"],[1.333,"F"],[1.391,"B"],[1.513,"E"],[1.634,"A"],[1.756,"B"],[1.847,"D"],[1.938,"B"],[2.029,"C"],[2.12,"B"],[2.211,"B"],[2.257,"C"],[2.303,"B"],[2.413,"D"],[2.523,"B"],[2.633,"E"],[2.743,"B"],[2.853,"X"],[3.685,"B"],[3.828,"E"],[3.971,"A"],[4.046,"E"],[4.121,"B"],[4.196,"C"],[4.271,"E"],[4.349,"G"],[4.428,"C"],[4.507,"B"],[4.585,"C"],[4.664,"A"],[4.742,"C"],[4.821,"X"],[5.091,"B"],[5.189,"E"],[5.286,"A"],[5.358,"E"],[5.43,"B"],[5.501,"C"],[5.573,"B"],[5.659,"D"],[5.745,"B"],[5.831,"C"],[5.917,"B"],[6.003,"G"],[6.063,"E"],[6.124,"B"],[6.185,"D"],[6.25,"A"],[6.311,"B"],[6.372,"E"],[6.433,"A"],[6.494,"E"],[6.556,"B"],[6.617,"C"],[6.678,"E"],[6.739,"B"],[6.8,"X"],[7.786,"C"],[7.884,"F"],[7.982,"B"],[8.09,"F"],[8.199,"B"],[8.307,"H"],[8.392,"C"],[8.477,"B"],[8.66,"F"],[8.843,"B"],[9.027,"X"]],"s14":[[0.098,"D"],[0.326,"D"],[0.453,"C"],[0.579,"D"],[0.771,"C"],[0.963,"D"],[1.108,"D"],[1.3,"C"],[1.492,"D"],[1.767,"C"],[2.042,"X"],[2.5,"D"],[2.648,"C"],[2.796,"E"],[2.945,"D"],[3.077,"D"],[3.352,"C"],[3.678,"D"],[3.834,"D"],[3.942,"D"],[4.183,"D"],[4.429,"C"],[4.676,"D"],[5.226,"X"]],"s15":[[0.1,"A"],[0.375,"C"],[0.65,"X"]]};
diff --git a/site/joke-collection/ch03/audio/en/s13b.mp3 b/site/joke-collection/ch03/audio/en/s13b.mp3
new file mode 100644
index 0000000..67db711
Binary files /dev/null and b/site/joke-collection/ch03/audio/en/s13b.mp3 differ
diff --git a/site/joke-collection/ch03/audio/en/scene4.mp3 b/site/joke-collection/ch03/audio/en/scene4.mp3
index 6d879ab..c129beb 100644
Binary files a/site/joke-collection/ch03/audio/en/scene4.mp3 and b/site/joke-collection/ch03/audio/en/scene4.mp3 differ
diff --git a/site/joke-collection/ch03/audio/en/shots.js b/site/joke-collection/ch03/audio/en/shots.js
index 3dda4b8..916ef0b 100644
--- a/site/joke-collection/ch03/audio/en/shots.js
+++ b/site/joke-collection/ch03/audio/en/shots.js
@@ -1,7 +1,7 @@
-TIMINGS.scene1 = {"dur": 23.234, "marks": {}, "cues": [[0.102, "A Chinese man, an Indian man and an American were stuck on a country road."], [5.547, "A cow was standing in the middle of it."], [8.75, "Moo."], [12.914, "It would not move."], [14.921, "So they argued about the best way to make it walk."], [18.926, "Easy."], [21.501, "Watch this."]], "parts": {"s01": 0, "s02": 8.75, "s03": 12.812, "s04": 18.826}};
-TIMINGS.scene2 = {"dur": 22.312, "marks": {}, "cues": [[0, "MOOO!"], [5.902, "\u8fd9\u662f\u66b4\u529b\uff01 (That's violence!)"], [8.796, "He Gau Mata, kripya aage chaliye. (O Mother Cow, please walk on.)"], [15.866, "\u8fd9\u662f\u8ff7\u4fe1\uff01 (That's superstition!)"]], "parts": {"s05": 0, "s06": 5.902, "s07": 8.796, "s08": 15.866, "hush1": 21.312}};
-TIMINGS.scene3 = {"dur": 30.366, "marks": {}, "cues": [[0.102, "Then it was the Chinese man's turn."], [6.408, "He came back with a fishing rod and a bundle of hay."], [11.068, "He tied the hay to the hook, and the rod to the cow's back."], [17.308, "\u770b\u5230\u4e86\u5417\uff1f\u6211\u6ca1\u6709\u5f3a\u8feb\u5b83\uff0c\u5b83\u662f\u81ea\u613f\u5f80\u524d\u8d70\u7684\uff01 (See? I'm not forcing it. It's walking of its own free will!)"]], "parts": {"s09": 0, "s10": 10.566, "s11": 17.308, "hush2": 27.866}};
-TIMINGS.scene4 = {"dur": 35.94, "marks": {}, "cues": [[2.102, "But before long, the cow worked something out."], [5.776, "However far it walked, it would never reach that hay."], [15.752, "So the cow did what young people in China call \"lying flat.\""], [20.608, "\u4f60\u8fd9\u4e2a\u53ef\u6076\u7684\u5883\u5916\u52bf\u529b\uff01\u662f\u4e0d\u662f\u4f60\u717d\u52a8\u6211\u7684\u725b\u8eba\u5e73\u7684\uff1f (You evil foreign hostile force! Did YOU incite my cow to lie flat?!)"], [30.818, "Me?"]], "parts": {"s12": 0, "s13": 10.15, "s14": 20.608, "s15": 30.218, "hush3": 32.94}};
+TIMINGS.scene1 = {"dur": 23.234, "marks": {}, "cues": [[0.102, "A Chinese man, an Indian man and an American were stuck on a country road.", 5.846], [5.547, "A cow was standing in the middle of it.", 7.794], [9.85, "Moo.", 11.159], [12.914, "It would not move.", 15.22], [14.921, "So they argued about the best way to make it walk.", 17.873], [18.926, "Easy.", 20.325], [21.501, "Watch this.", 22.646]], "parts": {"s01": 0, "s02": 8.75, "s03": 12.812, "s04": 18.826}};
+TIMINGS.scene2 = {"dur": 22.312, "marks": {}, "cues": [[2.7, "MOOO!", 4.276], [6.602, "\u8fd9\u662f\u66b4\u529b\uff01 (That's violence!)", 7.876, 1], [11.896, "He Gau Mata, kripya aage chaliye. (O Mother Cow, please walk on.)", 14.752, 1], [19.166, "\u8fd9\u662f\u8ff7\u4fe1\uff01 (That's superstition!)", 20.417, 1]], "parts": {"s05": 0, "s06": 5.902, "s07": 8.796, "s08": 15.866, "hush1": 21.312}};
+TIMINGS.scene3 = {"dur": 30.366, "marks": {}, "cues": [[0.102, "Then it was the Chinese man's turn.", 2.899], [6.408, "He came back with a fishing rod and a bundle of hay.", 9.578], [11.068, "He tied the hay to the hook, and the rod to the cow's back.", 16.343], [22.408, "\u770b\u5230\u4e86\u5417\uff1f\u6211\u6ca1\u6709\u5f3a\u8feb\u5b83\uff0c\u5b83\u662f\u81ea\u613f\u5f80\u524d\u8d70\u7684\uff01 (See? I'm not forcing it. It's walking of its own free will!)", 26.961, 1]], "parts": {"s09": 0, "s10": 10.566, "s11": 17.308, "hush2": 27.866}};
+TIMINGS.scene4 = {"dur": 47.678, "marks": {}, "cues": [[2.102, "But before long, the cow worked something out.", 6.075], [5.776, "However far it walked, it would never reach that hay.", 9.185], [15.752, "So the cow did what young people in China call \"lying flat.\"", 19.648], [21.01, "Lying flat means you stop chasing the carrot.", 24.892], [24.593, "No more overtime, no more racing for a promotion.", 28.993], [28.694, "You just lie down.", 30.211], [35.946, "\u4f60\u8fd9\u4e2a\u53ef\u6076\u7684\u5883\u5916\u52bf\u529b\uff01\u662f\u4e0d\u662f\u4f60\u717d\u52a8\u6211\u7684\u725b\u8eba\u5e73\u7684\uff1f (You evil foreign hostile force! Did YOU incite my cow to lie flat?!)", 41.037, 1], [42.556, "Me?", 43.368]], "parts": {"s12": 0, "s13": 10.15, "s13b": 20.608, "s14": 32.346, "s15": 41.956, "hush3": 44.678}};
MOUTHS.s02 = [[0.049, "X"], [1.141, "A"], [1.416, "F"], [1.691, "X"]];
MOUTHS.s04 = [[0.1, "C"], [0.283, "B"], [0.467, "C"], [0.65, "X"], [1.199, "X"], [2.675, "F"], [2.817, "D"], [2.958, "B"], [3.1, "B"], [3.283, "C"], [3.467, "B"], [3.65, "X"]];
MOUTHS.s05 = [[0.049, "X"], [2.741, "A"], [3.016, "F"], [3.291, "X"]];
@@ -13,5 +13,6 @@ MOUTHS.s10 = [[0.049, "X"], [0.502, "B"], [0.6, "C"], [0.697, "B"], [0.815, "C"]
MOUTHS.s11 = [[0.049, "X"], [5.098, "D"], [5.326, "C"], [5.555, "D"], [5.651, "D"], [6.201, "X"], [6.43, "D"], [6.599, "D"], [6.737, "C"], [6.875, "D"], [7.079, "C"], [7.284, "D"], [7.776, "D"], [7.909, "D"], [8.053, "D"], [8.269, "C"], [8.486, "D"], [8.726, "C"], [8.966, "D"], [9.183, "D"], [9.733, "X"]];
MOUTHS.s12 = [[0.049, "X"], [2.102, "A"], [2.159, "F"], [2.215, "B"], [2.271, "A"], [2.334, "C"], [2.397, "G"], [2.46, "E"], [2.523, "B"], [2.586, "C"], [2.649, "H"], [2.832, "E"], [3.016, "B"], [3.313, "B"], [3.372, "C"], [3.43, "B"], [3.593, "F"], [3.756, "F"], [3.818, "E"], [3.881, "B"], [3.943, "C"], [4.006, "B"], [4.068, "B"], [4.131, "E"], [4.195, "A"], [4.258, "C"], [4.321, "B"], [4.384, "C"], [4.448, "B"], [4.511, "F"], [4.786, "B"], [5.061, "X"], [5.776, "B"], [5.859, "F"], [5.941, "C"], [6.023, "G"], [6.106, "C"], [6.188, "B"], [6.271, "G"], [6.379, "D"], [6.488, "B"], [6.596, "C"], [6.648, "B"], [6.701, "F"], [6.792, "D"], [6.884, "H"], [6.976, "B"], [7.067, "C"], [7.159, "B"], [7.352, "C"], [7.404, "B"], [7.456, "F"], [7.517, "H"], [7.577, "B"], [7.638, "B"], [7.706, "C"], [7.773, "G"], [7.841, "C"], [7.909, "B"], [7.977, "B"], [8.081, "C"], [8.185, "B"], [8.289, "B"], [8.359, "D"], [8.428, "B"], [8.497, "B"], [8.772, "C"], [9.047, "X"]];
MOUTHS.s13 = [[0.049, "X"], [5.602, "B"], [5.739, "E"], [5.876, "B"], [5.941, "C"], [6.006, "B"], [6.162, "F"], [6.318, "B"], [6.375, "C"], [6.431, "B"], [6.488, "F"], [6.536, "B"], [6.585, "D"], [6.634, "B"], [6.683, "C"], [6.774, "F"], [6.865, "B"], [6.956, "A"], [7.017, "C"], [7.078, "E"], [7.139, "A"], [7.199, "H"], [7.26, "C"], [7.321, "C"], [7.386, "B"], [7.451, "B"], [7.552, "C"], [7.653, "B"], [7.754, "D"], [7.855, "B"], [8.024, "D"], [8.193, "H"], [8.362, "H"], [8.471, "C"], [8.58, "B"], [8.688, "G"], [8.826, "H"], [8.963, "D"], [9.101, "B"], [9.238, "X"]];
+MOUTHS.s13b = [[0.049, "X"], [0.402, "H"], [0.55, "C"], [0.697, "B"], [0.845, "G"], [0.946, "H"], [1.047, "D"], [1.148, "B"], [1.248, "A"], [1.357, "C"], [1.465, "B"], [1.574, "C"], [1.633, "F"], [1.691, "B"], [1.813, "E"], [1.934, "A"], [2.056, "B"], [2.147, "D"], [2.238, "B"], [2.329, "C"], [2.42, "B"], [2.511, "B"], [2.557, "C"], [2.603, "B"], [2.713, "D"], [2.823, "B"], [2.933, "E"], [3.043, "B"], [3.153, "X"], [3.985, "B"], [4.128, "E"], [4.271, "A"], [4.346, "E"], [4.421, "B"], [4.496, "C"], [4.571, "E"], [4.649, "G"], [4.728, "C"], [4.807, "B"], [4.885, "C"], [4.964, "A"], [5.042, "C"], [5.121, "X"], [5.391, "B"], [5.489, "E"], [5.586, "A"], [5.658, "E"], [5.73, "B"], [5.801, "C"], [5.873, "B"], [5.959, "D"], [6.045, "B"], [6.131, "C"], [6.217, "B"], [6.303, "G"], [6.363, "E"], [6.424, "B"], [6.485, "D"], [6.55, "A"], [6.611, "B"], [6.672, "E"], [6.733, "A"], [6.794, "E"], [6.856, "B"], [6.917, "C"], [6.978, "E"], [7.039, "B"], [7.1, "X"], [8.086, "C"], [8.184, "F"], [8.282, "B"], [8.39, "F"], [8.499, "B"], [8.607, "H"], [8.692, "C"], [8.777, "B"], [8.96, "F"], [9.143, "B"], [9.327, "X"], [10.099, "X"]];
MOUTHS.s14 = [[0.049, "X"], [3.598, "D"], [3.826, "D"], [3.953, "C"], [4.079, "D"], [4.271, "C"], [4.463, "D"], [4.608, "D"], [4.8, "C"], [4.992, "D"], [5.267, "C"], [5.542, "X"], [6.0, "D"], [6.148, "C"], [6.296, "E"], [6.445, "D"], [6.577, "D"], [6.852, "C"], [7.178, "D"], [7.334, "D"], [7.442, "D"], [7.683, "D"], [7.929, "C"], [8.176, "D"], [8.726, "X"]];
MOUTHS.s15 = [[0.049, "X"], [0.6, "A"], [0.875, "C"], [1.15, "X"]];
diff --git a/site/joke-collection/ch03/audio/en/timings.js b/site/joke-collection/ch03/audio/en/timings.js
index acc9113..5561157 100644
--- a/site/joke-collection/ch03/audio/en/timings.js
+++ b/site/joke-collection/ch03/audio/en/timings.js
@@ -69,7 +69,8 @@ window.TIMINGS = {
0,
"这是暴力! (That's violence!)"
]
- ]
+ ],
+ "forced": true
},
"s07": {
"dur": 3.72,
@@ -79,7 +80,8 @@ window.TIMINGS = {
0,
"He Gau Mata, kripya aage chaliye. (O Mother Cow, please walk on.)"
]
- ]
+ ],
+ "forced": true
},
"s08": {
"dur": 1.896,
@@ -89,7 +91,8 @@ window.TIMINGS = {
0,
"这是迷信! (That's superstition!)"
]
- ]
+ ],
+ "forced": true
},
"s09": {
"dur": 6.816,
@@ -123,7 +126,8 @@ window.TIMINGS = {
0,
"看到了吗?我没有强迫它,它是自愿往前走的! (See? I'm not forcing it. It's walking of its own free will!)"
]
- ]
+ ],
+ "forced": true
},
"s12": {
"dur": 7.8,
@@ -149,6 +153,24 @@ window.TIMINGS = {
]
]
},
+ "s13b": {
+ "dur": 9.888,
+ "marks": {},
+ "cues": [
+ [
+ 0.102,
+ "Lying flat means you stop chasing the carrot."
+ ],
+ [
+ 3.685,
+ "No more overtime, no more racing for a promotion."
+ ],
+ [
+ 7.786,
+ "You just lie down."
+ ]
+ ]
+ },
"s14": {
"dur": 5.76,
"marks": {},
@@ -157,7 +179,8 @@ window.TIMINGS = {
0,
"你这个可恶的境外势力!是不是你煽动我的牛躺平的? (You evil foreign hostile force! Did YOU incite my cow to lie flat?!)"
]
- ]
+ ],
+ "forced": true
},
"s15": {
"dur": 1.872,
diff --git a/site/joke-collection/ch03/farm.js b/site/joke-collection/ch03/farm.js
index 38eb4cd..921985d 100644
--- a/site/joke-collection/ch03/farm.js
+++ b/site/joke-collection/ch03/farm.js
@@ -61,15 +61,17 @@ function whipLash(parent) {
// dark and thick on a pale edge, so it reads against the fence and the fields at wide-shot scale
const edge = mk('path', { fill: 'none', stroke: '#f6efe0', 'stroke-width': 11, 'stroke-linecap': 'round', opacity: .8 }, parent);
const path = mk('path', { fill: 'none', stroke: '#2e1c10', 'stroke-width': 7, 'stroke-linecap': 'round' }, parent);
- return { pose({ hx = 0, hy = 0, tx = hx + 160, ty = hy + 40, phase = 0, on = true } = {}) {
+ return { els: [edge, path], pose({ hx = 0, hy = 0, tx = hx + 160, ty = hy + 40, phase = 0, on = true, len = 1 } = {}) {
vis(path, on); vis(edge, on); if (!on) return;
let d;
- if (phase <= 0) d = `M${hx},${hy} q10,60 -10,110 q-14,30 4,56`; // hanging
- else if (phase < .6) { const u = phase / .6, bx = hx - 180 * Math.sin(u * Math.PI), by = hy - 120 - 80 * u; // whirled up and back
- d = `M${hx},${hy} Q${hx - 40},${hy - 120} ${bx},${by}`; }
- else { const u = (phase - .6) / .4; // thrown forward: a wave runs down the lash to the crack
- const mx = hx + (tx - hx) * .5, my = hy - 140 * (1 - u) + (ty - hy) * .5 * u;
- d = `M${hx},${hy} Q${mx},${my - 60 * (1 - u)} ${hx + (tx - hx) * (.4 + .6 * u)},${hy + (ty - hy) * (.4 + .6 * u) - 120 * (1 - u)}`; }
+ if (phase <= 0) { const L = len; d = `M${hx},${hy} q${22*L},${-14*L} ${30*L},${18*L} q${8*L},${56*L} ${-6*L},${104*L} q${-6*L},${24*L} ${8*L},${40*L}`; } // hanging
+ else if (phase < .6) { const u = phase / .6, bx = hx - 230 * Math.sin(u * Math.PI), by = hy - 190 - 90 * u; // whirled up and back over the head
+ d = `M${hx},${hy} Q${hx + 30},${hy - 210} ${bx},${by}`; }
+ else { const u = (phase - .6) / .4, e = u ** 1.4; // thrown forward: the tip leaves from above the hand; a wave runs down the lash and it snaps at the target
+ const x0 = hx, y0 = hy - 250, X = x0 + (tx - x0) * e, Y = y0 + (ty - y0) * e, dx = X - hx, dy = Y - hy, n = Math.hypot(dx, dy) || 1,
+ A = 95 * (1 - u) + 20, px = dy / n * A, py = -dx / n * A, f = k => (hx + dx * k).toFixed(1) + ',' + (hy + dy * k).toFixed(1);
+ d = `M${hx},${hy} C${(hx + dx * .3 + px).toFixed(1)},${(hy + dy * .3 + py).toFixed(1)} ${(hx + dx * .7 - px * .7).toFixed(1)},${(hy + dy * .7 - py * .7).toFixed(1)} ${X.toFixed(1)},${Y.toFixed(1)}`;
+ if (u >= 1) d += ' q10,-20 30,-12'; } // the crack: the tip flicks up
if (path._d !== d) { path.setAttribute('d', path._d = d); edge.setAttribute('d', d); }
} };
}
@@ -102,9 +104,10 @@ function cowPuppet(parent) {
<g data-p="rod"><g filter="url(#paper)"><path d="M-60,-288 L${COW_ROD.tip[0]},${COW_ROD.tip[1]}" stroke="#3a2a1a" stroke-width="7" stroke-linecap="round"/>
<path d="M-74,-304 Q-60,-210 -76,-130 M-50,-304 Q-36,-210 -52,-130" stroke="#b08a50" stroke-width="7" fill="none"/><circle cx="-40" cy="-300" r="12" fill="#9aa0a8"/></g></g>
<g data-p="head">
- <g filter="url(#paper)"><path d="M150,-290 C190,-330 230,-300 250,-280 L230,-190 C200,-180 160,-200 150,-230 Z" fill="${C.coat}"/>
+ <g filter="url(#paper)"><path d="M140,-296 C170,-330 205,-345 222,-330 L236,-246 C222,-226 196,-214 168,-210 C150,-208 140,-222 140,-240 Z" fill="${C.coat}"/>
+ <path d="M224,-362 Q212,-388 222,-398 Q228,-374 242,-358 Z" fill="#d6c79e"/>
<path d="M210,-360 Q196,-386 206,-396 Q212,-372 228,-354 Z" fill="${C.horn}"/>
- <path d="M210,-350 C230,-372 268,-370 280,-340 L292,-250 C290,-226 240,-224 220,-250 Z" fill="${C.coat}"/>
+ <path d="M200,-322 C196,-356 226,-376 258,-372 C282,-368 292,-348 294,-322 L300,-262 C298,-238 268,-228 240,-232 C216,-236 204,-262 202,-290 Z" fill="${C.coat}"/>
<path d="M228,-352 C246,-366 264,-360 270,-344 C262,-326 238,-326 228,-352 Z" fill="${C.spot}"/></g>
<g data-p="jaw"><g filter="url(#paper)"><path d="M232,-226 Q262,-214 300,-222 Q296,-198 264,-196 Q238,-200 232,-226 Z" fill="${C.pink}"/></g>
<path d="M248,-212 Q268,-206 288,-212" stroke="#c87070" stroke-width="3" fill="none"/></g>
@@ -123,12 +126,12 @@ function cowPuppet(parent) {
const P = pieces(g);
return { g, pose(o, f) {
o = { ...REST_COW, ...o };
- const j = k => .35 * jit(f >> 1, k), k2 = Math.floor(f / 2) % 2 ? 1 : -1, L = Math.max(0, Math.min(1, o.lie));
+ const j = k => .35 * jit(f >> 1, k), k2 = Math.floor(o.gait ?? f / 2) % 2 ? 1 : -1, L = Math.max(0, Math.min(1, o.lie));
tf(g, `translate(${(o.x + j(1) * .8).toFixed(1)},${(o.y + j(2) * .6).toFixed(1)}) scale(${(o.s * o.dir).toFixed(3)},${o.s})`);
// lying: the legs fold under (shorter, splayed a little), the body sinks onto the ground, the chin goes down
tf(P.all, `translate(0,${(o.bob + 118 * L).toFixed(1)})`);
vis(P.shadow, true);
- const sw = o.walk ? 14 * k2 : 0, fold = 1 - .82 * L;
+ const sw = o.walk ? 14 * k2 * Number(o.walk) : 0, fold = 1 - .82 * L;
const legT = (x, a) => `translate(${x},-150) rotate(${(a + j(4 + x % 7) * .5).toFixed(2)}) scale(1,${fold.toFixed(3)})`;
tf(P.legB1, legT(-120, sw + o.splay)); tf(P.legB2, legT(-96, -sw + o.splay * .6));
tf(P.legF1, legT(120, -sw - o.splay)); tf(P.legF2, legT(144, sw - o.splay * .6));
@@ -159,9 +162,9 @@ function roadSet(p, set = 'road', { amHolds = {}, cnHolds = {} } = {}) {
const cam = paperCam(p, set);
const cow = cowPuppet(cam.stage);
const am = americanPuppet(cam.stage, { holds: { coil: whipCoilSVG, whip: whipHandleSVG, ...amHolds } });
+ const lash = whipLash(cam.stage); // right above the American, below whoever stands in front of him
const cn = chinesePuppet(cam.stage, { holds: { rod: rodHeldSVG, hay: haySVG, ...cnHolds } });
const ind = indianPuppet(cam.stage);
- const lash = whipLash(cam.stage);
return { cam, cow, am, cn, ind, lash };
}
diff --git a/site/joke-collection/ch03/index.html b/site/joke-collection/ch03/index.html
index f45e928..42d6afd 100644
--- a/site/joke-collection/ch03/index.html
+++ b/site/joke-collection/ch03/index.html
@@ -40,17 +40,20 @@ const BEATS = [
/* ---------- 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. Scene 2 is silent (the whip, the prayer, the crickets); the march stops when the cow lies down. */
-const BGM = [['m1-home', ['scene1'], .3], ['m3-chimney', ['scene3', 'scene4'], .22]]
- .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 = { scene4: t => t > (window.S4_STOP ?? 1e9) };
+ speech. Scene 2 has its own track (this folder) that drops out for the crickets after the prayer; the march stops when
+ the cow lies down. */
+const BGM = [['m1-home', ['scene1'], .3], ['audio/bgm/m-s2-standoff', ['scene2'], .27], ['m3-chimney', ['scene3', 'scene4'], .22]]
+ .map(([n, beats, gain]) => ({ n, beats, gain, a: Object.assign(new Audio(`${n.includes('/') ? n : '../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();
+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;
- const speaking = P.audio && !P.audio.paused && !P.audio.ended;
- const vol = +(document.getElementById('volume')?.value ?? 1) * (speaking ? .3 : .7); // the music ducks well under the voices
+ // 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));
diff --git a/site/joke-collection/ch03/scene1.js b/site/joke-collection/ch03/scene1.js
index 9a33ad2..8c503e0 100644
--- a/site/joke-collection/ch03/scene1.js
+++ b/site/joke-collection/ch03/scene1.js
@@ -3,7 +3,7 @@
'use strict';
const PRE1 = 1.0, PREN1 = PRE1;
const N1 = { cowCU: 9.45, wide2: 12.7, amCU: 19.45, hole: clipAt('scene1', PREN1, 's04', 1.2) };
-sfx('scene1', 9.85, 'whoosh', .25);
+sfx('scene1', 9.22, 'whoosh', .25);
// a man shrugs (both arms out, a little bounce) or scratches his head (screen-right arm up, small scrubbing)
const s1shrug = (q, t0) => { const u = span(q, t0, t0 + .25) * (1 - span(q, t0 + .7, t0 + 1)); return { armL: 55 * u, armR: 55 * u, headR: 5 * u, bob: -3 * u }; };
@@ -13,7 +13,7 @@ function scene1(p, D) {
const R = roadSet(p, 'road');
const cam = R.cam;
// 1.1 wide 1.2 cow close-up 1.3 wide 1.4 American close-up
- cam.cut(FARM_WIDE, 0).cut(FCU.cow, N1.cowCU).soft(N1.cowCU, true).cut(FARM_WIDE, N1.wide2).soft(N1.wide2, false)
+ cam.cut(FARM_WIDE, 0).to({ x: 1150, y: 540, z: 1.75 }, N1.cowCU - .25, .22).cut(FCU.cow, N1.cowCU).soft(N1.cowCU, true).cut(FARM_WIDE, N1.wide2).soft(N1.wide2, false)
.cut({ x: 320, y: 540, z: 2.3 }, N1.amCU).soft(N1.amCU, true);
const b = (q, ...t) => blinking(q, t);
stopClock(D, (q, f) => {
@@ -25,7 +25,7 @@ function scene1(p, D) {
const look = tween(q, 8.2, .8, 0, 1) - tween(q, 10.9, .6, 0, 1) * 0; // 0 = forward
const turn = span(q, 8.3, 9.3) * (1 - span(q, 11.2, 12)); // eye + head swing toward the men
const moo = sp !== 'X' && sp !== undefined;
- const mouthy = q > 9.9 && q < 11.5 ? (sp !== 'X' ? .9 : 0) : (Math.floor(q * 6) % 2 ? .22 : .04) * (turn > .5 && q < 11.2 ? 0 : 1);
+ const mouthy = q >= 11.09 && q < 11.92 ? .9 : (Math.floor(q * 6) % 2 ? .22 : .04) * (turn > .5 && q < 11.2 ? 0 : 1);
R.cow.pose({ ...FARM.cow, jaw: mouthy, eyeX: 1 - 2 * turn, headR: -3 + 5 * turn, ear: 8 * Math.sin(q * 3.1) * (q % 4 < 1 ? 1 : .2),
tail: 14 * Math.sin(q * 2.4) + 8 * Math.sin(q * 5.3), shut: b(q, 2.2, 5.6, 7.7, 12.4, 15.5, 20.1), lids: turn * .25 }, f);
@@ -35,6 +35,15 @@ function scene1(p, D) {
const am = { ...base, x: FARM.am, look: .55, shut: b(q, 3.4, 8.8, 14.6, 17.4), ...nod(clipAt('scene1', PREN1, 's01', 2.52)) };
const cn = { ...base, x: FARM.cn, look: .55, shut: b(q, 2.1, 7.1, 13.3, 16.2), ...nod(clipAt('scene1', PREN1, 's01', .23)) };
const ind = { ...base, x: FARM.ind, look: .55, shut: b(q, 4.6, 6.4, 11.9, 17.9), ...nod(clipAt('scene1', PREN1, 's01', 1.5)) };
+ if (q < N1.cowCU) { // arms tucked in; now and then a glance at the cow or a neighbour
+ [am, cn, ind].forEach(m => { m.armL = -6; m.armR = -6; });
+ const g = (a, b) => q >= a && q < b;
+ if (g(1.6, 2.6)) { cn.eyeX = 1; cn.look = .8; }
+ if (g(3.0, 4.0)) { cn.eyeX = -1; cn.look = -.6; ind.eyeX = -1; ind.look = -.6; }
+ if (g(4.2, 5.2)) { am.eyeX = 1; am.look = .8; }
+ if (g(6.2, 7.2)) { ind.eyeX = 1; ind.look = .9; cn.eyeX = 1; cn.look = .9; }
+ if (g(7.6, 8.4)) { am.eyeX = 1; am.look = .8; am.armR = 6; }
+ }
if (q > 3.6 && q < 8.0) { cn.eyeX = 1; if (q > 5.6) { ind.brow = .3; } }
// 1.2: they turn to look at the cow's eye, a flinch when it moos
if (q >= 8.6 && q < 12.7) { cn.brow = .4; ind.brow = .4; am.brow = .3; if (q > 9.9 && q < 11) { cn.headR = -3; am.headR = -3; ind.headR = -3; } }
@@ -60,13 +69,16 @@ function scene1(p, D) {
const easy = lips(q, 'scene1', PREN1, 's04');
const aCU = { ...am, look: 0, eyeX: 0, shut: b(q, N1.amCU + 1.3, N1.hole + 1.6), brow: 0, lids: .1,
mouth: q < N1.hole - .1 ? (easy !== 'X' ? easy : 'grin') : (q > N1.hole + 1 && easy === 'X' ? 'grin' : easy !== 'X' ? easy : 'smile'),
- armR: 10 + 22 * draw, headR: 2 * Math.sin(Math.min(1, t) * 3) * (1 - draw), hold: draw < .55 ? 'coil' : 'whip' };
+ armR: 10 + 12 * draw + (q > 21.5 && q < 22.6 ? 5 * Math.sin((q - 21.5) * 22) : 0), headR: 2 * Math.sin(Math.min(1, t) * 3) * (1 - draw), hold: draw < .55 ? 'coil' : 'whip' };
+ // D: the Chinese man turns to the American, doubtful on "Watch this."
+ if (cuAm) Object.assign(cn, { look: -.6, eyeX: -1, brow: q > 21.4 ? -.3 : 0 });
+ if (R.fwd !== cuAm) { R.fwd = cuAm; [R.am.g, ...R.lash.els].forEach(e => cuAm ? cam.stage.appendChild(e) : cam.stage.insertBefore(e, R.cn.g)); } // close-up: he stands in front of the Chinese man
const wasAm = cuAm ? aCU : am;
if (cuAm) wasAm.eyeX = q < N1.hole ? 1 : 0.6;
R.am.pose(q < N1.amCU ? { ...am, hold: 'coil', armR: am.armR ?? 6 } : wasAm, f);
R.cn.pose(cn, f); R.ind.pose(ind, f);
const pose = q < N1.amCU ? { ...am, hold: 'coil', armR: am.armR ?? 6 } : wasAm;
const [hx, hy] = handAt(R.am, pose, 'R');
- R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase: -1, on: pose.hold === 'whip' });
+ R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase: -1, on: pose.hold === 'whip', len: Math.min(1, .25 + span(q, 21.4, 21.65) * .75) });
});
}
diff --git a/site/joke-collection/ch03/scene2.js b/site/joke-collection/ch03/scene2.js
index 1e742c4..5e1e596 100644
--- a/site/joke-collection/ch03/scene2.js
+++ b/site/joke-collection/ch03/scene2.js
@@ -11,7 +11,9 @@ const T2 = {
crack: 2.9, // the lash lands on the rump (the snap is 0.16 s into the sample)
cowCU: 3.1, // cut to the cow mid-jump
cnCU: clipAt('scene2', PRE2, 's06') - .05, // the Chinese man's close-up, just before his line
- amCU: clipAt('scene2', PRE2, 's06', 2.4), // after the line: the American shrinks
+ amCU: clipAt('scene2', PRE2, 's06', 1.85), // just after the line: the American shrinks (held ~1.25 s)
+ mooA: 3.46, mooB: 4.5, // the MOOO! as heard (scene2.mp3 2.98-3.98 s, plus PRE2)
+ prayCU: clipAt('scene2', PRE2, 's07', 2.7), prayEnd: clipAt('scene2', PRE2, 's07', 5.6), // medium shot: the Indian man and the cow
wide: clipAt('scene2', PRE2, 's07') + .2, // wide: back to the road (the Indian man is mid-walk, the American heads back)
pray: clipAt('scene2', PRE2, 's07', 3.0), // the Hindi starts here; his palms are together a moment before
peek: clipAt('scene2', PRE2, 's07', 7.2), // silence: close-up on the Indian man, he opens an eye
@@ -20,34 +22,47 @@ const T2 = {
sfx('scene2', T2.crack - .16, 'crack');
sfx('scene2', T2.crack + .35, 'thud', .6); // the cow lands
sfx('scene2', clipAt('scene2', PRE2, 's08', .1), 'crickets'); // the silence after the prayer
+window.S2_HUSH = clipAt('scene2', PRE2, 's08') - .7; // the music fades out (0.8 s) into that silence
function scene2(p, D) {
const R = roadSet(p, 'road'), cam = R.cam;
// cow CU keeps the rump in; the American's CU is centred on where he stands at the cow's rear
- const cuAm = { x: 620, y: 470, z: 2.4 }, cuCn = { x: 520, y: 470, z: 2.5 }, cuCow = { x: 1150, y: 520, z: 2.4 }, cuInd = { x: 1290, y: 500, z: 2.6 };
+ // two-shot: the Chinese man points at the American (who stands at AM2); the Indian man is out of frame right
+ const cuAm = { x: 540, y: 480, z: 3.4 }, cuTwo = { x: 380, y: 480, z: 2.3 }, cuCow = { x: 1240, y: 520, z: 2.4 }, cuInd = { x: 1290, y: 500, z: 2.6 }, cuPray = { x: 1150, y: 520, z: 2 };
cam.cut(FARM_WIDE, 0).cut(cuCow, T2.cowCU).soft(T2.cowCU, true).shake(T2.crack, .3, 6)
- .cut(cuCn, T2.cnCU).cut(cuAm, T2.amCU).cut(FARM_WIDE, T2.wide).soft(T2.wide, false)
- .cut(cuInd, T2.peek).soft(T2.peek, true).cut(cuCn, T2.cn2);
- cam.stage.insertBefore(R.cn.g, R.am.g); cam.stage.insertBefore(R.ind.g, R.am.g); // the American walks in front of the others
+ .cut(cuTwo, T2.cnCU).cut(cuAm, T2.amCU).cut(FARM_WIDE, T2.wide).soft(T2.wide, false)
+ .cut(cuPray, T2.prayCU).soft(T2.prayCU, true).cut(FARM_WIDE, T2.prayEnd).soft(T2.prayEnd, false)
+ .cut(cuInd, T2.peek).soft(T2.peek, true).cut({ x: 470, y: 470, z: 2.5 }, T2.cn2);
+ // the American walks behind the others (the kit's own order), his whip behind him: faces stay clear, the lash never crosses his hat
+ cam.stage.insertBefore(R.lash.els[0], R.am.g); cam.stage.insertBefore(R.lash.els[1], R.am.g); cam.stage.insertBefore(R.ind.g, R.lash.els[0]);
+ // a lid for the Indian man's right eye alone (the kit's lids close both): the peek
+ R.ind.g.querySelector('.mouth').insertAdjacentHTML('beforebegin', '<g class="s2lid"><ellipse cx="22" cy="-366" rx="21" ry="25" fill="#b57c52"/><path d="M3,-362 Q22,-352 41,-362" fill="none" stroke="#171313" stroke-width="3"/></g>');
+ const s2lid = R.ind.g.querySelector('.s2lid');
const s2hit = prop(cam.stage, '<g filter="url(#paper)" stroke-linecap="round"><path d="M-8,-62 L-4,-30 M30,-52 L14,-24 M52,-10 L22,-4 M-50,-44 L-26,-22 M44,30 L20,16" stroke="#fff6c8" stroke-width="9"/><path d="M0,-48 L0,-26 M26,-34 L14,-18 M-34,-30 L-18,-16" stroke="#f2c230" stroke-width="6"/></g>');
- const amX = q => q < 1.9 ? tween(q, 0, 1.9, FARM.am, 620) : q < T2.wide ? 620 : tween(q, T2.wide, 3.0, 620, FARM.am);
- const indX = q => tween(q, T2.wide, 2.3, 1000, 1460); // already rounding the cow's flank when the wide returns
+ // the American walks to AM2 (crack from further back, so the lash reaches the rump at full length); the Chinese man steps
+ // aside only after he has passed, the Indian man makes room, then wanders round the cow (unseen in the cow and two-shot
+ // close-ups) and arrives at its front at 1460 as the prayer begins; on the way back the Chinese man goes first
+ const AM2 = 540, CN2 = 200, IND1 = 380, IND2 = 820, ARR = T2.wide + 2.3, WALK0 = 6.3;
+ const amX = q => q < 2.3 ? tween(q, 0, 2.3, FARM.am, AM2) : q < T2.wide + .7 ? AM2 : tween(q, T2.wide + .7, 2.2, AM2, FARM.am);
+ const cnX = q => q < 1.7 ? FARM.cn : q < T2.wide ? tween(q, 1.7, 1.0, FARM.cn, CN2) : tween(q, T2.wide, 1.0, CN2, FARM.cn);
+ // the Indian man crosses behind the others to 400 (left of the American, out of the lash's way), and slips back to 820 while the cow close-up and then the two-shot hide him
+ const indX = q => q < 1.0 ? FARM.ind : q < 1.9 ? tween(q, 1.0, .9, FARM.ind, IND1) : q < 3.2 ? IND1 : q < 6.2 ? tween(q, 3.2, 3.0, IND1, IND2) : q < WALK0 ? IND2 : IND2 + (1460 - IND2) * span(q, WALK0, ARR);
+ const indY = q => FARM.ground - 10 + 10 * span(q, WALK0, ARR) + 40 * Math.sin(Math.PI * Math.max(0, Math.min(1, (q - WALK0) / (ARR - WALK0))));
stopClock(D, (q, f) => {
cam.apply(q, f);
- const wk = spWalk(q), at = (a, b) => q >= a && q < b;
+ const wk = fn => s3walk(fn(q), 1, Math.sign(fn(q) - fn(q - .1)) || 1), mv = fn => Math.abs(fn(q) - fn(q - .1)) > .4,
+ dI = Math.sign(indX(q) - indX(q - .1)) || 1, wkA = wk(amX), wkC = wk(cnX), wkI = wk(indX), at = (a, b) => q >= a && q < b, mvA = mv(amX), mvC = mv(cnX), mvI = mv(indX);
/* --- the cow: stands chewing; jumps at the crack; lands, stares back; later sniffs the Indian man --- */
const jump = at(T2.crack, T2.crack + .6) ? Math.sin(Math.PI * (q - T2.crack) / .6) : 0; // up and down, 0.6 s
const cow = { ...FARM.cow, x: FARM.cow.x + (at(T2.crack, T2.crack + .17) ? 16 : 0), y: FARM.cow.y - 70 * jump, splay: 22 * jump, jaw: .12 * onTwos(q) * (q < T2.crack ? 1 : 0), tail: 6 * onTwos(q), eyeX: 1,
shut: blinking(q, [1.2, 7.4, 11.7, 17.5]) };
- if (q >= T2.crack) { Object.assign(cow, { lids: 0, shut: false, ear: 18, tail: 40, brow: q > T2.crack + 1 ? 1 : 0, eyeX: q > T2.crack + .8 ? -1 : 0, headR: tween(q, T2.crack, .3, 0, 12) });
+ if (q >= T2.crack) { Object.assign(cow, { lids: 0, shut: false, ear: 18, tail: q < T2.crack + .6 ? 28 : 40, brow: q > T2.crack + 1 ? 1 : 0, eyeX: q > T2.crack + .8 ? -1 : 0, headR: tween(q, T2.crack, .3, 0, 12) });
if (q > T2.crack + .6) cow.headR = tween(q, T2.crack + .6, .5, 12, 0); }
if (q >= T2.crack && q < T2.wide) {
- const m = lips(q, 'scene2', PRE2, 's05');
- cow.jaw = m !== 'X' ? .9 : 0;
- if (q > T2.crack + 1.2 && m === 'X') cow.jaw = .1 * onTwos(q);
+ cow.jaw = at(T2.mooA, T2.mooB) ? .9 : q >= T2.mooB ? .1 * onTwos(q) : 0; // open at the sound's onset, held until it ends
if (q > T2.crack + 1.4) { cow.tail = 10 + 22 * (onTwos(q) > 0 ? 1 : 0); cow.ear = 6 * onTwos(q); }
}
if (q >= T2.wide) { // the Indian man arrives at 12.0: the cow lowers its head, sniffs, blinks, chews
@@ -61,59 +76,57 @@ function scene2(p, D) {
/* --- the American: strides to the rear, whirls and cracks; shrinks; walks back to 300 --- */
const phase = q < 1.9 ? -1 : q < T2.crack ? Math.min(.999, q < 2.45 ? .6 * (q - 1.9) / .55 : .6 + .4 * (q - 2.45) / (T2.crack - 2.45)) : q < T2.crack + .17 ? 1 : -1;
- const walking = q < 2.0 || q >= T2.wide;
const sad = at(T2.crack + .5, T2.wide + .05);
- const am = { x: amX(q), y: FARM.ground + 20 * (q < 1.9 ? span(q, 0, 1) : q < T2.wide ? 1 : 1 - span(q, T2.wide, T2.wide + 3)), s: FARM.s, hold: 'whip', look: .6, eyeX: 1, mouth: 'smile', shut: blinking(q, [1.7, 5.3, 9.0, 13.2, 15.7]),
- armR: q < 2.0 ? 90 : 20 };
- if (walking) Object.assign(am, { legL: wk.legL, legR: wk.legR, bob: wk.bob, armL: wk.armL });
- if (walking && q < 2.0) am.armR = 90 + wk.armR; // the whip arm is cocked, half up, as he strides
+ const am = { x: amX(q), y: FARM.ground, s: FARM.s, hold: q < T2.crack + .5 ? 'whip' : 'coil', look: .6, eyeX: 1, mouth: 'smile', shut: blinking(q, [1.7, 5.3, 9.0, 13.2, 15.7]),
+ armR: q < 1.9 ? 90 : 20 };
+ if (mvA) Object.assign(am, { legL: wkA.legL, legR: wkA.legR, bob: wkA.bob, armL: wkA.armL });
+ if (q < 1.9) am.armR = tween(q, 0, .6, 22, 90) + (mvA ? wkA.armR * span(q, .2, .8) : 0); // scene 1 ends with the whip hanging at his hip (armR 22); the arm cocks, half up, as he strides
if (q >= 1.9 && q < T2.crack + .17) am.armR = phase < .6 ? tween(phase, 0, .6, 90, 150) : tween(phase, .6, .4, 150, 60);
if (q >= T2.crack + .17 && q < T2.crack + .5) am.armR = tween(q, T2.crack + .17, .33, 60, 20);
if (q >= T2.crack) am.mouth = 'smile';
if (sad) Object.assign(am, { mouth: 'frown', brow: 1, squash: .1 * span(q, T2.crack + 1.5, T2.amCU + .5), headR: -4, look: q < T2.wide ? -.3 : .5, eyeX: -.6, lids: .3, armR: 8 });
if (q >= T2.cnCU && q < T2.wide) am.look = -.4; // watching the Chinese man
- if (q >= T2.wide) Object.assign(am, { look: -.9, eyeX: -1, mouth: 'flat', brow: .6, squash: 0, headR: 0, armR: 4 + wk.armR });
- if (q >= T2.wide + 3.0) Object.assign(am, { look: .5, eyeX: 1, ...(({ legL, legR, bob }) => ({ legL: 0, legR: 0, bob: 0, armL: 0, armR: 6 }))(wk) });
+ if (q >= T2.wide) Object.assign(am, { look: -.9, eyeX: -1, mouth: 'flat', brow: .6, squash: 0, headR: 0, armR: mvA ? 4 + wkA.armR : 6 });
+ if (q >= T2.wide + .7 && !mvA) Object.assign(am, { look: .5, eyeX: 1, legL: 0, legR: 0, bob: 0, armL: 0, armR: -18 }); // home at 300; the coil rests in front of him, clear of the Chinese man's hand
R.am.pose(am, f);
const [hx, hy] = handAt(R.am, am, 'R');
- R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase, on: q >= 1.9 && q < T2.wide + 3.1, tx: 900, ty: 560 });
+ R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase, on: q < T2.cowCU, tx: 900, ty: 560 });
// a paper impact mark on the rump for 3 frames from the crack
vis(s2hit, at(T2.crack, T2.crack + .25)); tf(s2hit, `translate(900,560) scale(${(1 + .2 * onTwos(q)).toFixed(2)})`);
/* --- the Chinese man: watches, points and says "violence"; later "superstition" --- */
- const cn = { x: FARM.cn, y: FARM.ground, s: FARM.s, mouth: 'X', look: .6, eyeX: 1, brow: 0, shut: blinking(q, [1.0, 4.6, 8.0, 12.6, 15.0, 18.4]) };
+ const cn = { x: cnX(q), y: FARM.ground, s: FARM.s, mouth: 'X', look: .6, eyeX: 1, brow: 0, shut: blinking(q, [1.0, 4.6, 8.0, 12.6, 15.0, 18.4]) };
if (q > 5.0 && q < T2.cnCU + .5) Object.assign(cn, { brow: -1, mouth: 'flat' });
if (at(T2.cnCU, T2.amCU)) Object.assign(cn, { look: .5, eyeX: 1, brow: -1, mouth: lips(q, 'scene2', PRE2, 's06') === 'X' ? 'frown' : lips(q, 'scene2', PRE2, 's06'),
armR: tween(q, T2.cnCU, .4, 0, 88) + 3 * onTwos(q), headR: -3 + 2 * onTwos(q) });
- if (at(T2.amCU, T2.wide)) Object.assign(cn, { look: .5, brow: -.5, armR: 88, mouth: 'frown' });
- if (q >= T2.wide) Object.assign(cn, { look: .7, eyeX: 1, armR: tween(q, T2.wide, .6, 88, 0), mouth: 'flat', brow: -.5 });
+ if (at(T2.amCU, T2.wide)) Object.assign(cn, { look: .5, brow: -.5, armR: tween(q, T2.amCU, .4, 88, 40), mouth: 'frown' });
+ if (q >= T2.wide) Object.assign(cn, { look: .7, eyeX: 1, armR: tween(q, T2.wide, .6, 40, 0), mouth: 'flat', brow: -.5 });
if (q >= T2.cn2 - .4) { // shaking his head, pointing across at the Indian man
const sh = q >= T2.cn2 ? Math.sin((q - T2.cn2) * 9) * 6 : 0;
Object.assign(cn, { look: .7 + .1 * Math.sin((q - T2.cn2) * 9), eyeX: 1, brow: -1, armR: tween(q, T2.cn2 - .3, .35, 0, 90), headR: sh,
mouth: lips(q, 'scene2', PRE2, 's08') === 'X' ? (q > clipAt('scene2', PRE2, 's08', 5.2) ? 'flat' : 'frown') : lips(q, 'scene2', PRE2, 's08') });
if (q >= clipAt('scene2', PRE2, 's08', 5.3)) Object.assign(cn, { headR: 0, look: .7, brow: -.6 }); // the beat: arm still out, jaw set
}
+ if (mvC) Object.assign(cn, { legL: wkC.legL, legR: wkC.legR, bob: wkC.bob, ...(q < T2.wide ? { armL: wkC.armL, armR: wkC.armR, look: -.4, eyeX: -1 } : { armL: wkC.armL }) });
R.cn.pose(cn, f);
/* --- the Indian man: listens; rounds the cow; prays; opens an eye --- */
- const ind = { x: FARM.ind, y: FARM.ground, s: FARM.s, look: -.5, eyeX: -1, mouth: 'flat', shut: blinking(q, [1.5, 5.8, 8.6]) };
- if (q >= T2.wide) {
- const arr = T2.wide + 2.3, walk = q < arr;
- // round the cow's front: from behind-the-flank (y 620) down toward us and back up to the ground line
- const yy = FARM.ground + 40 * Math.sin(Math.PI * Math.min(1, (q - T2.wide) / 2.3));
- Object.assign(ind, { x: indX(q), y: yy, look: walk ? 1 : -.8, eyeX: walk ? 1 : -1, ...(walk ? wk : { legL: 0, legR: 0, bob: 0 }) });
- if (walk) { ind.armR = wk.armR; ind.armL = wk.armL; }
- else {
- const turn = span(q, arr, arr + .5), palms = span(q, arr + .3, arr + .8);
- ind.look = -.8 * turn; ind.armL = ind.armR = -115 * palms;
- ind.shut = q > arr + .7; ind.mouth = q >= T2.pray - .1 ? ((lips(q, 'scene2', PRE2, 's07') === 'X') ? 'flat' : lips(q, 'scene2', PRE2, 's07')) : 'flat';
- ind.brow = .3; ind.headR = q > T2.pray ? 3 * Math.sin(q * 2) : 0;
- // the silence: a peek with one eye (shut -> lids .6 looking at the cow), then a full look
- if (q >= T2.peek + .5) { ind.shut = false; ind.lids = q < T2.peek + 1.5 ? .6 : 0; ind.eyeX = -1; }
- if (q >= T2.peek + 1.7) { ind.shut = false; ind.lids = 0; ind.eyeX = -1; ind.mouth = 'flat'; ind.brow = -.2; ind.eyeY = -.2; }
- if (q >= T2.peek + 2.3) { ind.armL = ind.armR = -115 * (1 - span(q, T2.peek + 2.3, T2.peek + 2.8)); ind.brow = -.4; }
- }
+ const ind = { x: indX(q), y: indY(q), s: FARM.s, look: -.5, eyeX: -1, mouth: 'flat', shut: blinking(q, [1.5, 5.8, 8.6]) };
+ if (mvI) Object.assign(ind, { legL: wkI.legL, legR: wkI.legR, bob: wkI.bob, armL: wkI.armL, armR: wkI.armR, look: .8 * dI, eyeX: dI });
+ if (!mvI && q >= 1.9 && q < 3.2) Object.assign(ind, { look: .6, eyeX: 1 }); // watching the American
+ let lid = false;
+ if (q >= ARR) {
+ const turn = span(q, ARR, ARR + .5), palms = span(q, ARR + .3, ARR + .8);
+ Object.assign(ind, { legL: 0, legR: 0, bob: 0, eyeX: -1 });
+ ind.look = -.8 * turn; ind.armL = ind.armR = -115 * palms;
+ ind.shut = q > ARR + .7; ind.mouth = q >= T2.pray - .1 ? ((lips(q, 'scene2', PRE2, 's07') === 'X') ? 'flat' : lips(q, 'scene2', PRE2, 's07')) : 'flat';
+ ind.brow = .3; ind.headR = q > T2.pray ? 3 * Math.sin(q * 2) : 0;
+ // the silence: a peek with the eye nearer the cow only (the other keeps its lid down), then both open
+ if (q >= T2.peek + .5) { ind.shut = false; ind.lids = q < T2.peek + 1.5 ? .35 : 0; lid = q < T2.peek + 1.5; ind.eyeX = -1; }
+ if (q >= T2.peek + 1.7) { ind.shut = false; ind.lids = 0; ind.eyeX = -1; ind.mouth = 'flat'; ind.brow = -.2; ind.eyeY = -.2; }
+ if (q >= T2.peek + 2.3) { ind.armL = ind.armR = -115 * (1 - span(q, T2.peek + 2.3, T2.peek + 2.8)); ind.brow = -.4; }
}
+ vis(s2lid, lid);
R.ind.pose(ind, f);
// who is on screen: the camera root is the same set throughout; the cow close-up leaves the rest in the frame edges
diff --git a/site/joke-collection/ch03/scene3.js b/site/joke-collection/ch03/scene3.js
index 6ed4e60..9161dcd 100644
--- a/site/joke-collection/ch03/scene3.js
+++ b/site/joke-collection/ch03/scene3.js
@@ -12,7 +12,7 @@ const s3w = w => s3v('s10', w + (w >= .05 ? .4 : 0) + (w >= 1.6 ? 1.6 : 0));
/* ---------- timeline (beat time, s) ---------- */
const T3 = {
fix: .6, away: 1.5, off: 5.1, back: 6.5, // he straightens his shirt, walks off left (gone at 5.1), returns from 6.5
- indGo: 8.3, // the Indian man wanders left to watch
+ indGo: 9.0, // the Indian man wanders left to watch
insIn: s3w(.05) - .1, insOut: s3w(1.85) - .04, // INSERT close-up: from "He tied" to just before "and the rod"
knot0: s3w(1.0), knot1: s3w(1.6) + 1.5, pull: 14.0, // wraps on "to the hook", tightens in the hole
med: s3w(1.85) - .04, lift: s3w(1.85) + .05, rodOn: s3w(2.9), medOut: 16.85,
@@ -20,7 +20,6 @@ const T3 = {
talk: s3v('s11') + 5.1, // the line starts here (after its 5 s hole)
hush: s3v('hush2'),
};
-sfx('scene3', T3.step1 - .1, 'clop'); for (let t = T3.step1 - .1 + 2; t < 31; t += 2) sfx('scene3', t, 'clop', .8);
/* ---------- helpers ---------- */
const s3k = (q, pts) => { // eased piecewise keyframes [[t, v], …]
@@ -36,17 +35,24 @@ const s3lin = (q, pts) => { // linear piecewise
const s3flick = (q, k, amp = .12) => amp * jit(Math.floor(q * 2.5), k);
// the cow's x: still, two small steps, then a trudge that gains pace (velocity keyframes integrated once)
const S3_V = [[0, 0], [T3.step1, 0], [T3.step1 + .2, 100], [T3.step1 + .4, 0], [T3.step2, 0], [T3.step2 + .2, 100], [T3.step2 + .4, 0],
- [T3.go, 0], [T3.go + .3, 125], [40, 125]];
+ [T3.go, 0], [T3.go + .3, 55], [27.2, 55], [28.0, 400], [40, 400]]; // a slow trudge keeps the cow in frame to the end of the line (27.3), then they hurry off, all out of frame before the cut
const S3_X = (() => { const a = [FARM.cow.x]; for (let i = 1; i <= 32 * 120; i++) a.push(i / 120 >= T3.cu && (i - 1) / 120 < T3.cu ? 760 : a[i - 1] + s3lin(i / 120, S3_V) / 120); return a; })(); // the cow is re-placed (760) at the cut to its close-up
const s3cowX = q => S3_X[Math.max(0, Math.min(S3_X.length - 1, Math.round(q * 120)))];
+sfx('scene3', T3.step1 - .1, 'clop'); for (let t = T3.step1 - .1 + 2; t < 31 && s3cowX(t) - 175 < 1600; t += 2) sfx('scene3', t, 'clop', .8); // the clops stop when the cow has left the frame
const s3moving = (fn, q) => Math.abs(fn(q) - fn(q - .12)) > 3 && Math.abs(fn(q) - fn(q - .12)) < 40;
// a figure that walks 150 px/s along a path from t0, never past its target
const s3follow = (x0, t0, target) => q => Math.min(x0 + 150 * Math.max(0, q - t0), target(q));
-const s3walk = q => spWalk(q * .5); // slower cadence (swap every 4 frames) for the slow marchers
+// the men's walk, driven by ground covered (feet stay planted), in four poses per two steps: one leg swings out toward the way he
+// goes (dir +1 right, -1 left) while the other stands, then both vertical with the body up (pass), then the other leg steps, then pass.
+// One pose per 30 px; the arms swing against the stepping leg. amp < 1 shortens the swing for the last slow steps.
+const s3walk = (x, amp = 1, dir = 1) => {
+ const ph = ((Math.floor(x / 30) % 4) + 4) % 4, s = [1, 0, -1, 0][ph], a = 20 * amp * -dir; // a leg turns by -a·dir to go right
+ return { legL: s > 0 ? a : 0, legR: s < 0 ? -a : 0, bob: ph % 2 ? -5 : 0, armL: 12 * s * amp, armR: -12 * s * amp, k: s };
+};
/* ---------- the insert: hook, hay and two mittens on a blurred road ---------- */
function s3insert(p) {
- const g0 = mk('g', {}, p), g = mk('g', { transform: 'translate(880,200) scale(1.7) translate(-880,-200)' }, g0), HX = 880, TIE = 340;
+ const g0 = mk('g', {}, p), g = mk('g', { transform: 'translate(800,200) scale(1.7) translate(-800,-200)' }, g0), HX = 800, TIE = 340;
g.innerHTML = '<rect width="1600" height="900" fill="#1d1a1a" opacity=".18"/>';
const line = mk('path', { d: `M${HX},-20 V${TIE - 70}`, stroke: '#3a3430', 'stroke-width': 5, fill: 'none' }, g);
const hook = prop(g, `<g filter="url(#paper)"><circle cy="0" r="13" fill="none" stroke="#5a5f66" stroke-width="7"/><path d="M0,13 V120 Q0,190 -60,176 Q-96,166 -90,128 L-70,150" fill="none" stroke="#5a5f66" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/>
@@ -90,20 +96,28 @@ function s3insert(p) {
function scene3(p, D) {
const R = roadSet(p, 'road'), cam = R.cam, ins = s3insert(p), who = [R.cow, R.am, R.cn, R.ind];
- const MED = { x: 1060, y: 560, z: 1.5 }, INS = { x: 880, y: 450, z: 1 };
+ // the carried rod is drawn here (not as a held prop, which can't tilt): up-right from his hand, the hay hanging from its tip;
+ // in the last half second he lowers it onto the cow's back, base and tip sliding to the cow's rod, so the swap is seamless
+ const rg = mk('g', {}, cam.stage), rodL = mk('path', { stroke: '#3a2a1a', 'stroke-width': 7, 'stroke-linecap': 'round', fill: 'none' }, rg),
+ reel = mk('circle', { r: 12, fill: '#9aa0a8' }, rg), rgLine = mk('path', { stroke: '#3a3430', 'stroke-width': 2, fill: 'none' }, rg),
+ rgHay = prop(rg, haySVG);
+ const MED = { x: 1060, y: 560, z: 1.5 }, INS = { x: 800, y: 450, z: 1 };
// 3.1 wide: he leaves, the others glance, he returns INSERT: the knot 3.2 medium: the rod 3.3 cow close-up 3.4 wide follow
cam.cut(FARM_WIDE, 0)
.cut(INS, T3.insIn).soft(T3.insIn, 'all')
.cut(MED, T3.med).soft(T3.med, false)
.cut({ x: t => s3cowX(t) + 215, y: 545, z: 2.8 }, T3.cu).soft(T3.cu, true)
- .cut({ x: t => Math.min(1020, Math.max(650, s3cowX(t) - 150)), y: 520, z: 1.25 }, T3.wide).soft(T3.wide, false); // follows the cow, then locks
+ .cut({ x: t => Math.min(960, Math.max(650, s3cowX(t) - 150)), y: 520, z: 1.25 }, T3.wide).soft(T3.wide, false); // follows the cow, then locks
// where everyone is (functions of time)
- const cnX = q => q < T3.away ? 500 : q < T3.back ? Math.max(-120, 500 - 150 * (q - T3.away)) : q < T3.cu ? Math.min(985, -40 + 150 * (q - T3.back)) : s3cowX(q) - 300;
- const indX = q => q < T3.indGo ? 1460 : q < T3.cu ? Math.max(480, 1460 - 150 * (q - T3.indGo)) : s3cowX(q) - 450;
- const amX = q => q < T3.cu ? 300 : s3cowX(q) - 600;
- const speaking = q => q >= T3.talk - .05 && q < s3v('s11', 5.45);
- const talkOver = s3v('s11', 5.45);
+ const cnX = q => q < T3.away ? 500 : q < T3.back ? Math.max(-120, 500 - 150 * (q - T3.away)) : q < T3.cu ? Math.min(875, -40 + 150 * (q - T3.back)) : s3cowX(q) - 200;
+ const indX = q => q < T3.indGo ? 1460 : q < T3.cu ? Math.max(400, 1460 - 150 * (q - T3.indGo)) : s3cowX(q) - 430;
+ const amX = q => q < T3.cu ? 300 : s3cowX(q) - 660;
+ const speaking = q => q >= T3.talk - .05 && q < 27.5 && lips(q, 'scene3', PRE3, 's11') !== 'X'; // the whole line, driven by the lip data
+ const talkOver = 27.5;
+ // draw order: cow, Chinese man, rod, American (he walks behind the American), the Indian man (above the rod); he walks behind the cow while crossing it
+ for (const e of [R.cn.g, rg, R.am.g, R.ind.g]) cam.stage.appendChild(e);
+ const indBehind = q => q < T3.cu && indX(q) < 1450 && indX(q) > 780;
stopClock(D, (q, f) => {
cam.apply(q, f);
@@ -127,12 +141,12 @@ function scene3(p, D) {
+ (q > T3.step1 ? 2.5 * Math.sin((q - T3.step1) * 5) * (cwalk ? 1 : 0) : 0) + (q > T3.wide ? 14 * hay + 6 * Math.sin((q - T3.wide) * 4) : 0) : 0;
R.cow.pose({ ...FARM.cow, x: cx, ...cowEye, rod: rodOn, walk: cwalk, bob: cwalk ? -3 * (Math.floor(q * 3) % 2) : 0,
jaw: hay > 0 ? .55 * hay + .1 : chewing ? (Math.floor(q * 3.5) % 2 ? .13 : 0) : (q > T3.lunge2 + .6 && q < T3.step1 ? .08 : 0),
- headR: -7 * hay + (sees && !hay ? -1.5 : 0), brow: sees && q < T3.step2 + .4 ? .5 : 0,
+ headR: -7 * hay + (sees && !hay ? -1.5 : 0), brow: 0,
tail: 12 * Math.sin(q * 1.7) + (cwalk ? 8 * Math.sin(q * 4) : 0), ear: flick && Math.floor(q) % 3 === 0 ? 14 : 0,
shut: blinking(q, [1.6, 4.4, 7.9, 12.1, 15.8, 18.2, 22.0, 26.3, 29.4]), lids: 0, swing }, cwalk ? wf : f);
/* ---------- the Chinese man ---------- */
- const cn = cnX(q), cnWalk = s3moving(cnX, q), w = cnWalk ? s3walk(q) : {};
+ const cn = cnX(q), cnWalk = s3moving(cnX, q), w = cnWalk ? s3walk(cn, 1, Math.sign(cn - cnX(q - .1)) || 1) : {};
const tidy = between(q, T3.fix, T3.away), lifting = between(q, T3.lift, T3.rodOn), winding = between(q, T3.rodOn - .6, T3.medOut);
const rodHeld = q >= T3.back && q < T3.rodOn, hayHeld = q >= T3.back && q < T3.insIn;
const tug = tidy ? s3k(q, [[T3.fix, 0], [T3.fix + .25, -40], [T3.fix + .5, 10], [T3.fix + .75, -40], [T3.fix + 1.0, 0]]) : 0;
@@ -145,27 +159,39 @@ function scene3(p, D) {
else if (q < T3.talk - .3) cnLook = { look: -.2, eyeX: 0 }; // proud, eyes front
else cnLook = { look: -.9 * span(q, T3.talk + 1.1, T3.talk + 1.4), eyeX: -1 * span(q, T3.talk + 1.1, T3.talk + 1.4) };
const strut = q >= T3.cu;
- cnPose = { x: cn, y: FARM.ground + (strut ? 12 : 0), s: FARM.s, ...cnLook, ...w, armL: strut ? -20 : w.armL === undefined ? aL : aL, armR: strut ? -20 : aR,
- hold: rodHeld ? 'rod' : null, holdL: hayHeld ? 'hay' : null, headR: strut ? 6 + (speaking(q) ? 3 * (Math.floor(q * 3) % 2) : 0) : 0, lids: strut ? .25 : 0, brow: strut ? 1 : 0,
+ cnPose = { x: cn, y: FARM.ground + (strut ? 12 : 0) - (q < T3.cu ? 22 * Math.max(0, Math.min(1, (460 - cn) / 70)) : 0), // farther back while he passes the American, so he walks behind him
+ s: FARM.s, ...cnLook, ...w, armL: strut ? -20 : w.armL === undefined ? aL : aL, armR: strut ? -20 : aR,
+ hold: null, holdL: hayHeld ? 'hay' : null, headR: strut ? 6 + (speaking(q) ? 3 * (Math.floor(q * 3) % 2) : 0) : 0, lids: strut ? .25 : 0, brow: strut ? 1 : 0,
mouth: speaking(q) ? lips(q, 'scene3', PRE3, 's11') : (strut ? 'smile' : 'flat'), shut: blinking(q, [2.4, 8.9, 12.4, 17.6, 21.3, 24.9, 29.1]) };
if (cnWalk && !strut) { cnPose.armR = aR + 3 * (w.k || 0); cnPose.armL = aL; }
if (q >= T3.back && q < T3.cu) { cnPose.armR = lifting || winding ? aR : 22; cnPose.armL = lifting || winding ? aL : 28; }
if (q >= T3.back && q < T3.rodOn - .6 && q >= T3.med) { cnPose.armR = lifting ? aR : 22; cnPose.armL = lifting ? aL : 28; }
R.cn.pose(cnPose, f);
+ const carry = q >= T3.back && q < T3.rodOn && !inIns; vis(rg, carry);
+ if (carry) {
+ const [h0, h1] = handAt(R.cn, cnPose, 'R'), u = ease(span(q, T3.rodOn - .5, T3.rodOn)), cs = FARM.cow.s, cwx = cx;
+ const L = (a, b) => a + (b - a) * u, bx = L(h0 + FARM.s * 14, cwx - 60 * cs), by = L(h1 + FARM.s * 40, FARM.cow.y - 288 * cs),
+ tx = L(h0 + FARM.s * 300, cwx + 372 * cs), ty = L(h1 - FARM.s * 270, FARM.cow.y - 500 * cs), sc = L(FARM.s, cs);
+ rodL.setAttribute('d', `M${bx.toFixed(1)},${by.toFixed(1)} L${tx.toFixed(1)},${ty.toFixed(1)}`);
+ tf(reel, `translate(${bx.toFixed(1)},${by.toFixed(1)})`);
+ vis(rgLine, q >= T3.med); vis(rgHay, q >= T3.med);
+ rgLine.setAttribute('d', `M${tx.toFixed(1)},${ty.toFixed(1)} v${(200 * sc).toFixed(1)}`);
+ tf(rgHay, `translate(${tx.toFixed(1)},${(ty + 200 * sc).toFixed(1)}) scale(${sc.toFixed(3)})`);
+ }
/* ---------- the American ---------- */
- const am = amX(q), amWalk = s3moving(amX, q), aw = amWalk ? s3walk(q) : {};
+ const am = amX(q), amWalk = s3moving(amX, q), aw = amWalk ? s3walk(am) : {};
const toInd = between(q, 2.6, 4.6), tail = q >= T3.cu;
- const amPose = { x: am, y: FARM.ground, s: FARM.s, hold: 'whip', ...aw, armR: amWalk ? 14 + 4 * (aw.k || 0) : 14, armL: amWalk ? aw.armL : 0, bob: aw.bob || 0,
+ const amPose = { x: am, y: FARM.ground, s: FARM.s, hold: 'coil', ...aw, armR: amWalk ? 14 + 4 * (aw.k || 0) : 14, armL: amWalk ? aw.armL : 0, bob: aw.bob || 0,
look: toInd ? .9 : q < T3.back ? .4 : .5, eyeX: toInd ? 1 : q < 5.4 ? 0 : 1, eyeY: 0, shut: blinking(q, [3.3, 9.7, 13.1, 18.9, 23.6, 27.8]),
mouth: tail ? 'O' : 'flat', lids: tail ? 0 : .12, brow: tail ? .35 : 0, headR: tail ? 3 : 0 };
if (tail) { amPose.look = .7; amPose.eyeX = 1; amPose.eyeY = s3flick(q, 4, .1); }
R.am.pose(amPose, f);
const [hx, hy] = handAt(R.am, amPose, 'R');
- R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase: -1, on: true });
+ R.lash.pose({ hx, hy: hy - 46 * FARM.s, phase: -1, on: false });
/* ---------- the Indian man ---------- */
- const ind = indX(q), indWalk = s3moving(indX, q), iw = indWalk ? s3walk(q) : {};
+ const ind = indX(q), indWalk = s3moving(indX, q), iw = indWalk ? s3walk(ind, 1, Math.sign(ind - indX(q - .1)) || 1) : {};
const itail = q >= T3.cu, toAm = between(q, 2.6, 4.6);
const indPose = { x: ind, y: FARM.ground, s: FARM.s, ...iw, armL: indWalk ? iw.armL : 0, armR: indWalk ? iw.armR : 0,
look: toAm ? -.9 : indWalk && q < T3.cu ? -.8 : itail ? .6 : q < T3.back ? -.8 : -.5, eyeX: toAm ? -1 : indWalk && q < T3.cu ? -1 : itail ? 1 : -1,
@@ -173,5 +199,6 @@ function scene3(p, D) {
mouth: itail ? 'O' : 'flat', brow: itail ? .4 : 0, lids: itail ? 0 : .1 };
if (!indWalk && !itail && q > T3.back) indPose.look = -.5;
R.ind.pose(indPose, f);
+ const behind = indBehind(q); if (behind !== R.ind.behind) { R.ind.behind = behind; cam.stage.insertBefore(R.ind.g, behind ? R.cow.g : null); }
});
}
diff --git a/site/joke-collection/ch03/scene4.js b/site/joke-collection/ch03/scene4.js
index 1ce4580..e332207 100644
--- a/site/joke-collection/ch03/scene4.js
+++ b/site/joke-collection/ch03/scene4.js
@@ -10,25 +10,33 @@ const S4 = {
slow0: 6.3, stop: 10.5, // the cow slows during "However far it walked…" and stands
cowCU: 10.35, hay: 10.5, us: 11.9, blink: 12.6, sigh: 13.9, lie0: 14.65, lie1: 15.45, // 4.2
wide: 15.95, // 4.3 (s13 starts at s4v('s13'))
- cnCU: 20.9, turn: 22.8, two: 23.4, storm0: 23.45, storm1: 24.6, // 4.4, 4.5
- hands: 29.9, snap: 30.35, titleAt: 33.6, // 4.6, 4.7
+ // the office cutaway runs through s13b ("Lying flat means…", 21.2 to 31.0); everything after it sits 11.738 s later than before
+ cut0: 21.0, cutS2: 24.6, cutS3: 28.75, cut1: 31.0, // 4.3b shots 1, 2, 3 of the cutaway, then back to the wide
+ slowJ: 26.2, stopJ: 27.4, clock0: 24.8, clock1: 26.9, night0: 25.0, night1: 26.6, sign: 27.55, us2: 28.2, sink0: 28.75, fall0: 29.15, land: 30.35, chest: 29.9,
+ cnCU: 32.638, turn: 34.538, two: 35.138, storm0: 35.188, storm1: 36.338, // 4.4, 4.5
+ hands: 41.638, snap: 42.088, titleAt: 45.338, // 4.6, 4.7
};
S4.shake = s4v('s14', 1.107 + 3.5); // on 境外
window.S4_STOP = S4.lie1;
for (let t = .2; t < S4.stop - 1; t += 2) sfx('scene4', t, 'clop', t < 6 ? .8 : .5);
sfx('scene4', S4.lie1, 'thud');
+sfx('scene4', S4.land, 'thud', .4); // the office worker lies down
sfx('scene4', S4.cnCU + .1, 'crickets');
sfx('scene4', S4.snap, 'whoosh');
sfx('scene4', S4.titleAt, 'sting');
/* ---------- the march: cow x(q) (X0 → 1000), 130 px/s then slowing to a stop ---------- */
-const S4_V = 130, S4_SLOW = S4.stop - S4.slow0, S4_X0 = 1000 - S4_V * S4.slow0 - S4_V * S4_SLOW / 2;
+const S4_V = 150, S4_SLOW = S4.stop - S4.slow0, S4_X0 = 1000 - S4_V * S4.slow0 - S4_V * S4_SLOW / 2;
function s4cowX(q) {
if (q <= S4.slow0) return S4_X0 + S4_V * q;
const u = Math.min(1, (q - S4.slow0) / S4_SLOW);
return S4_X0 + S4_V * S4.slow0 + S4_V * S4_SLOW * (u / 2 + Math.sin(Math.PI * u) / (2 * Math.PI));
}
-const s4moving = q => q < S4.stop - .25;
+const s4moving = q => q < S4.stop;
+// gait follows ground speed: one step flip per 130/6 px of travel (the old fixed rate), stride amplitude ∝ speed
+const s4r = q => q <= S4.slow0 ? 1 : (1 + Math.cos(Math.PI * Math.min(1, (q - S4.slow0) / S4_SLOW))) / 2;
+const s4gait = q => (s4cowX(q) - S4_X0) / (S4_V / 6);
+function s4walk(q) { return s3walk(s4cowX(q), Math.min(1, 4 * s4r(q))); } // the same walk as scene 3, by ground covered; the swing shortens only in the last step or two
// Piecewise eased keyframes [[t, v], …].
const s4k = (q, pts) => {
if (q <= pts[0][0]) return pts[0][1];
@@ -37,21 +45,119 @@ const s4k = (q, pts) => {
};
const s4flick = (q, k, amp = .12) => amp * jit(Math.floor(q * 2.5), k); // tiny eye moves
+/* ---------- the cutaway: "lying flat" at the office (during s13b) ----------
+ Three hard cuts on one paper-cutout office (flat wall, a desk with a monitor, a wall clock, a window; the same torn-paper
+ pieces as the puppets, baked): 1 a young office worker jogs after a PROMOTION sign dangling from a rod held by a hand from the
+ frame edge (the cow and the hay); 2 the clock spins to late night, the window goes dark, he slows, stops, looks at the sign,
+ then at us; 3 he lies down on his back, hands on his chest, the sign still dangling above him. */
+SHAPES.worker = { ...SHAPES.meAdult,
+ extra: '<path d="M-8,-250 L8,-250 L13,-150 L0,-122 L-13,-150 Z" fill="#a8272b"/><path d="M-8,-250 L8,-250 L5,-238 L-5,-238 Z" fill="#7a1a1d"/><rect x="-124" y="-110" width="248" height="14" fill="#2a2a2e"/>' };
+const workerPuppet = (p, o) => spKid(p, 'worker', { coat: '#f4f1ea', stripe: '#c9c3b4', pants: '#2a2d3a', ...o });
+const S4J = { v: 284, stride: 71, a: 22, X: 640, s: FARM.s }; // ground speed (px/s) and the distance one leg flip covers at a 22 degree swing and s .9
+const S4VIEW = [{ x: 800, y: 450, z: 1 }, { x: 760, y: 500, z: 1.7 }, { x: 660, y: 540, z: 1.25 }]; // wide, a push-in on him and the sign, a low frame on the floor
+const S4TIP = [1040, 215];
+// distance run since the cut: full speed, then slowing to a stop (the same ease as the cow's)
+function s4jogDist(q) {
+ const T = S4.stopJ - S4.slowJ;
+ if (q <= S4.slowJ) return S4J.v * (q - S4.cut0);
+ const u = Math.min(1, (q - S4.slowJ) / T);
+ return S4J.v * (S4.slowJ - S4.cut0) + S4J.v * T * (u / 2 + Math.sin(Math.PI * u) / (2 * Math.PI));
+}
+function s4office(p) {
+ const root = mk('g', {}, p), view = mk('g', {}, root), set = mk('g', {}, view);
+ // the window sits low enough that the rod passes above it
+ const wy = y => 220 + (y - 120) * .744;
+ const buildings = [[1140, 330, 60], [1196, 270, 80], [1272, 360, 50], [1318, 300, 70], [1384, 240, 66]].map(([x, y, w], i) => `<rect x="${x}" y="${wy(y).toFixed(0)}" width="${w}" height="${510 - wy(y)}" fill="${i % 2 ? '#74899f' : '#8aa0b8'}"/>`).join('');
+ let lit = ''; for (let i = 0; i < 40; i++) { const x = 1150 + (i % 10) * 29 + (i % 3) * 3, y = wy(290 + Math.floor(i / 10) * 52 + (i % 4) * 6); if (jit(i, 5) > -.2) lit += `<rect x="${x}" y="${y.toFixed(0)}" width="9" height="12" fill="#f6d365"/>`; }
+ let seams = ''; for (let i = -1; i < 11; i++) seams += `<path d="M${i * 160},748 L${i * 160 - 24},900" stroke="#6b5b4e" stroke-width="4"/>`;
+ let ticks = ''; for (let i = 0; i < 12; i++) ticks += `<rect x="-3" y="-76" width="6" height="${i % 3 ? 10 : 18}" fill="#3a2e26" transform="rotate(${i * 30})"/>`;
+ // one 1600-wide stretch of office; two of them side by side scroll past as he runs and the second ends exactly where the first began
+ const room = `<rect width="1600" height="740" fill="#dcd0b6"/><rect y="560" width="1600" height="180" fill="#d0c3a6"/><rect y="556" width="1600" height="6" fill="#bfae8c"/>
+ <rect y="740" width="1600" height="160" fill="#7f6e60"/><g>${seams}</g>
+ <g filter="url(#paper)"><rect x="0" y="722" width="1600" height="26" fill="#f1ead9"/></g>
+ <rect x="1140" y="220" width="310" height="290" fill="#a9d2ee"/>${buildings}<rect class="night" x="1140" y="220" width="310" height="290" fill="#0f1936" opacity="0"/><g class="lit" opacity="0">${lit}</g>
+ <g filter="url(#paper)"><path fill-rule="evenodd" d="M1118,198 H1472 V532 H1118 Z M1140,220 V510 H1450 V220 Z" fill="#f4eee0"/><rect x="1290" y="220" width="10" height="290" fill="#f4eee0"/><rect x="1140" y="360" width="310" height="10" fill="#f4eee0"/><rect x="1104" y="520" width="382" height="22" fill="#e6dcc6"/></g>
+ <g filter="url(#paper)"><circle cx="800" cy="190" r="94" fill="#4a3a2c"/><circle cx="800" cy="190" r="82" fill="#faf6ea"/></g>
+ <g transform="translate(800,190)">${ticks}<g class="hH"><path d="M0,8 L0,-46" stroke="#2a2220" stroke-width="8" stroke-linecap="round"/></g><g class="mH"><path d="M0,10 L0,-68" stroke="#2a2220" stroke-width="5" stroke-linecap="round"/></g><circle r="7" fill="#a8272b"/></g>
+ <g filter="url(#paper)"><rect x="20" y="560" width="500" height="26" rx="4" fill="#b98350"/><rect x="40" y="586" width="30" height="204" fill="#9a6a40"/><rect x="470" y="586" width="30" height="204" fill="#9a6a40"/><rect x="70" y="586" width="400" height="140" fill="#8c5f38"/></g>
+ <g filter="url(#paper)"><rect x="168" y="372" width="224" height="150" rx="10" fill="#2b2f38"/><rect x="182" y="386" width="196" height="116" fill="#b8e0ee"/><rect x="262" y="522" width="36" height="30" fill="#2b2f38"/><rect x="226" y="548" width="108" height="12" rx="4" fill="#2b2f38"/>
+ <rect x="196" y="456" width="22" height="36" fill="#5b8fd0"/><rect x="228" y="430" width="22" height="62" fill="#e0a43a"/><rect x="260" y="466" width="22" height="26" fill="#5b8fd0"/><rect x="292" y="410" width="22" height="82" fill="#c8322f"/><rect x="324" y="444" width="22" height="48" fill="#e0a43a"/></g>
+ <g filter="url(#paper)"><rect x="410" y="516" width="40" height="44" rx="5" fill="#f6f1e4"/><rect x="456" y="528" width="40" height="32" fill="#fbfbf6"/><rect x="460" y="518" width="36" height="12" fill="#f3eee0"/></g>`;
+ const scroll = mk('g', {}, set); scroll.innerHTML = `<g>${room}</g><g transform="translate(1600,0)">${room}</g>`;
+ const still = mk('g', {}, set); still.innerHTML = '<ellipse class="shadow" rx="100" ry="18" fill="url(#spShadow)"/>';
+ bakeAll(set);
+ const all = c => [...set.querySelectorAll(c)], shadow = set.querySelector('.shadow');
+ const nights = all('.night'), litG = all('.lit'), hHs = all('.hH'), mHs = all('.mH');
+ const setAll = (els, a, v) => els.forEach(e => e.setAttribute(a, v));
+ const wrap = mk('g', {}, view), man = workerPuppet(wrap);
+ // the rod (drawn level, pointing left from the hand, stretched to length), the arm from the frame edge, the sign on its line
+ const rod = prop(mk('g', {}, view), '<g filter="url(#paper)"><path d="M0,-5 L-1000,-2 L-1000,2 L0,5 Z" fill="#3a2a1a"/></g>'), rodG = rod.parentNode;
+ const arm = prop(mk('g', {}, view), '<g filter="url(#paper)"><rect x="20" y="-26" width="200" height="52" rx="8" fill="#2f3a52"/><rect x="20" y="-28" width="16" height="56" fill="#f2efe6"/><circle r="25" fill="#f2efe6"/><ellipse cx="-12" cy="-6" rx="9" ry="13" fill="#f2efe6"/></g>'), armG = arm.parentNode;
+ const signG = mk('g', {}, view);
+ signG.innerHTML = `<path d="M-110,168 L0,0 L110,168" stroke="#3a3430" stroke-width="3" fill="none"/><g transform="translate(0,300)">
+ <g filter="url(#paper)"><rect x="-150" y="-132" width="300" height="90" rx="6" fill="#f6efe0" stroke="#c8322f" stroke-width="6"/></g><text y="-74" font-family="Avenir Next, Helvetica, sans-serif" font-size="40" font-weight="800" letter-spacing="2" text-anchor="middle" fill="#3a1a14">PROMOTION</text></g>`;
+ bakeAll(signG);
+ // the caption card, in screen space
+ const cap = mk('g', {}, root);
+ cap.innerHTML = `<g filter="url(#paper)"><path d="M36,34 L220,26 L420,36 L640,28 L650,70 L644,150 L420,158 L220,150 L40,158 L30,100 Z" fill="#f3ead6"/></g>
+ <text x="64" y="118" font-family="PingFang SC, Heiti SC, sans-serif" font-size="72" font-weight="800" fill="#1d1a1a">躺平</text>
+ <text x="230" y="84" font-family="Avenir Next, sans-serif" font-size="30" font-weight="700" fill="#8e2e28">tǎng píng</text><text x="230" y="130" font-family="Avenir Next, sans-serif" font-size="30" fill="#3a3430">· lying flat</text>`;
+ bakeAll(cap);
+ const jogTotal = s4jogDist(S4.stopJ);
+ return { root, draw(q, f) {
+ const sh = q < S4.cutS2 ? 0 : q < S4.cutS3 ? 1 : 2, V = S4VIEW[sh];
+ tf(view, `translate(800,450) scale(${V.z}) translate(${-V.x},${-V.y})`);
+ vis(cap, q >= S4.cut0 + .3 && sh < 2); tf(cap, `rotate(${(-1.5 + .4 * jit(f >> 1, 3)).toFixed(2)},300,90)`);
+ // clock and window: the hands spin, then night falls
+ const ck = span(q, S4.clock0, S4.clock1);
+ setAll(hHs, 'transform', `rotate(${(270 + 80 * ck).toFixed(1)})`); setAll(mHs, 'transform', `rotate(${(1800 * ck + 240 * ck).toFixed(1)})`);
+ const nt = span(q, S4.night0, S4.night1); setAll(nights, 'opacity', (.92 * nt).toFixed(2)); setAll(litG, 'opacity', nt.toFixed(2));
+ // the run: legs flip once per S4J.stride px of ground covered; the whole office (wall, desk, window, floor) slides back at that speed,
+ // scaled so the run ends one office-width along: the second copy of the room stops where the first began
+ const dist = s4jogDist(q), k = Math.floor(dist / S4J.stride) % 2 ? 1 : -1, T = S4.stopJ - S4.slowJ;
+ const r = q < S4.slowJ ? 1 : (1 + Math.cos(Math.PI * Math.min(1, (q - S4.slowJ) / T))) / 2, running = q < S4.stopJ, A = S4J.a * Math.min(1, 4 * r);
+ tf(scroll, `translate(${(-1600 * Math.min(1, dist / jogTotal)).toFixed(1)},0)`);
+ // the end: he sinks, sighs, then lies back slowly about his heels onto the floor, head toward the desk, hands folded on his chest
+ const sk = span(q, S4.sink0, S4.sink0 + .5), u = span(q, S4.fall0, S4.land), ang = -90 * u, lie = q >= S4.land;
+ const fold = span(q, S4.fall0 + .3, S4.land);
+ const sway = q < S4.slowJ ? 1 : q < S4.stopJ ? .6 : .3;
+ const toSign = between(q, S4.stopJ, S4.us2), toUs = q >= S4.us2 && q < S4.fall0;
+ const breathe = lie ? .03 * Math.sin((q - S4.land) * 1.8) : 0, sigh = between(q, S4.us2 + .1, S4.sink0 + .3) ? .05 * Math.sin(Math.PI * span(q, S4.us2 + .1, S4.sink0 + .3)) : 0;
+ const pose = { x: 0, y: 0, s: S4J.s, look: running || toSign ? .9 : 0, eyeX: running || toSign ? 1 : 0, eyeY: running || toSign ? -.55 : 0, shut: blinking(q, [22.7, 25.5, 27.9]) || q >= S4.fall0 + .55,
+ lids: toUs ? .55 : 0, brow: running ? -.3 : toSign ? .6 : 0, headR: toUs ? 4 : 0, squash: sigh + breathe + .1 * sk * (1 - u),
+ bob: running ? (k > 0 ? -9 : 0) * Math.min(1, 2 * r) : 26 * sk * (1 - u), legL: running ? A * k : 0, legR: running ? A * k : 0,
+ armL: u > 0 ? -80 * fold : running ? (45 - 45 * k) * Math.min(1, 2 * r) : 0, armR: u > 0 ? -85 * fold : running ? (45 + 45 * k) * Math.min(1, 2 * r) : 0,
+ mouth: u > .7 ? 'smile' : between(q, S4.us2 + .1, S4.sink0 + .3) ? 'O' : u > 0 || sk > 0 ? 'flat' : toUs ? 'X' : toSign ? 'flat' : running ? 'grin' : 'A' };
+ man.pose(pose, f); vis(man.g.querySelector('[data-p="shadow"]'), false);
+ const a = ang * Math.PI / 180, lean = running ? 6 * Math.min(1, r * 2) : 0;
+ tf(wrap, `translate(${S4J.X},${(802 + 108 * Math.sin(a) + 45 * u).toFixed(1)}) rotate(${(lean + ang).toFixed(2)})`);
+ tf(shadow, `translate(${(S4J.X + 20 - 230 * u).toFixed(1)},${(803 + 40 * u).toFixed(0)}) scale(${(1 + 1.8 * u).toFixed(2)},1)`);
+ // rod, hand and sign: the tip is where the sign hangs; the rod passes above the window
+ const tip = S4TIP, H = [1610, 40], hb = running ? (k > 0 ? 6 : 0) : 2 * Math.sin(q * 2.2);
+ const dx = tip[0] - H[0], dy = tip[1] - H[1] - hb;
+ tf(armG, `translate(${H[0]},${(H[1] + hb).toFixed(1)})`);
+ tf(rodG, `translate(${H[0]},${(H[1] + hb).toFixed(1)}) rotate(${(Math.atan2(dy, dx) * 180 / Math.PI - 180).toFixed(2)}) scale(${(Math.hypot(dx, dy) / 1000).toFixed(4)},1)`);
+ tf(signG, `translate(${tip[0]},${(tip[1]).toFixed(1)}) rotate(${(sway * 8 * Math.sin(q * (running ? 7.5 : 3.2)) + 1.2 * jit(f >> 1, 12)).toFixed(2)})`);
+ } };
+}
+
function scene4(p, D) {
- const R = roadSet(p, 'road2'), cam = R.cam, card = titleCard(p);
- const CX = 1000, CN_END = CX - 250, AM_X = CX - 560, IND_X = CX - 730, AM_FACE = AM_X + 120; // standing places after the stop (the Indian man clear of the signpost at x 190…356)
- const CU_COW = { x: 1200, y: 560, z: 2.4 }, CU_CN = { x: CN_END, y: 470, z: 2.4 }, TWO = { x: 620, y: 500, z: 1.6 }, CU_AM = { x: AM_X, y: 470, z: 2.4 };
+ const R = roadSet(p, 'road2'), cam = R.cam, card = titleCard(p), office = s4office(p);
+ const CX = 1000, CN_END = CX - 250, AM_X = CX - 730, IND_X = CX - 560, IND_BACK = { x: IND_X + 250, y: 36 }, AM_RECOIL = 30, CN_STORM_END = AM_X - AM_RECOIL + 240; // scene 3's order: American, Indian, Chinese, cow; the Indian man steps back for the storm // standing places after the stop (the Indian man clear of the signpost at x 190…356)
+ const CU_COW = { x: 1200, y: 560, z: 2.4 }, CU_CN = { x: CN_END + 110, y: 470, z: 2.4 }, TWO = { x: 500, y: 500, z: 1.6 }, CU_AM = { x: AM_X - 60, y: 500, z: 3 };
// 4.1 wide, they walk in 4.2 the cow's close-up 4.3 wide 4.4 the Chinese man 4.5 two-shot 4.6 snap zoom to the American
- cam.cut(FARM_WIDE, 0).cut(CU_COW, S4.cowCU).soft(S4.cowCU, true).cut(FARM_WIDE, S4.wide).soft(S4.wide, false)
+ cam.cut(FARM_WIDE, 0).cut(CU_COW, S4.cowCU).soft(S4.cowCU, true).to({ x: 1190, y: 640, z: 2.05 }, S4.lie0 - .1, .9).cut(FARM_WIDE, S4.wide).soft(S4.wide, false)
.cut(CU_CN, S4.cnCU).soft(S4.cnCU, true).cut(TWO, S4.two).soft(S4.two, false).shake(S4.shake, .8, 9)
.to(CU_AM, S4.snap, .3).soft(S4.snap + .3, true);
stopClock(D, (q, f) => {
const title = q >= S4.titleAt;
- vis(cam.root, !title); vis(card, title);
+ const cut = q >= S4.cut0 && q < S4.cut1;
+ vis(cam.root, !title && !cut); vis(card, title); vis(office.root, cut);
if (title) return;
cam.apply(q, f);
- const cx = s4cowX(q), mv = s4moving(q), w = mv ? spWalk(q) : {}, lieU = span(q, S4.lie0, S4.lie1);
+ if (cut) { office.draw(q, f); return; }
+ const cx = s4cowX(q), mv = s4moving(q), w = mv ? s4walk(q) : {}, lieU = span(q, S4.lie0, S4.lie1);
R.lash.pose({ on: false });
/* ---------- the cow ---------- */
@@ -59,10 +165,10 @@ function scene4(p, D) {
const sigh = between(q, S4.sigh, S4.lie0 + .1) ? Math.sin(Math.PI * span(q, S4.sigh, S4.lie0 + .1)) : 0;
const standing = q >= S4.stop && q < S4.lie0;
const eyeX = q < S4.us ? 1 : q < S4.lie0 ? 0 : 0;
- R.cow.pose({ ...FARM.cow, x: cx, rod: true, walk: mv, bob: mv ? (w.bob || 0) * .7 : 8 * sigh, lie: lieU,
- headR: 10 * reaching - 5 * sigh, jaw: mv && q < 8 ? .12 * (onTwos(q) > 0 ? 1 : 0) : .25 * sigh,
+ R.cow.pose({ ...FARM.cow, x: cx, rod: true, walk: mv ? s4r(q) : 0, gait: s4gait(q), bob: mv ? (Math.floor(s4gait(q)) % 2 ? -6 * s4r(q) : 0) * .7 : 8 * sigh, lie: lieU,
+ headR: 10 * reaching - 5 * sigh - 18 * lieU, jaw: mv && q < 8 ? .12 * (onTwos(q) > 0 ? 1 : 0) : .25 * sigh,
eyeX: standing || q < S4.stop ? eyeX : 0, eyeY: lieU > 0 ? .2 : 0, swing: mv ? 7 + 3 * onTwos(q) * reaching : 0,
- shut: blinking(q, [3.1, 7.6, 19.0, 26.5]) || between(q, S4.blink, S4.blink + .8),
+ shut: blinking(q, [3.1, 7.6, 19.0, 37.2, 42.7]) || between(q, S4.blink, S4.blink + .8),
lids: sigh ? .5 : lieU > 0 ? .45 : q >= S4.us ? .15 : 0, brow: q >= S4.us && q < S4.lie0 ? -.4 * 0 : 0,
ear: q > S4.stop ? 14 * (onTwos(q) > 0 && between(q % 5, 0, .3) ? 1 : 0) : 0, tail: q > S4.lie1 && between((q - S4.lie1) % 4, 0, .5) ? 25 * onTwos(q) : 0 }, f);
@@ -71,31 +177,34 @@ function scene4(p, D) {
const stare = { look: .7, eyeX: 1 };
// Chinese man: strutting beside the cow's tail (hands behind his back), then staring, then turning on the American
const turn = span(q, S4.turn, S4.turn + .7), storm = span(q, S4.storm0, S4.storm1);
- const cnX = (mv ? cx - 250 : CN_END) + (q >= S4.storm0 ? (AM_FACE - CN_END + 100) * storm : 0);
+ const cnX = (mv ? cx - 250 : CN_END) + (q >= S4.storm0 ? (CN_STORM_END - CN_END) * storm : 0);
const stormWalk = q >= S4.storm0 && q < S4.storm1 + .1 ? spWalk(q) : {};
const sp = q >= s4v('s14') && q < s4v('s14', 9.4);
// stressed words: 境外势力 and 躺平; he leans in, squashes a little and jabs on twos at the American's face
const stress = [[1.107, 1.9], [4.18, 5.0]].some(([a, b]) => between(q, s4v('s14', a + 3.5), s4v('s14', b + 3.5)));
- const jab = q >= S4.storm1 - .3 ? 108 + (stress ? 10 * onTwos(q) : 3 * onTwos(q)) : 30 * span(q, S4.storm0, S4.storm1);
+ const jab = q >= S4.storm1 - .3 ? 86 + (stress ? 7 * onTwos(q) : 3 * onTwos(q)) : 30 + 56 * span(q, S4.storm0, S4.storm1);
const drop = span(q, S4.hands - .3, S4.hands); // the finger comes down as the American's hands go up (they'd meet like a fist bump)
const angry = q >= S4.turn + .4;
const twitch = between(q, S4.cnCU + .6, S4.cnCU + 1.5) ? (onTwos(q) > 0 ? .55 : 0) : between(q, S4.cnCU + 1.9, S4.cnCU + 2.3) && onTwos(q) > 0 ? .4 : 0;
R.cn.pose({ x: cnX, y: FARM.ground, s: FARM.s, ...k, ...stormWalk, look: .7 - 1.5 * turn, eyeX: 1 - 2 * turn, eyeY: 0,
armR: mv ? -20 : 0, armL: mv ? -20 : q >= S4.storm0 ? jab * (1 - drop) : 0,
- lids: twitch, squash: sp && stress ? .05 : 0, shut: blinking(q, [2.4, 6.9, 18.2]), brow: angry ? -1.2 : mv ? -.1 : .3,
+ lids: twitch, squash: sp && stress ? .05 : 0, shut: blinking(q, [2.4, 6.9, 18.2, 31.8, 34.0, 36.9, 39.4, 41.9]), brow: angry ? -1.2 : mv ? -.1 : .3,
mouth: sp ? (lips(q, 'scene4', PRE4, 's14') === 'X' ? 'frown' : lips(q, 'scene4', PRE4, 's14')) : mv ? 'smile' : angry ? 'frown' : 'flat',
headR: angry ? (sp ? -9 - (stress ? 4 : 0) : -5) : 0 }, f);
// American: agape, then hands up for "Me?"
const hands = span(q, S4.hands, S4.hands + .35);
const amLook = q >= S4.storm0 - .2 ? { look: .9, eyeX: 1, eyeY: .1 } : stare;
- R.am.pose({ x: mv ? cx - 560 : AM_X + (q >= S4.storm0 + .5 ? -22 * span(q, S4.storm0 + .5, S4.storm1 + .3) : 0), y: FARM.ground, s: FARM.s, ...k, ...amLook, eyeY: (amLook.eyeY || 0) + s4flick(q, 3),
- hold: null, armL: 110 * hands, armR: 110 * hands + (k.armR || 0) * (1 - hands), shut: blinking(q, [1.9, 5.4, 9.1, 13.8, 18.7, 24.1, 28.3, 32.0]),
+ if (R.am.g._up !== (hands > 0)) { R.am.g._up = hands > 0; if (hands > 0) R.am.g.parentNode.appendChild(R.am.g); } // in front of the Chinese man once his hands are up, so both show
+ R.am.pose({ x: mv ? cx - 730 : AM_X + (q >= S4.storm0 + .5 ? -AM_RECOIL * span(q, S4.storm0 + .5, S4.storm1 + .3) : 0), y: FARM.ground, s: FARM.s, ...k, ...amLook, eyeY: (amLook.eyeY || 0) + s4flick(q, 3),
+ hold: null, armL: 130 * hands, armR: 130 * hands + (k.armR || 0) * (1 - hands), shut: blinking(q, [1.9, 5.4, 9.1, 13.8, 18.7, 33.0, 35.8, 40.0, 44.2]),
mouth: q >= s4v('s15') ? lips(q, 'scene4', PRE4, 's15') === 'X' ? 'O' : lips(q, 'scene4', PRE4, 's15') : 'O',
brow: 1.2 * span(q, S4.storm0 + .5, S4.storm0 + 1.2) + .3, lids: 0, squash: 0, bob: k.bob || 0, headR: q > S4.storm1 && hands === 0 ? -7 : hands > 0 ? 5 * onTwos(q) * (hands < 1 ? 1 : 0) : 0 }, f);
// Indian man: agape, then a shrug behind the two-shot
- const shrug = s4k(q, [[26.4, 0], [26.8, 60], [28.2, 60], [28.6, 0]]);
- R.ind.pose({ x: mv ? cx - 730 : IND_X, y: FARM.ground, s: FARM.s, ...k, look: q >= S4.storm0 ? .5 : .6, eyeX: 1, eyeY: s4flick(q, 5),
+ const shrug = s4k(q, [[38.138, 0], [38.538, 60], [39.938, 60], [40.338, 0]]);
+ const back = span(q, S4.turn + .2, S4.storm0 + .3); // he steps back (behind the Chinese man's path) as the storm starts
+ if (R.ind.g._back !== (back > 0)) { R.ind.g._back = back > 0; back > 0 ? R.ind.g.parentNode.insertBefore(R.ind.g, R.cn.g) : R.ind.g.parentNode.appendChild(R.ind.g); } // behind the Chinese man while he storms past
+ R.ind.pose({ x: mv ? cx - 560 : IND_X + (IND_BACK.x - IND_X) * back, y: FARM.ground - IND_BACK.y * back, s: FARM.s * (1 - .1 * back), ...k, look: q >= S4.storm0 ? .5 : .6, eyeX: 1, eyeY: s4flick(q, 5),
armL: shrug || (k.armL || 0), armR: shrug || (k.armR || 0), headR: shrug > 30 ? 8 : 0,
- shut: blinking(q, [3.6, 8.3, 15.1, 21.5, 26.2, 31.0]), mouth: shrug > 30 ? 'flat' : 'O', brow: .7 }, f);
+ shut: blinking(q, [3.6, 8.3, 15.1, 33.5, 37.5, 39.0, 43.0]), mouth: shrug > 30 ? 'flat' : 'O', brow: .7 }, f);
});
}
diff --git a/site/joke-collection/img/puppets/2107f680.webp b/site/joke-collection/img/puppets/2107f680.webp
new file mode 100644
index 0000000..d43493c
Binary files /dev/null and b/site/joke-collection/img/puppets/2107f680.webp differ
diff --git a/site/joke-collection/img/puppets/2faf6f05.webp b/site/joke-collection/img/puppets/2faf6f05.webp
new file mode 100644
index 0000000..26d341c
Binary files /dev/null and b/site/joke-collection/img/puppets/2faf6f05.webp differ
diff --git a/site/joke-collection/img/puppets/47b17ae4.webp b/site/joke-collection/img/puppets/47b17ae4.webp
new file mode 100644
index 0000000..de7f30c
Binary files /dev/null and b/site/joke-collection/img/puppets/47b17ae4.webp differ
diff --git a/site/joke-collection/img/puppets/481a24b9.webp b/site/joke-collection/img/puppets/481a24b9.webp
new file mode 100644
index 0000000..bb21e2e
Binary files /dev/null and b/site/joke-collection/img/puppets/481a24b9.webp differ
diff --git a/site/joke-collection/img/puppets/5a8050ac.webp b/site/joke-collection/img/puppets/5a8050ac.webp
new file mode 100644
index 0000000..be67d0e
Binary files /dev/null and b/site/joke-collection/img/puppets/5a8050ac.webp differ
diff --git a/site/joke-collection/img/puppets/66cba9aa.webp b/site/joke-collection/img/puppets/66cba9aa.webp
new file mode 100644
index 0000000..d37dd00
Binary files /dev/null and b/site/joke-collection/img/puppets/66cba9aa.webp differ
diff --git a/site/joke-collection/img/puppets/719512d0.webp b/site/joke-collection/img/puppets/719512d0.webp
new file mode 100644
index 0000000..27b7cf4
Binary files /dev/null and b/site/joke-collection/img/puppets/719512d0.webp differ
diff --git a/site/joke-collection/img/puppets/77eca2a4.webp b/site/joke-collection/img/puppets/77eca2a4.webp
new file mode 100644
index 0000000..1ea6c97
Binary files /dev/null and b/site/joke-collection/img/puppets/77eca2a4.webp differ
diff --git a/site/joke-collection/img/puppets/7c5f2261.webp b/site/joke-collection/img/puppets/7c5f2261.webp
new file mode 100644
index 0000000..35a889f
Binary files /dev/null and b/site/joke-collection/img/puppets/7c5f2261.webp differ
diff --git a/site/joke-collection/img/puppets/87552bfd.webp b/site/joke-collection/img/puppets/87552bfd.webp
new file mode 100644
index 0000000..916b414
Binary files /dev/null and b/site/joke-collection/img/puppets/87552bfd.webp differ
diff --git a/site/joke-collection/img/puppets/9516ff56.webp b/site/joke-collection/img/puppets/9516ff56.webp
new file mode 100644
index 0000000..6796295
Binary files /dev/null and b/site/joke-collection/img/puppets/9516ff56.webp differ
diff --git a/site/joke-collection/img/puppets/a76d2da6.webp b/site/joke-collection/img/puppets/a76d2da6.webp
new file mode 100644
index 0000000..c569522
Binary files /dev/null and b/site/joke-collection/img/puppets/a76d2da6.webp differ
diff --git a/site/joke-collection/img/puppets/b1655c07.webp b/site/joke-collection/img/puppets/b1655c07.webp
new file mode 100644
index 0000000..09de5c4
Binary files /dev/null and b/site/joke-collection/img/puppets/b1655c07.webp differ
diff --git a/site/joke-collection/img/puppets/baked.js b/site/joke-collection/img/puppets/baked.js
index a9904b1..b66112d 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"};
+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"};
diff --git a/site/joke-collection/img/puppets/da6cb2b1.webp b/site/joke-collection/img/puppets/da6cb2b1.webp
new file mode 100644
index 0000000..cd6226b
Binary files /dev/null and b/site/joke-collection/img/puppets/da6cb2b1.webp differ
diff --git a/site/joke-collection/img/puppets/ef8c8b3f.webp b/site/joke-collection/img/puppets/ef8c8b3f.webp
new file mode 100644
index 0000000..6fe0fbb
Binary files /dev/null and b/site/joke-collection/img/puppets/ef8c8b3f.webp differ
diff --git a/site/joke-collection/img/puppets/f8ce0638.webp b/site/joke-collection/img/puppets/f8ce0638.webp
new file mode 100644
index 0000000..9ddd817
Binary files /dev/null and b/site/joke-collection/img/puppets/f8ce0638.webp differ
diff --git a/site/joke-collection/lib/shared.js b/site/joke-collection/lib/shared.js
index 1e8a716..16a01c3 100644
--- a/site/joke-collection/lib/shared.js
+++ b/site/joke-collection/lib/shared.js
@@ -123,18 +123,22 @@ const dusk = p => mk('rect', { width: 1600, height: 900, fill: '#ff9a3c', opacit
/* ---------- sound effects ----------
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 stops them. */
+ (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 });
let sfxLast = { i: -1, t: 0 };
function sfxTick() {
const id = BEATS[P.i]?.id, on = P.started && P.playing && !P.waiting && !P.done;
- if (on && sfxLast.i === P.i && P.t > sfxLast.t && P.t - sfxLast.t < .5)
+ // 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;
+ 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) {
const a = new Audio(`audio/sfx/${e.name}.mp3`); a.volume = .5 * e.vol * +(document.getElementById('volume')?.value ?? 1); // effects sit under the voices a.playbackRate = P.rate || 1;
a.play().catch(() => {}); sfxOn.push(a); a.onended = () => sfxOn.splice(sfxOn.indexOf(a), 1);
}
- if (!on) while (sfxOn.length) sfxOn.pop().pause();
+ 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 };
requestAnimationFrame(sfxTick);
}