diff --git a/README.md b/README.md index d46ee12..1cddb12 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ We give you a shareable URL and we'll randomly pick your side; the next person g Anyone else who opens the link is a spectator. +Players can react with any emoji using the built-in emoji picker. + ## Links - Production: https://tinychess.bitchimfabulo.us diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 7fb13ba..13dbf5c 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -191,11 +191,6 @@ func (h *Handler) HandleReact(w http.ResponseWriter, r *http.Request) { return } - if !isAllowedEmoji(body.Emoji) { - WriteJSON(w, http.StatusOK, map[string]any{"ok": false, "error": "unsupported emoji"}) - return - } - canReact, wait := g.CanReact(body.Sender) if !canReact { WriteJSON(w, http.StatusOK, map[string]any{"ok": false, "error": fmt.Sprintf("cooldown %ds", wait)}) diff --git a/internal/handlers/middleware.go b/internal/handlers/middleware.go index 6e279dc..2210cf7 100644 --- a/internal/handlers/middleware.go +++ b/internal/handlers/middleware.go @@ -61,17 +61,3 @@ func parseSquare(s string) chess.Square { } return chess.Square(rank*8 + file) } - -// isAllowedEmoji checks if an emoji is in the allowed list -func isAllowedEmoji(emoji string) bool { - allowed := map[string]struct{}{ - "ð": {}, "ð": {}, "âĪïļ": {}, "ð ": {}, "ðĒ": {}, "ð": {}, "ð": {}, - "ð": {}, "ðĪĢ": {}, "ð": {}, "ðĪ": {}, "ð": {}, "ð": {}, "ðī": {}, "ðŦĄ": {}, "ðĪŊ": {}, "ðĪĄ": {}, - "âïļ": {}, "â": {}, "â": {}, "â": {}, "â": {}, "â": {}, "âąïļ": {}, "ðģïļ": {}, "ð": {}, "ð": {}, - "ðĨ": {}, "ð": {}, "ðĐļ": {}, "âĄ": {}, "ð": {}, "ðģïļ": {}, "ðŊ": {}, "ðĨ": {}, "ð§ ": {}, - "ðŋ": {}, "â": {}, "ðĒ": {}, "ð": {}, "ðĪ": {}, "ðĪŽ": {}, - "ðŠĶ": {}, "ð": {}, "ð": {}, "ð": {}, "ðĶ": {}, "ð": {}, - } - _, ok := allowed[emoji] - return ok -} diff --git a/internal/templates/game.html b/internal/templates/game.html index 5cc92ec..cb908ad 100644 --- a/internal/templates/game.html +++ b/internal/templates/game.html @@ -79,11 +79,12 @@ } .wrap { - max-width: 1000px; + max-width: 640px; margin: 0 auto; padding: 16px; - display: grid; - grid-template-columns: 1fr 320px; + display: flex; + flex-direction: column; + align-items: center; gap: 16px; } @@ -172,6 +173,7 @@ border: 1px solid #2a3345; border-radius: 12px; padding: 12px; + width: 100%; } .btn { @@ -278,12 +280,6 @@ border-radius: 4px; } - .reactions { - display: flex; - gap: 6px; - flex-wrap: wrap; - } - .react { font-size: 18px; background: transparent; @@ -350,11 +346,6 @@ } } - @media (max-width: 860px) { - .wrap { - grid-template-columns: 1fr; - } - } @@ -409,7 +400,6 @@
Tip: Click one square, then another to move. Promotions auto-queen. @@ -443,7 +433,11 @@