diff --git a/README.md b/README.md index 9bed3ba..304bb46 100644 --- a/README.md +++ b/README.md @@ -397,6 +397,8 @@ The UI texts live in flat JSON files in [`web/src/locales/`](web/src/locales/), The vast majority of this project's code was written by [Claude Code](https://claude.com/claude-code) (Anthropic's Claude), working iteratively with the repo owner one feature at a time. +Country flags use the [Twemoji Country Flags](https://github.com/talkjs/country-flag-emoji-polyfill) font, artwork from [Twemoji](https://github.com/twitter/twemoji) under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). + ## 🌈 In Memory of Akimo diff --git a/web/src/App.css b/web/src/App.css index eebc57c..4af9d7b 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -2322,6 +2322,25 @@ display: block; } +/* Flags from the Twemoji Country Flags font (CC-BY 4.0), because Chromium on + Windows has no flag emoji and shows the two letters instead. unicode-range + keeps the font to flag characters and loads it only when one is shown. */ +@font-face { + font-family: "Twemoji Country Flags"; + src: url("./assets/fonts/TwemojiCountryFlags.woff2") format("woff2"); + unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; + font-display: swap; +} + +.ts-flag { + font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; +} + +.ts-talk-lamp-away { + font-size: 11px; + line-height: 1; +} + .ts-client-icons { display: inline-flex; align-items: center; diff --git a/web/src/App.tsx b/web/src/App.tsx index f6d4198..0d5df12 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1350,10 +1350,10 @@ function TalkLamp({ ); if (away) { - return icon( - t("tree.away"), - "away", - + return ( + ); } @@ -1797,7 +1797,6 @@ function ChannelTree({ className="ts-client-avatar" isSelf={c.id === ownClientId} /> - {tree.flags && countryFlag(c.country) && {countryFlag(c.country)}} {c.name} {tree.awayMessage && c.away && c.awayMessage && ( ({c.awayMessage}) @@ -1806,6 +1805,9 @@ function ChannelTree({ {clientGroupBadges(c).map((g) => ( ))} + {tree.flags && countryFlag(c.country) && ( + {countryFlag(c.country)} + )} @@ -2014,7 +2016,7 @@ function InfoPanel({
{t("info.country")}{" "} - {countryFlag(client.country) ? `${countryFlag(client.country)} ` : ""} + {countryFlag(client.country) && {countryFlag(client.country)} } {client.country}
diff --git a/web/src/assets/fonts/TwemojiCountryFlags.woff2 b/web/src/assets/fonts/TwemojiCountryFlags.woff2 new file mode 100644 index 0000000..b9d6ea8 Binary files /dev/null and b/web/src/assets/fonts/TwemojiCountryFlags.woff2 differ