From e5c2c8af5227fb7a546933d26ffbbb40fada3e8c Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 18 Jul 2020 08:29:56 -0500 Subject: [PATCH] ui: channel sizeness --- src/client/channel.jsx | 6 +++++- src/client/channel.scss | 8 ++++++++ src/client/chat.jsx | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/client/channel.jsx b/src/client/channel.jsx index fe22df6..e5e796e 100644 --- a/src/client/channel.jsx +++ b/src/client/channel.jsx @@ -20,7 +20,11 @@ export default function Channel(props) { href ? ( = 12}, + {superlong: name.length >= 16}, + )} to={href} > {prefix} diff --git a/src/client/channel.scss b/src/client/channel.scss index aebfa77..ee1c9a0 100644 --- a/src/client/channel.scss +++ b/src/client/channel.scss @@ -14,6 +14,14 @@ font-size: 0.8em; margin-right: 0.125em; } + &.long { + font-size: 0.8em; + padding: 1.4em; + } + &.superlong { + font-size: 0.6em; + padding: 2em; + } } .channel__actions { diff --git a/src/client/chat.jsx b/src/client/chat.jsx index fd7a35c..da63384 100644 --- a/src/client/chat.jsx +++ b/src/client/chat.jsx @@ -50,13 +50,13 @@ export default function Chat() { ref.current.classList.add('moving'); const offset = pageX - origin.point + origin.left; const snapped = Math.abs(offset) < 64 ? 0 : offset; - const max = Math.min(window.innerWidth - 32, (2 + 16) * 16); + const max = Math.min(window.innerWidth - 32, 25 * 16); ref.current.style.left = `${Math.max(-max, Math.min(max, snapped))}px`; } }, up: () => { const left = parseInt(ref.current.style.left, 10); - const max = Math.min(window.innerWidth - 32, (2 + 16) * 16); + const max = Math.min(window.innerWidth - 32, 25 * 16); if (left >= max / 2) { ref.current.style.left = `${max}px`; }