comparison mrjunejune/test/snapshots/talk.snapshot @ 145:c1eab8c0b0f9

[MrJuneJune] Small improvement UX and tests passes now.
author June Park <parkjune1995@gmail.com>
date Fri, 09 Jan 2026 13:42:35 -0800
parents f7860f491a8c
children 1c0878eb17de
comparison
equal deleted inserted replaced
144:043018c0f2f8 145:c1eab8c0b0f9
14 <!-- <link rel="preload" href="/public/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin> --> 14 <!-- <link rel="preload" href="/public/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin> -->
15 15
16 <!-- <link rel="preload" href="/public/fonts/more-sugar.extras.otf" as="font" type="font/otf" crossorigin> --> 16 <!-- <link rel="preload" href="/public/fonts/more-sugar.extras.otf" as="font" type="font/otf" crossorigin> -->
17 <link rel="preload" href="/public/fonts/more-sugar.regular.otf" as="font" type="font/otf" crossorigin> 17 <link rel="preload" href="/public/fonts/more-sugar.regular.otf" as="font" type="font/otf" crossorigin>
18 <link rel="preload" href="/public/fonts/more-sugar.thin.otf" as="font" type="font/otf" crossorigin> 18 <link rel="preload" href="/public/fonts/more-sugar.thin.otf" as="font" type="font/otf" crossorigin>
19 <link rel="preload" href="/public/epi_all_colors.svg" as="image" crossorigin>
19 20
20 <link rel="preload" href="/base.css" as="style" /> 21 <link rel="preload" href="/base.css" as="style" />
21 <link rel="stylesheet" href="/base.css" /> 22 <link rel="stylesheet" href="/base.css" />
22 23
23 24
165 <h1><a href="/">MrJuneJune</a></h1> 166 <h1><a href="/">MrJuneJune</a></h1>
166 </header> 167 </header>
167 <script src="/index.js"></script> 168 <script src="/index.js"></script>
168 169
169 170
170 <h1>Talks</h1> 171 <main>
171 172 <h1>Talk with strangers xDDD</h1>
172 <div id="messages"></div> 173
173 174 <div id="messages"></div>
174 <div id="chat"> 175
175 <input type="text" id="messageInput" placeholder="Type a message..."> 176 <div id="chat">
176 <button id="sendBtn">Send</button> 177 <input type="text" id="messageInput" placeholder="Type a message...">
177 </div> 178 <button id="sendBtn">Send</button>
179 </div>
180 </main>
178 <div style="display: flex; align-items: center; justify-content: center; margin: 30px 0px;"> 181 <div style="display: flex; align-items: center; justify-content: center; margin: 30px 0px;">
179 <small>&copy; 2026 June Park</small> 182 <small>&copy; 2026 June Park</small>
180 </div> 183 </div>
181 184
182 <script> 185 <script>
183 const ws = new WebSocket('ws://localhost:6969/echo'); 186 const host = window.location.hostname;
187 const port = '6969';
188 const url = host === "mrjunejune.com" ? `wss://${host}/echo` : `ws://${host}:${port}/echo`;
189 const ws = new WebSocket(url);
184 const messagesDiv = document.getElementById('messages'); 190 const messagesDiv = document.getElementById('messages');
185 191
186 ws.onopen = () => { 192 ws.onopen = () => {
187 console.log('Connected!'); 193 console.log('Connected!');
188 appendMessage('System: Connected to server'); 194 appendMessage('System: Connected to server');
212 } 218 }
213 219
214 messageInput.addEventListener('keydown', (event) => { 220 messageInput.addEventListener('keydown', (event) => {
215 if (event.key === 'Enter' && !event.shiftKey) 221 if (event.key === 'Enter' && !event.shiftKey)
216 { 222 {
217 event.preventDefault(); 223 event.preventDefault();
218 sendBtn.click(); 224 sendBtn.click();
219 } 225 }
220 }); 226 });
221 </script> 227 </script>
222 </body> 228 </body>
223 </html> 229 </html>