// How an expert-reviewed article gets written: six stations, one sample article (invented), one step at a time.
// Plays once and holds on each station; Next/Back, the station buttons and the arrow keys move by hand.
(() => {
const root = document.getElementById('rf');
if (!root) return;
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const icons = {
check: '',
review: '',
topic: '',
research: '',
write: '',
script: '',
match: '',
live: ''
};
const steps = [
{ key: 'topic', label: 'Topic', title: 'A question people actually ask',
text: 'It lists every article you already have, then picks questions people search for that you have not answered yet.',
points: ['Checks the existing library first, so nothing repeats',
'Fits what the practice really offers, nothing it doesn’t',
'One clear question per article'],
scene: () => `
85 articles in the library · 0 on this question
✓ "When to ask for help with worry"
✓ "Antidepressant follow-up questions"
new "Rest stopped helping. Now what?"
fits: adults · Texas · in person or telehealth
Draft this one
` },
{ key: 'research', label: 'Research', title: 'Every claim has a source it actually read',
text: 'It reads current pages from government and professional bodies, and cites them inline as [1], [2].',
points: ['National health institutes, drug labels, professional associations',
'No doses, no personal instructions, no promises',
'The expert gets the numbered list to check against'],
scene: () => `
1National institute fact pagesymptoms and when to seek care
2Professional association guidewhat an evaluation covers
3Peer-reviewed reviewwhat the studies found
Sources3read today
HTTPS onlyread, not rememberednumbered in order
` },
{ key: 'write', label: 'Write', title: 'Written to be read, and heard',
text: 'Warm, plain, a little wry. Short paragraphs, and sentences that sound right out loud, because the podcast will say every one.',
points: ['Abbreviations spelled out once; no web addresses read aloud',
'Invented examples labeled as invented for the reviewer',
'Saved as a draft. It never publishes itself'],
scene: () => `
Studio · Draft
Not yet reviewed by the clinician
Rest stopped helping. Now what?Draft
When a long weekend no longer resets you, it is worth asking what else is going on. [1]
Heading
Is it tiredness, or something more?
✓
Heading
What to bring to the visit
✓
Sources
3 numbered
✓
Review notes for the expert attached
` },
{ key: 'check', label: 'Check', title: 'Checked before anyone’s time is spent',
text: 'A small free checker reads the draft the way a careful editor would, and lists what to fix before the expert sees it.',
points: ['Every [n] points to a real source, and every source is used',
'Numbers and “studies say” without a source are flagged',
'Web addresses, symbols and long sentences that would sound wrong aloud'],
scene: () => `
$ python3 check_article.py draft.json
✓ 6 sections · 520 words · 3 sources, all cited
! claim with no [n]: "About 40 percent…"
! "CBT": spell it out the first time
✓ still a draft · review notes present
fix 2 notes, then hand to the expert
` },
{ key: 'review', label: 'Review', title: 'The expert reviews once: read it, or listen',
text: 'The draft opens in the review screen with its podcast version beside it. The expert reads the article or plays the episode, ticks one box, and publishes.',
points: ['The podcast is the article word for word, so one review covers both',
'A match rating shows before they start; below 100% they must listen',
'Nothing goes live without that one confirmation'],
scene: () => `
Podcast version100% matchevery sentence is the article’s, in order
Confirmed by☑ Read the article ☐ Listenedeither one is enough at 100%
ThenPublisharticle and episode go live together
` },
{ key: 'live', label: 'Live', title: 'Live, and heard as well as read',
text: 'The guide goes up with its sources and a Listen button that plays its podcast episode. The next round starts from a library that knows what it already has.',
points: ['Sources listed under the article, numbered as cited',
'The episode is on the podcast page and in the feed',
'Next round: new questions, nothing repeated'],
scene: () => `
✓Reviewed by the expertreading or listening, one confirmation
✓Guide publishedwith its numbered sources
✓Listen button plays its episodeword for word, two AI voices
✓Added to the library listso the next round won’t repeat it
` }
];
root.innerHTML = `
How it works.
One article’s trip, from a question to a reviewed, published guide
${steps.map((s, i) => `
${s.label}
`).join('')}
`;
const st = [...root.querySelectorAll('.rf-st')];
const copy = root.querySelector('.rf-copy');
const scene = root.querySelector('.rf-scene');
const fill = root.querySelector('.rf-fill');
const token = root.querySelector('.rf-token');
const track = root.querySelector('.rf-track');
const play = root.querySelector('.rf-play');
const where = root.querySelector('.rf-where');
let i = 0, playing = false, timers = [];
const clear = () => { timers.forEach(clearTimeout); timers = []; };
const later = (ms, fn) => timers.push(setTimeout(fn, ms));
function place() {
const a = st[0].getBoundingClientRect(), b = st[i].getBoundingClientRect(), t = track.getBoundingClientRect();
const x0 = a.left + a.width / 2 - t.left, x = b.left + b.width / 2 - t.left;
fill.style.setProperty('width', `${Math.max(0, x - x0)}px`);
token.style.setProperty('left', `${x}px`);
}
function show(n, auto) {
clear();
i = Math.max(0, Math.min(steps.length - 1, n));
const s = steps[i];
st.forEach((el, k) => { el.classList.toggle('now', k === i); el.classList.toggle('done', k < i); });
st.forEach((el, k) => el.querySelector('button').setAttribute('aria-current', k === i ? 'step' : 'false'));
copy.innerHTML = `