File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 416416 pickTab ( "tab-objects" )
417417 }
418418
419+ /**
420+ * Toggle hand visibility.
421+ */
422+ function toggleHand ( ) {
423+ $ ( "#hand-container" ) . toggle ( )
424+ $ ( "#toggle-hand-button" ) . html ( ( $ ( "#hand-container" ) . is ( ":visible" ) ? "Hide" : "Show" ) + " Hand" )
425+ }
426+
427+ /**
428+ * Toggle chat visibility.
429+ */
430+ function toggleChat ( ) {
431+ $ ( "#chat-container" ) . toggle ( )
432+ let chatVisible = $ ( "#chat-container" ) . is ( ":visible" )
433+ $ ( "#toggle-chat-button" ) . html ( ( chatVisible ? "Hide" : "Show" ) + " Chat" )
434+
435+ // The match hand has the width of the chat hardcoded in its container
436+ // size. When the chat is invisible, the hand should be centered in the
437+ // new view.
438+ $ ( ".match-hand" ) . css ( "width" , chatVisible ? "" : "100vw" )
439+ }
440+
419441 setInterval ( loadStatus , 1000 )
420442 loadStatus ( )
421443 setInterval ( loadCards , 1000 )
422444 loadCards ( )
423445 pickTab ( "tab-actions" )
424446 $ ( "#tab-actions" ) . click ( chooseActionsTab )
425447 $ ( "#tab-objects" ) . click ( chooseObjectsTab )
448+ $ ( "#toggle-hand-button" ) . click ( toggleHand )
449+ $ ( "#toggle-chat-button" ) . click ( toggleChat )
426450} ) ( )
Original file line number Diff line number Diff line change 1818 < a href ="/match/abandon "> Abandon match</ a >
1919 </ div >
2020 < div >
21+ < a href ="# " id ="toggle-hand-button ">
22+ Hide Hand
23+ </ a >
24+ —
25+ < a href ="# " id ="toggle-chat-button ">
26+ Hide Chat
27+ </ a >
28+ —
2129 < a href ="# " id ="lightLabel ">
2230 Lights are being checked...
2331 </ a >
4654 < div class ="match-played-cards "> </ div >
4755 </ div >
4856 </ div >
49- < div class ="match-chat ">
57+ < div id =" chat-container " class ="match-chat ">
5058 < input type ="text " class ="chat-line " id ="chatinput " placeholder ="Type a message... " spellcheck ="false " maxlength ="120 " autocomplete ="off ">
5159 < div class ="chat-messages " id ="chatlist "> </ div >
5260 </ div >
5361 </ div >
5462 < div class ="match-hand ">
55- < div class ="match-hand-container ">
63+ < div id =" hand-container " class ="match-hand-container ">
5664 < div class ="match-hand-tabs ">
5765 < div class ="hand-tab-header " id ="tab-actions ">
5866 Actions
You can’t perform that action at this time.
0 commit comments