Re-orga Chat Box

This commit is contained in:
NigeParis 2025-11-27 21:03:25 +01:00 committed by apetitco
parent c41b32184b
commit 09ff8eb5a1
3 changed files with 80 additions and 37 deletions

View file

@ -4,36 +4,50 @@
@apply @apply
w-[100px] w-[100px]
h-[32px] h-[32px]
border-2 border-black border-1
border-gray-500
rounded-3xl rounded-3xl
bg-gray-500
text-white
cursor-pointer
shadow-[0_2px_0_0_black]
transition-all
hover:bg-blue-200 hover:bg-blue-200
active:bg-white active:bg-gray-400
text-black active:translate-y-[1px]
cursor-pointer; active:shadow-[0_2px_0_0_black];
} }
.send-btn-style { .send-btn-style {
@apply @apply
w-[50px] w-[50px]
h-[50px] h-[50px]
border-2 border-black border-1
border-gray-500
rounded-3xl rounded-3xl
hover:bg-blue-200 hover:bg-blue-200
active:bg-white bg-red-100
text-black text-red-700
cursor-pointer; cursor-pointer
shadow-[0_2px_0_0_black]
transition-all
active:bg-gray-400
active:translate-y-[1px]
active:shadow-[0_2px_0_0_black];;
} }
.chatbox-style { .chatbox-style {
@apply @apply
w-[600px] w-[650px]
h-[150px] /* increase height if needed */ h-[300px] /* increase height if needed */
p-[10px] p-[8px]
border-1 border-black border-1
shadow-sm border-black
shadow-2xl
text-left text-left
text-gray-800 text-gray-700
bg-white
rounded-3xl rounded-3xl
overflow-y-auto overflow-y-auto
whitespace-pre-line whitespace-pre-line
@ -49,9 +63,11 @@
p-[10px] p-[10px]
border-1 border-black border-1 border-black
shadow-sm shadow-sm
flex-1
rounded-3xl rounded-3xl
focus:bg-gray-300 focus:bg-blue-300
hover:bg-blue-200 hover:bg-blue-200
bg-white
text-gray-800; text-gray-800;
} }
@ -73,7 +89,7 @@
left-1/2 left-1/2
-translate-x-1/2 -translate-x-1/2
-translate-y-1/2 -translate-y-1/2
bg-white w-[650px] bg-gray-200 w-[850px]
p-6 rounded-xl p-6 rounded-xl
shadow-2xl shadow-2xl
text-center z-50; text-center z-50;
@ -84,6 +100,14 @@
cursor-pointer cursor-pointer
} }
.title {
@apply
text-6xl
font-bold
text-gray-800
}
p { p {
@apply @apply
text-black text-black

View file

@ -2,17 +2,36 @@
<div id="mainbox" class="mainboxDisplay"> <div id="mainbox" class="mainboxDisplay">
<button id="b-whoami" class="btn-style absolute top-4 left-6">Who am i</button> <button id="b-whoami" class="btn-style absolute top-4 left-6">Who am i</button>
<h1 class="text-3xl font-bold text-gray-800"> <h1 class="text-3xl font-bold text-gray-800">
Chat Box <span id="t-username"></span> ChatterBoxes 😀😀😀<span id="t-username"></span>
</h1><br> </h1><br>
<button id="b-clear" class="btn-style absolute top-4 right-6">Clear Text</button> <button id="b-clear" class="btn-style absolute top-4 right-6">Clear Text</button>
<button id="b-help" class="btn-style absolute top-14 left-6">Connected</button> <button id="b-help" class="btn-style absolute top-14 left-6">Connected</button>
<!-- Center wrapper for chat + vertical box -->
<div class="flex justify-center mt-2">
<!-- Groupe Chat + vertical box container -->
<div id = "g-boxes" class="flex gap-1">
<!-- Text Chat box panel + send -->
<div id = "g-textBoxes" class="flex flex-col">
<div id="t-chatbox" class="chatbox-style"></div> <div id="t-chatbox" class="chatbox-style"></div>
</br> <div id = "t-input-send" class="flex gap-1 mt-2">
<div class="flex gap-2"> <input id="t-chat-window" placeholder="Type your message..." class="chat-window-style" />
<input id="t-chat-window" placeholder="Type your message..." class="chat-window-style flex-1" />
<button id="b-send" class="send-btn-style">Send</button> <button id="b-send" class="send-btn-style">Send</button>
</div> </div>
</br> </div>
<p class="text-gray-400">From this Chat Box you can send messages to other players</p>
<!-- Vertical Ping box panel-->
<div id="ping-box" class="w-[150px] ml-2 bg-gray-300 rounded-2xl p-2 shadow-md flex flex-col gap-1 h-[350px]">
<p id="ping-title" class="text-sm font-semibold text-gray-700">Ping Buddies</p>
<div id="ping-list" class="flex-1 overflow-y-auto">
<p>Alice</p>
<p>Bob</p>
<p>Charlie</p>
</div>
</div>
</div>
</div>
<p class="text-gray-400 mt-2">From this Chat Box you can send messages to other players</p>
</div> </div>
</div> </div>

View file

@ -14,7 +14,7 @@ const color = {
}; };
// get the name of the machine useed to connect // get the name of the machine used to connect
const machineHostName = window.location.hostname; const machineHostName = window.location.hostname;
console.log('connect to login at %chttps://' + machineHostName + ':8888/app/login',color.yellow); console.log('connect to login at %chttps://' + machineHostName + ':8888/app/login',color.yellow);