Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ antena se queda entera en tu PC y le da a tu directo una capa completa de alerta
- **Comandos de chat** (`!engram`, `!web`…) que lanzan sus propias alertas, con permisos y esperas.
- **Mensajes programados:** textos que se publican solos en el chat cada X minutos (también como anuncio destacado) y, si quieres, salen además como alerta en pantalla.
- **Interactivos:** cola de preguntas del chat, tier list que vota el chat y sorteos con ruleta en pantalla.
- **Widgets:** chat en pantalla (Twitch + YouTube), objetivos, últimos apoyos, ticker, espectadores en directo, agradecimientos a seguidores sin conexión y créditos finales.
- **Widgets:** chat en pantalla (Twitch + YouTube), objetivos, últimos apoyos, ticker, espectadores en directo, agradecimientos a seguidores sin conexión, barra de redes sociales y créditos finales.
- **Overlays propios:** capas de HTML, CSS y JavaScript para una escena o para enmarcar la cámara, escritas por ti o por Claude por MCP, con datos en vivo y acciones que apruebas tú.
- **Resumen del directo:** totales, a quién dar las gracias y la cronología con el minuto de cada evento, en Markdown.
- **Seguidores sin conexión:** registra los seguidores de Twitch ganados mientras antena estaba cerrada y, en YouTube, las suscripciones públicas y un recuento anónimo; YouTube requiere conectar la cuenta.
Expand Down Expand Up @@ -167,9 +167,12 @@ En el panel, la página «Fuentes del programa de emisión» lista todas con su
| Espectadores | `http://127.0.0.1:4500/widget/viewers` | 900×160 |
| Agradecimientos | `http://127.0.0.1:4500/widget/thanks` | 900×200 |
| Entrevista | `http://127.0.0.1:4500/widget/interview` | 1920×1080 |
| Redes sociales | `http://127.0.0.1:4500/widget/socials` | 1600×80 |

**Últimos y ticker.** Son dos widgets separados en **Widgets**. «Últimos» muestra el último apoyo de cada tipo marcado (seguidor, sub, bits, raid, Super Chat, miembro o cualquier evento), con una etiqueta opcional (`widgets.latest.label`; vacía no se muestra, clase `.label`). El ticker, en cambio, recorre los eventos más recientes de sus tipos, así que pueden salir varias subs seguidas. Usa los tipos de «Últimos» hasta que eliges los suyos (`widgets.ticker.items`, mismos valores).

**Redes sociales.** En **Widgets › Redes sociales** (`/widget/socials`, 1600×80) añades, editas, quitas y ordenas hasta 12 redes (Twitch, YouTube, X, Instagram, TikTok, GitHub, Discord, Kick, LinkedIn y Web); cada una sale con el icono de su plataforma y tu nick, como texto. Las redes sin nick no se muestran y, sin redes, la capa queda vacía. Etiqueta opcional (por ejemplo «Sígueme») y CSS propio con las clases `.root`, `.label`, `.item`, `.item-<plataforma>`, `.ico` y `.handle`. Los iconos de marca vienen de Simple Icons (CC0); X, TikTok y GitHub van en blanco para verse sobre fondo oscuro. Los perfiles viven en `widgets.socials` y, como el resto de ajustes de widgets, viajan con los temas guardados. Se puede incrustar como hueco `socials` en overlays propios; por MCP, `editar_widget` con `widget: "socials"` (la lista se sustituye entera).

**Entrevista.** Capa a pantalla completa para el ítem activo y aprobado de la entrevista activa (ver `docs/entrevista-formato.md`): la pregunta en una tarjeta inferior sobre su imagen, vídeo local, reproductor de YouTube (desde el minuto guardado) o tarjeta de post, con la fuente en cada ítem que lleve media. Sin ítem activo la capa queda vacía. En **Widgets › Se manejan en directo › Entrevista** creas o importas entrevistas, editas y ordenas rondas y preguntas y pulsas **Guardar** para aplicar el borrador. La cabecera del detalle elige o para la entrevista activa y controla la capa; el dock también permite pararla sin borrarla. `POST /api/interviews/stop` hace lo mismo y se puede repetir sin riesgo. En **Capa** están la URL y la vista previa de ejemplo. Las notas privadas nunca salen en la capa. Pruébala con `?demo`.

**Agradecimientos sin conexión.** Esta capa muestra un seguidor pendiente cada vez y puede terminar con el recuento anónimo de YouTube. En Widgets › Agradecimientos eliges plataformas, todo el tiempo / desde el último directo archivado / un número de días, máximo de nombres e intervalo. Las fechas desconocidas se incluyen; si no hay directos archivados, la ventana desde el último no tiene corte. Sin pendientes la capa queda transparente. Las acciones individuales y en bloque con confirmación se aplican al momento; el bloque marca solo los nombres y registros anónimos seleccionados con los ajustes guardados, no los demás pendientes.
Expand Down Expand Up @@ -326,7 +329,7 @@ antena.slots.clear('chat'); // clear() borra todos sin animación

Solo cambian los huecos nombrados; los demás conservan su estado. Nombres `a-z0-9_-` (hasta 32 caracteres). Cada hueco admite `widget`, `params` opcional, `rect` (píxeles del lienzo `[x,y,w,h]` o `null`), `enter`/`exit` (`none`, `fade`, `left`, `right`, `up`, `down`; por defecto `fade`), `layer` (`above` por defecto o `below`), `fit` (`slot` por defecto o `canvas`) y `css` adicional tras el CSS propio del widget. `slot` hace que `.root` llene el rectángulo; `canvas` llena el lienzo y conserva posición y animaciones propias. Cambiar widget o parámetros recarga su página. No devuelven nada; los datos inválidos se ignoran y se avisan una vez en la consola del overlay. Por seguridad, el CSS del hueco rechaza tokens de carga de recursos (`url`, `image-set`, `image(`, `src(`, `@import`, `@namespace`, `@font-face`), escapes y comentarios: se ejecuta en una página de confianza y no debe hacer peticiones en nombre del marco aislado.

Permitidos: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `alerts` y `custom` (`id` de otro overlay). Sin URLs arbitrarias, autoinclusión ni overlays propios dentro de otro incrustado. Máximo 12 huecos; rects finitos, ancho/alto 1–4320 y x/y dentro de ±2 dimensiones del lienzo. Las actualizaciones se agrupan por frame y limitan a 20/s. La shell incrusta estas páginas públicas sin permisos de acción y mantiene aislado el marco del usuario.
Permitidos: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `socials`, `alerts` y `custom` (`id` de otro overlay). Sin URLs arbitrarias, autoinclusión ni overlays propios dentro de otro incrustado. Máximo 12 huecos; rects finitos, ancho/alto 1–4320 y x/y dentro de ±2 dimensiones del lienzo. Las actualizaciones se agrupan por frame y limitan a 20/s. La shell incrusta estas páginas públicas sin permisos de acción y mantiene aislado el marco del usuario.

Las alertas y entrevistas incrustadas silencian audio cuando Page Visibility indica que el overlay está oculto; el vídeo YouTube de entrevista se reinicia al volver a verse. **No se ha comprobado la visibilidad fuera de escena en Meld**: usa una sola fuente de navegador y capas Duplicator en las demás escenas para evitar audio duplicado aunque Meld no marque ocultas las fuentes.

Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ antena runs entirely on your PC and gives your stream a full alert and interacti
- **Chat commands** (`!engram`, `!web`…) that trigger their own alerts, with permissions and cooldowns.
- **Scheduled messages:** texts that post themselves to chat every X minutes (also as a highlighted announcement) and, if you want, also appear on screen as an alert.
- **Interactives:** chat question queue, a tier list the chat votes on, and giveaways with an on-screen roulette.
- **Widgets:** on-screen chat (Twitch + YouTube), goals, latest supporters, ticker, live concurrent viewers, offline follower thank-yous, rotating on-screen messages and end credits.
- **Widgets:** on-screen chat (Twitch + YouTube), goals, latest supporters, ticker, live concurrent viewers, offline follower thank-yous, rotating on-screen messages, a social bar and end credits.
- **Custom overlays:** HTML, CSS and JavaScript layers for a scene or to frame the camera, written by you or by Claude via MCP, with live data and actions you approve.
- **Stream recap:** totals, who to thank and a timeline with the minute of each event, in Markdown.
- **Offline followers:** records Twitch followers gained while antena was closed, and YouTube's public subscribers plus an anonymous count; YouTube requires a connected account.
Expand Down Expand Up @@ -168,6 +168,7 @@ In the panel, the «Fuentes del programa de emisión» page lists all of them wi
| Thank-yous | `http://127.0.0.1:4500/widget/thanks` | 900×200 |
| Interview | `http://127.0.0.1:4500/widget/interview` | 1920×1080 |
| On-screen messages | `http://127.0.0.1:4500/widget/rotator` | 1200×120 |
| Social bar | `http://127.0.0.1:4500/widget/socials` | 1600×80 |

**Latest and ticker.** They are separate widgets in **Widgets**. «Latest» shows the last supporter of each selected type (follower, sub, bits, raid, Super Chat, member or any event), with an optional label (`widgets.latest.label`; empty shows none, class `.label`). The ticker scrolls the most recent events of its types instead, so several subs can appear at once. It uses the «Latest» types until you pick its own (`widgets.ticker.items`, same values).

Expand Down Expand Up @@ -329,7 +330,7 @@ antena.slots.clear('chat'); // clear() removes all without animation

Only named slots change; unmentioned slots keep their state. Names use `a-z0-9_-` (up to 32 characters). Each slot has `widget`, optional `params`, `rect` (canvas pixels `[x,y,w,h]` or `null`), `enter`/`exit` (`none`, `fade`, `left`, `right`, `up`, `down`; default `fade`), `layer` (`above` by default or `below`), `fit` (`slot` by default or `canvas`) and optional extra `css` applied after the widget's own CSS. `slot` makes `.root` fill the rectangle; `canvas` fills the canvas and preserves the page's own positioning and animations. A changed widget or parameters reload its page. Calls return nothing; invalid input is ignored and reported once in the overlay console. For safety, slot CSS rejects resource-loading tokens (`url`, `image-set`, `image(`, `src(`, `@import`, `@namespace`, `@font-face`), CSS escapes and comments: it runs on a trusted same-origin page and must not make requests on the sandbox's behalf.

Allowed: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `rotator`, `alerts` and `custom` (`id` of another overlay). No arbitrary URLs, self-embedding or custom overlays nested inside another embedded overlay. Maximum 12 slots; finite rects, width/height 1–4320 and x/y within ±2 canvas dimensions. Updates are coalesced per animation frame and limited to 20/s. The shell embeds these public pages, so no action permission is needed; it keeps the user frame sandboxed.
Allowed: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `rotator`, `socials`, `alerts` and `custom` (`id` of another overlay). No arbitrary URLs, self-embedding or custom overlays nested inside another embedded overlay. Maximum 12 slots; finite rects, width/height 1–4320 and x/y within ±2 canvas dimensions. Updates are coalesced per animation frame and limited to 20/s. The shell embeds these public pages, so no action permission is needed; it keeps the user frame sandboxed.

Embedded alerts and interviews suppress audio while Page Visibility reports the overlay hidden; hidden YouTube interview media restarts when visible. **Meld's off-air visibility has not been verified**: use one browser source and Duplicator layers in other scenes to prevent duplicated audio even if Meld does not mark sources hidden.

Expand Down Expand Up @@ -384,6 +385,15 @@ The pause button also stops scheduled messages, automatic ones and «Send now».

The preview rotates every 5 s with your messages so you can check all of them. Custom overlays can embed it as the `rotator` slot. Via MCP: `editar_widget` with `widget: "rotator"`; the message list is replaced as a whole.

### Social bar

**Widgets › Redes sociales** (`/widget/socials`, 1600×80) shows your social profiles in a row: each platform's icon with your nick.

- **Networks:** add, edit, remove and reorder up to 12. Platforms: Twitch, YouTube, X, Instagram, TikTok, GitHub, Discord, Kick, LinkedIn and Web. A network without a nick is not shown; with no networks the layer stays empty.
- **Label** (for example «Sígueme»; empty hides it) and **custom CSS** with the classes `.root`, `.label`, `.item`, `.item-<platform>`, `.ico` and `.handle`.

Nicks are shown as text, never as markup. The brand icons come from Simple Icons (CC0); X, TikTok and GitHub use a white glyph so they stay visible on dark backgrounds (`.item-x .ico path { fill: … }` changes it). The profiles live in `widgets.socials`, so, like the other widget settings, they travel with saved themes. Custom overlays can embed it as the `socials` slot. Via MCP: `editar_widget` with `widget: "socials"`; the list is replaced as a whole.

### Questions, tier list and giveaway

They live in **Widgets** and each one has its browser layer. Their state (questions, votes, participants) is saved in `data/interactive.json` and survives a restart.
Expand Down
4 changes: 4 additions & 0 deletions app/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export interface FollowersList extends FollowerSelection { shown: FollowerSelect
export interface ThanksSnapshot { names: { name: string; platform: Platform }[]; anonymous: number }
/** Chat preview in the real sources (GET/POST /api/chat/preview, SSE chatPreview). */
export interface ChatPreviewState { on: boolean; until: string | null }
/** Social bar profile (widgets.socials.items). */
export interface SocialProfile { id: string; platform: string; handle: string }
export interface SocialsConfig { label?: string; items?: SocialProfile[]; css?: string }
export interface WidgetsConfig {
goals?: GoalConfig[];
chat?: WidgetSection;
Expand All @@ -195,6 +198,7 @@ export interface WidgetsConfig {
credits?: WidgetSection;
thanks?: ThanksConfig;
rotator?: RotatorConfig;
socials?: SocialsConfig;
[k: string]: unknown;
}
/** Estado que consumen los widgets (engine.widgetState()). */
Expand Down
2 changes: 1 addition & 1 deletion app/src/panel/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function Sidebar({ current }: { current: string }) {
const live = (t: string, label?: string) => <span className="nav-n is-live" aria-label={label}>{t}</span>;
const warns = alertWarnings(s).length;
const widgetTail = I.vote && I.giveaway?.open ? live('2 activos', 'votación en curso y sorteo abierto')
: I.vote ? live('votando', 'votación en curso') : I.giveaway?.open ? live('sorteo', 'sorteo abierto') : num(13);
: I.vote ? live('votando', 'votación en curso') : I.giveaway?.open ? live('sorteo', 'sorteo abierto') : num(14);
const groups: [string, string, Item[]][] = [
['directo', 'En directo', [
{ href: '#/directo', label: 'Directo', tail: s.status?.meld?.streaming ? live('●', 'en directo') : null },
Expand Down
Loading
Loading