diff --git a/trailer.html b/trailer.html index a1197fb..e8d697f 100644 --- a/trailer.html +++ b/trailer.html @@ -111,6 +111,13 @@ .line .say{flex:1;min-width:0;font-size:14px} .line .who{color:var(--accent);font-size:12px} .line .dir{color:var(--muted);font-size:12px} + .bg{display:flex;gap:12px;align-items:flex-start;border:1px dashed var(--line);border-radius:10px;padding:8px 10px;margin:8px 0} + .bg img{width:180px;border-radius:6px;border:1px solid var(--line);cursor:zoom-in} + .bg .bgtxt{flex:1;min-width:200px} + .bg .bgtxt b{font-size:13px} + .bg textarea{width:100%;box-sizing:border-box;font:inherit;font-size:13px;min-height:64px;margin:4px 0} + .bg .tools{display:flex;gap:6px;flex-wrap:wrap} + .bg .tiny{font-size:12px;color:var(--muted)} .play{border:1px solid var(--line);background:none;color:var(--ink);border-radius:999px; width:30px;height:30px;flex:none;cursor:pointer;font:inherit;line-height:1} .play:hover{border-color:var(--accent)} @@ -1363,6 +1370,41 @@ }).join("") + ''; } + // THE BACKGROUND of a shot: the place's picture with nobody in it, which + // every picture of that place is drawn from. Dialled in one shot at a time + // and carried forward until it should change ("crawl before we walk"). + var BGEDIT = null; + function placeOf(s) { + if (s.place) return s.place; + var t = String(s.scene || "").toLowerCase().replace(/^(int|ext)\.?\s*\/?\s*(int|ext)?\.?\s*/, "").replace(/\s*[-–—]\s*(day|night|dawn|dusk|morning|evening|afternoon|late afternoon|continuous).*$/, "").replace(/[^a-z0-9]+/g, " ").trim(); + return t; + } + function backgroundHtml(s) { + var sets = PKG.sets || {}, key = placeOf(s), st = sets[key] || {}; + var url = s.set_ref || st.ref_url || ""; + var busy = st.state === "drawing"; + var editing = BGEDIT === s.id || (!url && !busy && BGEDIT === "auto:" + s.id); + var desc = st.description || ((s.setting || s.scene || "") + ". " + String(s.opening_image || "").replace(/\b(Dorothy|Toto|Em|Aunt Em|Henry|Uncle Henry)\b[^.]*\./g, "").trim() + " Nobody in the picture."); + var pic = url ? '' + : '
' + (busy ? 'drawing the background…' : 'no background yet') + '
'; + var body = 'Background ' + esc(st.name || s.scene || key) + (s.place ? ' · set by you' : '') + ''; + if (st.error) body += '
' + esc(st.error) + '
'; + if (editing) { + body += '' + + '
' + + '
'; + } else { + body += '
' + + '' + + '' + + (url ? '' : '') + + (s.place ? '' : '') + + '
' + + (st.description && url ? '
' + esc(String(st.description).slice(0, 220)) + '
' : ''); + } + return '
' + pic + '
' + body + '
'; + } + function shotHtml(s, voice) { if (s.writing) { return '
' + esc(s.id) + '
' @@ -1397,7 +1439,7 @@ + '
'; }).join(""); - var media = ""; + var media = backgroundHtml(s); if (s.clip_url) { media = '
the filmed shot' @@ -1454,7 +1496,7 @@ } else { tools = '' + '' + + (s.opening_url ? 'Redraw the shot picture' : 'Draw the shot picture (actors in the background)') + ' · $0.14' + (s.opening_url ? '' : '') + (s.clip_url && s.take_url ? '