// DemoKanban.jsx — auto-looping demo: pipeline CRM (kanban). // O cursor agarra uma oportunidade e arrasta-a de Qualificação para Proposta — // ghost flutuante, coluna destacada, pulso ao largar, totais a atualizar. (function () { const STR = { pt: { windowTitle: 'Clientes · Pipeline', badge: '4 oportunidades', moving: 'A mover…', toast: 'Oportunidade movida para Proposta', cardSchoolBraga: 'Escola Machico Norte', cardSchoolEvora: 'Escola Ponta do Sol', cols: [ { name: 'Contacto', dot: '#60A5FA' }, { name: 'Proposta', dot: '#A78BFA' }, { name: 'Negociação', dot: '#F59E0B' }, ], }, en: { windowTitle: 'Clients · Pipeline', badge: '4 opportunities', moving: 'Moving…', toast: 'Opportunity moved to Proposal', cardSchoolBraga: 'Machico North School', cardSchoolEvora: 'Ponta do Sol School', cols: [ { name: 'Contact', dot: '#60A5FA' }, { name: 'Proposal', dot: '#A78BFA' }, { name: 'Negotiation', dot: '#F59E0B' }, ], }, es: { windowTitle: 'Clientes · Pipeline', badge: '4 oportunidades', moving: 'Moviendo…', toast: 'Oportunidad movida a Propuesta', cardSchoolBraga: 'Escuela Machico Norte', cardSchoolEvora: 'Escuela Ponta do Sol', cols: [ { name: 'Contacto', dot: '#60A5FA' }, { name: 'Propuesta', dot: '#A78BFA' }, { name: 'Negociación', dot: '#F59E0B' }, ], }, }; function KBCard({ title, company, value, owner, ghost }) { return (
{title}
{company}
{value} {owner}
); } function KBColumn({ col, count, total, hot, children }) { return (
{col.name} {count}
{total}
{children}
); } function DemoKanban() { const lang = (window.__DEMO_LANG === 'en' || window.__DEMO_LANG === 'es') ? window.__DEMO_LANG : 'pt'; const s = STR[lang]; const D = 8500; const t = window.useDemoLoop(D, 7600); const { dkCursor } = window; const { DemoCursor, DemoToast, MiniWindow, DemoStage } = window; const dragging = t >= 2400 && t < 3400; const dropped = t >= 3400; const toast = t >= 4000 && t < 7400; // mover card: container-relative absolute position (col 0 slot 2 → col 1 slot 2) const pos = (dragging || dropped) ? { x: 191, y: 118 } : { x: 20, y: 118 }; const cur = dkCursor(t, [ { at: 0, x: 540, y: 390, hidden: true }, { at: 1200, x: 540, y: 390 }, { at: 1400, x: 108, y: 261 }, { at: 2400, x: 279, y: 261 }, { at: 5200, x: 540, y: 390, hidden: true }, ], [2200]); cur.down = cur.down || dragging; return ( {s.badge} }>
{/* reserved space where the mover sits before the drag */}
{dragging &&
{s.moving}
}
{/* the mover card — floats above the columns */}
); } window.DemoKanban = DemoKanban; })();