Auto-fill username + live emoji reactions

- initAuth() now sets joinName.value to logged-in username (no more hardcoded "Danny")
- Migration V6: active_emojis TEXT column on gtl_rooms
- api.php send_emoji action: appends emoji+timestamp to room, prunes entries >4s old, max 20
- loadRoom() returns activeEmojis filtered to last 4 seconds
- render() skips emoji list when diffing state (prevents poll thrash)
- Floating emoji stage: new emojis animate upward from bottom, deduplicated by ID
- Emoji bar (4 buttons: sheep/fire/laugh/thumbs) shown in player waiting card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
danny 2026-06-14 12:35:13 +02:00
parent 01cd98aaf4
commit 758001597c
3 changed files with 92 additions and 4 deletions

View file

@ -6,7 +6,7 @@
*/
declare(strict_types=1);
const LATEST_MIGRATION = 5;
const LATEST_MIGRATION = 6;
function runMigrations(PDO $pdo, string $dbname): void
{
@ -143,6 +143,13 @@ function runMigrations(PDO $pdo, string $dbname): void
'TINYINT(1) NOT NULL DEFAULT 0 AFTER round_outcome');
markMigration($pdo, 5);
}
// ── V6: Live-Emoji-Reaktionen ──────────────────────────────
if ($current < 6) {
addColumnIfMissing($pdo, $dbname, 'gtl_rooms', 'active_emojis',
'TEXT NULL DEFAULT NULL AFTER voting_open');
markMigration($pdo, 6);
}
}
// ── Hilfsfunktionen ──────────────────────────────────────────