1/** 2 * @file p4b-messages.js 3 * @description Scene 4b: iMessage conversation -- Tom writes to his mother (93-112s). 4 * The emotional core of the simulation. Tom's mother sends a normal "Gute Nacht" 5 * message. Tom tries to respond but hesitates: the typing indicator appears, 6 * disappears (he deletes what he wrote), reappears (he tries again), and finally 7 * he sends a brief, understated message that hides his pain. This conveys 8 * how hard it is for victims to reach out, even to people they trust. 9 * Transitions to the finale scene (p5). 10 * @requires audio.js - simTimeout(), sndIm(), typStart(), typStop() 11 * @requires helpers.js - sw() 12 * @requires i18n.js - t() for message text 13 */ 14 15// ===== P4b: MESSAGES - Tom writes to Mama (93-112s) ===== 16 17/** 18 * Runs the iMessage scene showing Tom's emotional hesitation. 19 * The sequence: receive mama's message -> typing... -> stops typing (deletes) -> 20 * typing again... -> finally sends a short reply -> transition to finale. 21 */ 22function p4b() { 23 var c = document.getElementById('imC'); 24 25 // Mama's "Gute Nacht" message arrives 26 simTimeout(function () { 27 var d = document.createElement('div'); 28 d.className = 'im-bub received'; 29 d.textContent = t('im.mama'); 30 c.appendChild(d); 31 sndIm(); 32 }, 500); 33 34 // First typing attempt: Tom starts writing but can't bring himself to say it 35 simTimeout(function () { 36 var tp = document.createElement('div'); 37 tp.className = 'im-typ'; 38 tp.id = 'imTyp'; 39 tp.innerHTML = '<i></i><i></i><i></i>'; 40 c.appendChild(tp); 41 c.scrollTop = 99999; 42 typStart(); 43 }, 4000); 44 45 // Tom deletes what he wrote -- typing indicator disappears 46 simTimeout(function () { 47 document.getElementById('imTyp').remove(); 48 typStop(); 49 }, 8000); 50 51 // Second attempt: he tries again after a pause 52 simTimeout(function () { 53 var tp = document.createElement('div'); 54 tp.className = 'im-typ'; 55 tp.id = 'imTyp2'; 56 tp.innerHTML = '<i></i><i></i><i></i>'; 57 c.appendChild(tp); 58 c.scrollTop = 99999; 59 typStart(); 60 }, 10000); 61 62 // Finally sends a short, understated reply that hides his real feelings 63 simTimeout(function () { 64 document.getElementById('imTyp2').remove(); 65 typStop(); 66 var d = document.createElement('div'); 67 d.className = 'im-bub vic'; 68 d.textContent = t('im.tom'); 69 c.appendChild(d); 70 c.scrollTop = 99999; 71 sndIm(); 72 }, 13000); 73 74 simTimeout(function () { 75 sw('aIm', 'aFn'); 76 p5(); 77 }, 19000); 78}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.