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
2 changes: 1 addition & 1 deletion README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Alertas, chat y widgets de directo para tu **programa de emisión (Meld u OBS)**
antena se queda entera en tu PC y le da a tu directo una capa completa de alertas e interacción:

- **Alertas** de Twitch (seguidores, subs, resubs, subs regaladas, bits y Power-ups, raids, recompensas) y YouTube (suscriptores nuevos, Super Chats, Super Stickers, miembros, hitos y membresías regaladas), más una bienvenida editable al primer mensaje y alertas de racha (oficial de Twitch; local de YouTube). Tabla evento → alerta: [docs/eventos.md](docs/eventos.md).
- **Tres diseños por alerta:** la tarjeta 3D EGDEV; tu vídeo o imagen (webm con transparencia) con el mensaje encima, colocado donde quieras; o **vídeo + tarjeta**: tu vídeo o imagen de fondo a pantalla completa y encima la tarjeta 3D, con retraso de entrada y ajuste de posición. Todos con CSS propio.
- **Tres diseños por alerta:** la tarjeta 3D EGDEV; tu vídeo o imagen (webm con transparencia) con el mensaje encima, colocado donde quieras; o **vídeo + tarjeta**: tu vídeo o imagen de fondo a pantalla completa y encima la tarjeta 3D, con retraso de entrada y posiciones independientes para fondo y tarjeta. En **Diseño › Posición del fondo**, X/Y desplazan la imagen o el vídeo en píxeles (X −1920…1920, Y −1080…1080); 0/0 mantiene el fondo centrado y los valores positivos mueven a la derecha/abajo. La tarjeta no se mueve. Todos con CSS propio.
- **Variaciones:** otra versión de la alerta según la cantidad, el tier, el usuario, el mensaje o una probabilidad.
- **Voz (TTS)** de los mensajes, **filtro** de palabras, enlaces y usuarios, y **pausa** con cola.
- **Acciones en el programa de emisión** al salir una alerta: cambiar de escena (y volver), mostrar u ocultar capas, efectos, escribir en el chat, hablar…
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Stream alerts, chat and widgets for your **broadcast program (Meld or OBS)** —
antena runs entirely on your PC and gives your stream a full alert and interaction layer:

- **Alerts** from Twitch (followers, subs, resubs, gifted subs, bits and Power-ups, raids, rewards) and YouTube (new subscribers, Super Chats, Super Stickers, members, milestones and gifted memberships), plus an editable first-message welcome and watch-streak alerts (official Twitch; local YouTube). Event → alert table: [docs/eventos.md](docs/eventos.md).
- **Three designs per alert:** the EGDEV 3D card; your own video or image (webm with transparency) with the message on top, placed wherever you want; or **video + card**: your video or image as a full-screen background with the 3D card on top, with an entry delay and position offset. All with your own CSS.
- **Three designs per alert:** the EGDEV 3D card; your own video or image (webm with transparency) with the message on top, placed wherever you want; or **video + card**: your video or image as a full-screen background with the 3D card on top, with an entry delay and independent background/card position offsets. In **Design › Background position**, X/Y move either image or video in pixels (X −1920…1920, Y −1080…1080); 0/0 keeps the background centered, positive values move right/down. Card position is unchanged. All with your own CSS.
- **Variations:** another version of the alert depending on the amount, the tier, the user, the message or a probability.
- **Voice (TTS)** for messages, **filtering** of words, links and users, and **pause** with queue.
- **Actions in the broadcast program** when an alert fires: change scene (and switch back), show or hide layers, effects, write in chat, speak…
Expand Down
1 change: 1 addition & 0 deletions app/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface AlertConfig {
enabled?: boolean;
layout?: 'card' | 'media' | 'mixed';
cardX?: number; cardY?: number;
bgX?: number; bgY?: number;
media?: string;
sound?: string;
soundVolume?: number;
Expand Down
8 changes: 6 additions & 2 deletions app/src/panel/views/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const FIELD_TAB: Record<string, string> = {
actions: 'actions', css: 'css', name: 'head', enabled: 'head',
};
export const fieldTab = (f: string) => FIELD_TAB[f] || 'design';
const FIELD_LABEL: Record<string, string> = { media: 'vídeo o imagen', layout: 'diseño', sound: 'sonido', soundVolume: 'volumen', title: 'antetítulo', text: 'texto', sub: 'línea de apoyo', actions: 'acciones', css: 'CSS', ttsEnabled: 'voz', ttsTemplate: 'voz', durationMs: 'duración', accentColor: 'color', textColor: 'color', cardX: 'posición', cardY: 'posición', textDelayMs: 'retraso' };
const FIELD_LABEL: Record<string, string> = { media: 'vídeo o imagen', layout: 'diseño', sound: 'sonido', soundVolume: 'volumen', title: 'antetítulo', text: 'texto', sub: 'línea de apoyo', actions: 'acciones', css: 'CSS', ttsEnabled: 'voz', ttsTemplate: 'voz', durationMs: 'duración', accentColor: 'color', textColor: 'color', cardX: 'posición', cardY: 'posición', bgX: 'posición del fondo', bgY: 'posición del fondo', textDelayMs: 'retraso' };
function replaceTarget(s: any, t: Target, value: any) {
const cfg = { ...s.config };
const mapList = (list: any[], id: string) => list.map(x => (x.id === id ? value : x));
Expand Down Expand Up @@ -478,9 +478,13 @@ export function Editor({ target }: { target: Target }) {
{when.mixed && R('textDelayMs', 'Retraso de la tarjeta', 0, 6, 0.1, 's', true)}
</div>
{when.card && <p className="hint">La tarjeta 3D de la marca: icono, antetítulo, nombre y línea de apoyo. Cambia su aspecto en la pestaña CSS.</p>}
{when.mixed && box('Posición del fondo', <>
<div className="row2">{R('bgX', 'Horizontal (X)', -1920, 1920, 10, 'px')}{R('bgY', 'Vertical (Y)', -1080, 1080, 10, 'px')}</div>
<p className="hint">Mueve solo el vídeo o la imagen, sin desplazar la tarjeta. 0/0 = fondo centrado; valores positivos hacia la derecha y abajo, negativos hacia la izquierda y arriba.</p>
</>)}
{when.mixed && box('Posición de la tarjeta', <>
<div className="row2">{R('cardX', 'Ajuste horizontal', -900, 900, 10, 'px')}{R('cardY', 'Ajuste vertical', -500, 500, 10, 'px')}</div>
<p className="hint">Parte de la posición del tema (Apariencia › Forma y posición) y la mueve sobre el fondo. 0/0 = donde sale la tarjeta normal. El fondo ocupa toda la capa de 1920×1080: un webm con transparencia deja ver la escena.</p>
<p className="hint">Parte de la posición del tema (Apariencia › Forma y posición) y la mueve sobre el fondo. 0/0 = donde sale la tarjeta normal. El tamaño y la posición del fondo se ajustan por separado; un webm con transparencia deja ver la escena.</p>
</>)}
{when.media && box('Posición y estilo del texto', <>
<div className="row3">{R('textX', 'X', 0, 100, 1, '%')}{R('textY', 'Y', 0, 100, 1, '%')}{R('textWidth', 'Ancho', 20, 140, 1, '%')}</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/estado.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sigue sin dependencias (Node ≥ 24); React, esbuild y Tauri son solo de compila
- **Mensajes en pantalla:** `/widget/rotator` (1200×120) rota una lista ordenada de mensajes propios, distinta de los mensajes programados del chat: `widgets.rotator` con `label`, `messages` ([{ id, text }], máx. 50), `intervalSec` (5–3600, de un inicio al siguiente), `durationSec` (visible, recortado al intervalo) y `order` (`sequential` o `random`: cada ronda muestra todos una vez y nunca repite el mismo dos veces seguidas). Lógica pura en `public/widgets/rotator-core.js`; la vista previa rota cada 5 s. Se puede incrustar como hueco `rotator` en overlays propios.
- **Alertas de Twitch y YouTube:** tipos normalizados (follow, sub, resub, giftsub,
cheer, raid, redemption; ytsub, superchat, supersticker, member, milestone, giftmember, jewels) con
tres diseños (tarjeta, vídeo con texto y vídeo de fondo + tarjeta), variaciones, voz y acciones en el programa de emisión.
tres diseños (tarjeta, vídeo con texto y vídeo de fondo + tarjeta), variaciones, voz y acciones en el programa de emisión. En el diseño mixto, el fondo de imagen o vídeo tiene posición X/Y independiente de la tarjeta (0/0 centrado).
Los regalos Jewels se agrupan por combo; cuentan como eventos, no como euros de Super Chat.
- **Suscriptores de YouTube (#134):** alerta `ytsub` para suscripciones públicas detectadas durante la escucha, con intervalo configurable y parada por cuota.
- **Bienvenida (#289):** alerta pequeña y editable en el primer mensaje por persona y plataforma, con variación para quien ya habló en directos archivados. Activada de serie, sin mensajes propios ni usuarios bloqueados; el máximo de cinco alertas pendientes evita inundar la cola.
Expand Down
4 changes: 3 additions & 1 deletion public/overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

/* animaciones de entrada y salida del diseño 2 */
/* diseño 3: mixta (vídeo o imagen de fondo + tarjeta EGDEV encima) */
.alert-bg{position:fixed;inset:0;display:grid;place-items:center;pointer-events:none;opacity:0;transition:opacity .35s ease-out}
.alert-bg{position:fixed;inset:0;display:grid;place-items:center;translate:var(--bg-x,0px) var(--bg-y,0px);pointer-events:none;opacity:0;transition:opacity .35s ease-out}
.alert-bg.on{opacity:1}
.alert-bg.out{opacity:0;transition-duration:.45s}
.alert-bg .alert-media{width:calc(100vw * var(--bg-size,1));height:calc(100vh * var(--bg-size,1));object-fit:contain}
Expand Down Expand Up @@ -424,6 +424,8 @@
const bg = document.createElement('div');
bg.className = 'alert-bg type-' + a.type;
bg.style.setProperty('--bg-size', Math.max(0.05, L.mediaSize / 100));
bg.style.setProperty('--bg-x', (L.bgX ?? 0) + 'px');
bg.style.setProperty('--bg-y', (L.bgY ?? 0) + 'px');
const src = '/media/' + encodeURIComponent(L.media);
let el;
if (L.mediaKind === 'video') {
Expand Down
5 changes: 3 additions & 2 deletions src/alerts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const LOOK_DEFAULTS = {
animIn: 'pop', // pop | fade | slide | zoom | none
animOut: 'fade', // fade | slide | zoom | none
cardX: 0, cardY: 0, // mixta: ajuste de la tarjeta sobre el fondo (px, desde la posición del tema)
bgX: 0, bgY: 0, // mixta: ajuste independiente del fondo desde el centro del lienzo (px)
css: '',
};

Expand All @@ -80,7 +81,7 @@ export const ALERT_FIELDS = {
layout: ['card', 'media', 'mixed'], media: 'string', mediaSize: 'number', mediaVolume: 'number',
sound: 'string', soundVolume: 'number', durationMode: ['fixed', 'media'], textDelayMs: 'number',
textX: 'number', textY: 'number', textWidth: 'number', textAlign: ['left', 'center', 'right'], fontSize: 'number',
textColor: 'string', accentColor: 'string', cardX: 'number', cardY: 'number', animIn: ['pop', 'fade', 'slide', 'zoom', 'none'], animOut: ['fade', 'slide', 'zoom', 'none'],
textColor: 'string', accentColor: 'string', cardX: 'number', cardY: 'number', bgX: 'number', bgY: 'number', animIn: ['pop', 'fade', 'slide', 'zoom', 'none'], animOut: ['fade', 'slide', 'zoom', 'none'],
css: 'string', ttsEnabled: 'boolean', ttsTemplate: 'string', ttsMinAmount: 'number', actions: 'array',
};

Expand Down Expand Up @@ -287,7 +288,7 @@ function pickLook(cfg) {
// sin archivo, «vídeo» y «mixta» caen a la tarjeta
out.layout = ['media', 'mixed'].includes(out.layout) && out.media ? out.layout : 'card';
out.mediaKind = out.media ? mediaKind(out.media) : null;
for (const k of ['mediaSize', 'mediaVolume', 'soundVolume', 'textDelayMs', 'textX', 'textY', 'textWidth', 'fontSize', 'cardX', 'cardY']) out[k] = Number(out[k]) || 0;
for (const k of ['mediaSize', 'mediaVolume', 'soundVolume', 'textDelayMs', 'textX', 'textY', 'textWidth', 'fontSize', 'cardX', 'cardY', 'bgX', 'bgY']) out[k] = Number(out[k]) || 0;
return out;
}

Expand Down
1 change: 1 addition & 0 deletions src/config-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const condiciones = {
const hojasAlerta = {
enabled: bool, title: str, text: str, sub: str,
durationMs: num({ min: 0 }), minAmount: num({ min: 0 }),
bgX: num({ min: -1920, max: 1920, def: 0 }), bgY: num({ min: -1080, max: 1080, def: 0 }),
layout: en(['card', 'media', 'mixed']), cardX: num({ min: -1920, max: 1920 }), cardY: num({ min: -1080, max: 1080 }), media: str, mediaSize: num({ min: 0 }), mediaVolume: num({ min: 0, max: 100 }),
sound: str, soundVolume: num({ min: 0, max: 100 }), durationMode: en(['fixed', 'media']), textDelayMs: num({ min: 0 }),
textX: num({ min: 0, max: 100 }), textY: num({ min: 0, max: 100 }), textWidth: num({ min: 0 }), // textX/Y: porcentajes reales
Expand Down
2 changes: 1 addition & 1 deletion src/mcp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const TYPES = ['follow', 'sub', 'resub', 'giftsub', 'cheer', 'raid', 'redemption
const tipo = S.enum('Tipo de alerta. Twitch: follow, sub, resub, giftsub, cheer (bits), raid, redemption (recompensas). YouTube: superchat, supersticker, member, milestone, giftmember, jewels (regalo de YouTube). Récord de espectadores a la vez: viewers (Twitch) y ytviewers (YouTube), variables {amount} y {previous}. Bienvenida: welcome, variables {user}, {returning} y {platform}. Racha: streak, variables {user}, {platform}, {count}; en Twitch también {message} y {channelPointsAwarded}.', TYPES);
const ALERT_HELP = `Campos de una alerta (todos opcionales):
- enabled (bool), title/text/sub (plantillas con {user} {amount} {message} {months} {tier} {reward} {input} {amountText} {level} {platform} {count} {channelPointsAwarded}; en Jewels también {giftName}), durationMs, minAmount
- layout: "card" (tarjeta EGDEV) | "media" (vídeo o imagen con el texto encima) | "mixed" (vídeo o imagen de fondo a pantalla completa y encima la tarjeta EGDEV; textDelayMs = retraso de la tarjeta, cardX/cardY = ajuste en px); media (archivo de media/), mediaSize %, mediaVolume %
- layout: "card" (tarjeta EGDEV) | "media" (vídeo o imagen con el texto encima) | "mixed" (vídeo o imagen de fondo a pantalla completa y encima la tarjeta EGDEV; textDelayMs = retraso de la tarjeta, cardX/cardY = ajuste de la tarjeta en px, bgX/bgY = ajuste independiente del fondo desde el centro en px, 0/0 centrado, X entre -1920 y 1920, Y entre -1080 y 1080); media (archivo de media/), mediaSize %, mediaVolume %
- sound ("default" | "none" | archivo de audio), soundVolume %, durationMode ("fixed" | "media" = lo que dure el vídeo), textDelayMs
- textX/textY/textWidth (% dentro del recurso), textAlign (left|center|right), fontSize px, textColor, accentColor, animIn (pop|fade|slide|zoom|none), animOut (fade|slide|zoom|none)
- css: CSS propio de la alerta. Gana siempre a los estilos de serie (no hace falta !important). Clases: .alert (raíz, con .type-<tipo>, .alert-card o .alert-media-layout; .on mientras se ve, .out al salir), .alert-box, .alert-text, .alert-title, .alert-name, .alert-sub (y .alert-sub b), tarjeta: .card, .alert-icon, .alert-platform, .alert-timer, .alert-glow, .alert-dots, .alert-cube; vídeo: .alert-media; mixta: .alert-bg (fondo, con .alert-media dentro) y la tarjeta como .alert-card.alert-mixed. Variables de la tarjeta en .alert { }: --accent, --title-color, --name-color, --sub-color, --hl-color, --card-width, --card-radius, --card-padding, --card-bg, --border-width, --border-color, --tile-size, --icon-size, --icon-color, --title-size, --name-size, --sub-size, --font-title, --font-name, --font-sub, --tilt, --reflection. Ej.: ".alert { --accent: #00E0FF; --tilt: none; }"
Expand Down
Loading
Loading