From e105686b234a34825f0546906dd1e05503b8843a Mon Sep 17 00:00:00 2001 From: neoapps-dev Date: Sun, 14 Jun 2026 17:15:34 +0300 Subject: [PATCH] feat(LCELiveView): fix ui --- public/images/background.png | Bin 0 -> 2084 bytes src/components/views/LceLiveView.tsx | 57 ++++++++++++++++++++------- src/css/index.css | 8 +++- 3 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 public/images/background.png diff --git a/public/images/background.png b/public/images/background.png new file mode 100644 index 0000000000000000000000000000000000000000..341ffad468acb6f2cd44fadbfa19a942afbd48c7 GIT binary patch literal 2084 zcmeHIZBP?O7~VVXAeWRT1V}nmOcXRxQ$S&iq9&(?22hhwk$@41711(N&}uOTggc9- zs7TZzjR-_V4P!?UItBcIt6HQ|M_QyBS|Lbj4I>{42!kK#(dkcrb^4<-_Q&q*zPtPG z`#$^b^W8RA69C{D6{+|D0EixfTMT!)kIpQcoM2lb6Se^m6foH!!)bXY03JU_ zDVD|>lKLMcs@5qv?i#iNdCKjq*_#51vyShnV#mK}&{Qgz*eoC@j;v6vxN} zbm(4a{uhiO1cGyA0cJjo9Ak=!GoSHGs3d(HG|r<=Pt&Zxp}WV8@38!fmQ-IVy;iqN=n;qugRJ0TTpU*{3ONT}Y;$}v%(vCknB+h= z2H&Gi#??`3YZ(FCq^t88c{B=N-dYBaB0l(4OSD2Lv4U%{Jg$ufsqc2|ba*|4a?Vtn z@g)$d$vDIHVz9(SNYNgo4-*r{(4x=rcpS>Blmu$%SGZeJsX(s5OySCn(?}x?cIV0& z(>Xj1SU;PE-KCQrO`YvURuM2`bwcF-A-qW_*wLzU%0Msj5^P6@;)|o_(G^$CvX+?@ z2$Qa;Yu9}XC>_1#*aR~2v*e^Nmcpk}BkWW508&ct1PdV8jV?KIZ?6rhMypxW9Z)Sw zk;5!z3ZE#4Bnu=u?`B?e5YhA4t)mc-z4Re{{gDm}Ah$!PS(UaN?qP_Dt*N~g$WL_9 zhgW)H2Li01$x?KL8_CxIXT|)$kb?yL&Zan3v@j8eDvorRsRb}oe>`E~tpB!?$>0Bn z+_kEl@Wis0PcoF}9p?#*6OZGNgh*QfpQ2Nbnb~_B;c+y8W$idjiQyWizQ%swaLYoB z!(h-PMdcjj2t&*?0-NIxMhkT~l(N60kiuaL>Zr|g_q%e6d!LoU12Hh-?%gZ_xe+1v zhy07F9Sqqz$JPm{Z?Zrjkau-;xiYh|oGp=mg=;|IHH@GI+oKEKjL2llf#Sgz-@4B?FEo_P6_gb(D`)=k? z7tCg}lLrR|Wa`1hes;4j@yiPRG}1ZeN}E%6dAJg3kc@B!JL8}$C9UqrE3H1Xh)Qd` z9Rt#XUr+pw2aO(8xhFMh-o#w~M-vg2!kxmxr@`deMM?b&=XNH7EOVN8Ku+F+*9_LF zXAOkE-p$|oAtsux^GgYMiw7+h8c<*g4u??3+nmibq583tx5G@zU)V~MW!Th)M~Dxx z=${JJUl(01r!p_^@-n){~&B)YhwdF~THG;w$h!I=73$3cJt9w+mZY`~HLBYXe q&a;n)<}GZ#1}_*gf?^5KR_-H(b;Db6p`@BS02Ef#42 literal 0 HcmV?d00001 diff --git a/src/components/views/LceLiveView.tsx b/src/components/views/LceLiveView.tsx index 71f4647..079fb10 100644 --- a/src/components/views/LceLiveView.tsx +++ b/src/components/views/LceLiveView.tsx @@ -32,7 +32,9 @@ const LceLiveView = memo(function LceLiveView() { const [incomingReqs, setIncomingReqs] = useState([]); const [outgoingReqs, setOutgoingReqs] = useState([]); const [invites, setInvites] = useState([]); - const [linkData, setLinkData] = useState(null); + const [linkData, setLinkData] = useState( + null, + ); const [linkError, setLinkError] = useState(null); const [isHosting, setIsHosting] = useState(false); const [hostStatus, setHostStatus] = useState(""); @@ -176,7 +178,12 @@ const LceLiveView = memo(function LceLiveView() { setHostStatus(`Hosting at ${endpoint.ip}:25565`); setInvitedFriends(new Set()); } catch (e: unknown) { - const msg = e instanceof Error ? e.message : typeof e === "string" ? e : "Unknown error"; + const msg = + e instanceof Error + ? e.message + : typeof e === "string" + ? e + : "Unknown error"; setErrorModal("STUN discovery failed: " + msg); setHostStatus(""); } finally { @@ -240,7 +247,8 @@ const LceLiveView = memo(function LceLiveView() { .then(() => setHostStatus("Relay active")) .catch((relayErr: unknown) => { const relayMsg = - relayErr instanceof Error ? relayErr.message + relayErr instanceof Error + ? relayErr.message : typeof relayErr === "string" ? relayErr : "Unknown error"; @@ -248,7 +256,12 @@ const LceLiveView = memo(function LceLiveView() { setHostStatus("Relay disconnected"); }); } catch (e: unknown) { - const msg = e instanceof Error ? e.message : typeof e === "string" ? e : "Unknown error"; + const msg = + e instanceof Error + ? e.message + : typeof e === "string" + ? e + : "Unknown error"; setErrorModal("Failed to send invite: " + msg); } }; @@ -379,7 +392,11 @@ const LceLiveView = memo(function LceLiveView() { showHostMethodPicker, ]); - const tabs: ("friends" | "requests" | "invites")[] = ["friends", "requests", "invites"]; + const tabs: ("friends" | "requests" | "invites")[] = [ + "friends", + "requests", + "invites", + ]; useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (errorModal) { @@ -564,7 +581,7 @@ const LceLiveView = memo(function LceLiveView() { data-index={idx} onMouseEnter={() => setFocusIndex(idx)} onClick={btn.onClick} - className={`flex-1 h-12 flex items-center justify-center text-xl font-bold uppercase tracking-widest outline-none border-none ${isFocused ? "text-[#FFFF55] mc-text-shadow z-10 relative drop-shadow-md" : "text-white mc-text-shadow hover:text-gray-200"}`} + className={`flex-1 h-12 flex items-center justify-center text-xl font-bold uppercase tracking-widest outline-none border-none transition-all ${isFocused ? "text-[#FFFF55] mc-text-shadow scale-[1.02] z-10 relative drop-shadow-md" : "text-white mc-text-shadow hover:text-gray-200"}`} style={{ backgroundImage: isFocused ? "url('/images/button_highlighted.png')" @@ -579,11 +596,6 @@ const LceLiveView = memo(function LceLiveView() { })} )} - {hostStatus && ( -
- {hostStatus} -
- )}
@@ -747,7 +759,6 @@ const LceLiveView = memo(function LceLiveView() {
); }; - return ( (
)} -
+
{renderContent()}
@@ -804,7 +831,7 @@ const LceLiveView = memo(function LceLiveView() { src="/images/lcelive.png" alt="LCELive" className="h-5 opacity-70 cursor-pointer" - onClick={() => TauriService.openUrl('https://lcelive.co.uk')} + onClick={() => TauriService.openUrl("https://lcelive.co.uk")} />
diff --git a/src/css/index.css b/src/css/index.css index e2c28c8..0a54cd6 100644 --- a/src/css/index.css +++ b/src/css/index.css @@ -49,6 +49,7 @@ image-rendering: pixelated; position: relative; transform: translateY(2px); + transition: all 0.1s ease; } .mc-lce-tab.active { @@ -90,6 +91,7 @@ position: relative; transform: translateY(4px); z-index: 1; + transition: all 0.15s ease; min-height: 40px; background-color: rgba(0, 0, 0, 0.3); } @@ -156,10 +158,12 @@ body { } @keyframes blink-caret { - 0%, 50% { + 0%, + 50% { opacity: 1; } - 51%, 100% { + 51%, + 100% { opacity: 0; } }