diff --git a/script.html b/script.html new file mode 100644 index 0000000..36cf21b --- /dev/null +++ b/script.html @@ -0,0 +1,143 @@ + + + + + +Review the script — PayToLaugh + + + + + +
+ +
+

The script

+

Read it through. If it does not sound like your pet, say so and we will rewrite it.

+
+ +
+
+

Loading…

+
+ + +
+ + + + + diff --git a/videos.html b/videos.html index 8cec124..dcafd56 100644 --- a/videos.html +++ b/videos.html @@ -29,12 +29,14 @@ navBar("videos"); var email = requireSession(); var LABEL = { - submitted: ["submitted", "In the queue"], - scripting: ["submitted", "Being written"], - script_ready: ["submitted", "Script ready for you"], - rendering: ["submitted", "Filming"], - ready: ["ready", "Ready"], - failed: ["failed", "Did not work"] + submitted: ["submitted", "In the queue"], + scripting: ["submitted", "Writing the script"], + script_ready: ["ready", "Script ready to review"], + script_failed:["failed", "Script did not write"], + approved: ["ready", "Approved, waiting to film"], + rendering: ["submitted", "Filming"], + ready: ["ready", "Ready"], + failed: ["failed", "Did not work"] }; function when(s) { @@ -48,10 +50,23 @@ function card(p) { var media = p.video_url ? '' : '
Not filmed yet
'; - var dl = p.video_url - ? 'Download' - : ""; + + var cta = ""; + if (p.status === "script_ready") { + cta = 'Review the script'; + } else if (p.status === "scripting") { + cta = 'Watch it being written'; + } else if (p.status === "approved" || p.status === "script_failed") { + cta = 'See the script'; + } + if (p.video_url) { + cta += 'Download'; + } + return '
' + '
' + media + '
' + '
' @@ -59,28 +74,27 @@ function card(p) { + '

' + esc(p.pet_name || "Your pet") + ' reacts

' + '

' + (p.source_url ? '' + esc(p.source_url) + '' : "") + '

' + '

' + esc(p.owner_notes || "") + '

' - + '

' + (p.segments || 4) * 8 + ' seconds · ' + + '

' + ((p.segments || 4) * 8) + ' seconds · ' + (p.price_usd != null ? "$" + Number(p.price_usd).toFixed(2) : "") + ' · ' + esc(when(p.created_at)) + '

' - + dl + + cta + '
'; } -(async function () { +async function load() { if (!email) return; var r = await api("list_projects", { email: email }); var out = document.getElementById("out"); - if (!r.ok) { - out.innerHTML = ""; - showMsg("msg", r.error || "Could not load your videos."); - return; - } + if (!r.ok) { out.innerHTML = ""; showMsg("msg", r.error || "Could not load your videos."); return; } if (!r.projects || !r.projects.length) { out.innerHTML = '

Nothing here yet.

' + 'Make your first video
'; return; } out.innerHTML = '
' + r.projects.map(card).join("") + '
'; -})(); + // Anything still being written will change shortly; refresh so the button appears. + if (r.projects.some(function (p) { return p.status === "scripting"; })) setTimeout(load, 6000); +} +load();