Mercurial
annotate mrjunejune/test/snapshots/talk.snapshot @ 198:008ca7780c8a
S3 upload got it to work.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Sat, 14 Feb 2026 16:18:14 -0800 |
| parents | 1c0878eb17de |
| children |
| rev | line source |
|---|---|
| 129 | 1 <!DOCTYPE html> |
| 2 <html lang="en"> | |
| 3 <head> | |
| 4 <meta charset="UTF-8"> | |
| 5 <title>Talk!</title> | |
| 6 <meta charset="UTF-8"> | |
| 7 <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| 8 <link rel="icon" type="image/svg+xml" href="/public/epi_all_colors.svg"> | |
| 9 | |
| 10 <link rel="preload" href="/public/fonts/Roboto-Regular.ttf" as="font" crossorigin> | |
| 11 <link rel="preload" href="/public/fonts/Roboto-Thin.ttf"as="font" crossorigin> | |
| 12 | |
| 13 <!-- <link rel="preload" href="/public/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin> --> | |
| 14 <!-- <link rel="preload" href="/public/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin> --> | |
| 15 | |
| 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> | |
| 18 <link rel="preload" href="/public/fonts/more-sugar.thin.otf" as="font" type="font/otf" crossorigin> | |
|
158
1c0878eb17de
[MrJuneJune] Readme file gets compiled in server side.
June Park <parkjune1995@gmail.com>
parents:
145
diff
changeset
|
19 <link rel="preload" href="/public/epi_all_colors.svg" as="image"> |
| 129 | 20 |
| 21 <link rel="preload" href="/base.css" as="style" /> | |
| 22 <link rel="stylesheet" href="/base.css" /> | |
| 23 | |
| 24 | |
| 25 <style> | |
| 26 body { font-family: sans-serif; padding: 20px; } | |
| 27 #messages { height: 200px; border: 1px solid #ccc; overflow-y: scroll; margin-bottom: 10px; padding: 10px; } | |
| 28 #chat { display: flex; gap: 10px; } | |
| 29 input { flex-grow: 1; } | |
| 30 </style> | |
| 31 </head> | |
| 32 <body> | |
| 33 <style> | |
| 34 :root { | |
| 35 --header-background: var(--white); | |
| 36 --header-color: rgb(var(--black)); | |
| 37 --link-hover-accent: var(--awesome); | |
| 38 } | |
| 39 | |
| 40 /* Fixed icon in top left corner */ | |
| 41 #themeToggle { | |
| 42 position: fixed; | |
| 43 top: 20px; | |
| 44 left: 20px; | |
| 45 background: var(--header-background); | |
| 46 display: flex; | |
| 47 align-items: center; | |
| 48 border-radius: 50%; | |
| 49 cursor: pointer; | |
| 50 z-index: 1000; | |
| 51 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
| 52 transition: transform 0.2s ease; | |
| 53 } | |
| 54 | |
| 55 #themeToggle:hover { | |
| 56 transform: scale(1.05); | |
| 57 } | |
| 58 | |
| 59 /* Professional header */ | |
| 60 header { | |
| 61 margin: auto; | |
| 62 padding: 1.5em 1em; | |
| 63 font-family: "More", sans-serif; | |
| 64 box-shadow: 0 2px 8px rgba(var(--black), 5%); | |
| 65 width: 720px; | |
| 66 max-width: calc(100% - 2em); | |
| 67 text-align: center; | |
| 68 } | |
| 69 | |
| 70 header h1 { | |
| 71 margin: 0; | |
| 72 font-size: 1.8em; | |
| 73 font-weight: 700; | |
| 74 letter-spacing: -0.5px; | |
| 75 } | |
| 76 | |
| 77 header h1 a { | |
| 78 text-decoration: none; | |
| 79 color: var(--header-color); | |
| 80 } | |
| 81 | |
| 82 header h1 a::before { | |
| 83 display: none; | |
| 84 } | |
| 85 | |
| 86 /* Mobile responsiveness */ | |
| 87 @media (max-width: 720px) { | |
| 88 #themeToggle { | |
| 89 top: 15px; | |
| 90 left: 15px; | |
| 91 } | |
| 92 | |
| 93 header { | |
| 94 padding: 1em; | |
| 95 } | |
| 96 | |
| 97 header h1 { | |
| 98 font-size: 1.5em; | |
| 99 } | |
| 100 } | |
| 101 | |
| 102 @media (max-width: 480px) { | |
| 103 #themeToggle { | |
| 104 top: 10px; | |
| 105 left: 10px; | |
| 106 } | |
| 107 | |
| 108 #themeToggle img { | |
| 109 height: 40px; | |
| 110 width: 40px; | |
| 111 } | |
| 112 | |
| 113 header h1 { | |
| 114 font-size: 1.3em; | |
| 115 } | |
| 116 } | |
| 117 | |
| 118 #logo { | |
| 119 width: 300px; | |
| 120 } | |
| 121 | |
| 122 /* 1. DEFINE THE DEFAULTS (Light Mode) */ | |
| 123 :root { | |
| 124 --logo-invert: invert(0); | |
| 125 --epi-grayscale: grayscale(0) brightness(1); | |
| 126 } | |
| 127 | |
| 128 /* 2. MANUAL DARK OVERRIDE */ | |
| 129 html.dark { | |
| 130 --logo-invert: invert(1); | |
| 131 --epi-grayscale: grayscale(1); | |
| 132 } | |
| 133 | |
| 134 /* 3. MANUAL LIGHT OVERRIDE */ | |
| 135 html.light-mode { | |
| 136 --logo-invert: invert(0); | |
| 137 --epi-grayscale: brightness(2.9) grayscale(1); | |
| 138 } | |
| 139 | |
| 140 /* 4. SYSTEM PREFERENCE */ | |
| 141 @media (prefers-color-scheme: dark) { | |
| 142 :root:not(.light-mode) { | |
| 143 --logo-invert: invert(1); | |
| 144 } | |
| 145 } | |
| 146 | |
| 147 /* 5. APPLY TO ELEMENTS */ | |
| 148 #logo { | |
| 149 -webkit-filter: var(--logo-invert); | |
| 150 filter: var(--logo-invert); | |
| 151 transition: filter 0.3s ease; | |
| 152 } | |
| 153 | |
| 154 .epi-logo { | |
| 155 -webkit-filter: var(--epi-grayscale); | |
| 156 filter: var(--epi-grayscale); | |
| 157 transition: filter 0.3s ease; | |
| 158 } | |
| 159 </style> | |
| 160 | |
| 161 <div id="themeToggle"> | |
| 162 <img id="epiChan" class="epi-logo" aria-label="Toggle dark mode" src="/public/epi_all_colors.svg" height="50" width="50"> | |
| 163 </div> | |
| 164 | |
| 165 <header> | |
| 166 <h1><a href="/">MrJuneJune</a></h1> | |
| 167 </header> | |
| 168 <script src="/index.js"></script> | |
| 169 | |
| 170 | |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
171 <main> |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
172 <h1>Talk with strangers xDDD</h1> |
| 129 | 173 |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
174 <div id="messages"></div> |
| 129 | 175 |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
176 <div id="chat"> |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
177 <input type="text" id="messageInput" placeholder="Type a message..."> |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
178 <button id="sendBtn">Send</button> |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
179 </div> |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
180 </main> |
| 129 | 181 <div style="display: flex; align-items: center; justify-content: center; margin: 30px 0px;"> |
| 182 <small>© 2026 June Park</small> | |
| 183 </div> | |
| 184 | |
| 185 <script> | |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
186 const host = window.location.hostname; |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
187 const port = '6969'; |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
188 const url = host === "mrjunejune.com" ? `wss://${host}/echo` : `ws://${host}:${port}/echo`; |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
189 const ws = new WebSocket(url); |
| 129 | 190 const messagesDiv = document.getElementById('messages'); |
| 191 | |
| 192 ws.onopen = () => { | |
| 193 console.log('Connected!'); | |
| 194 appendMessage('System: Connected to server'); | |
| 195 }; | |
| 196 | |
| 197 ws.onmessage = (event) => { | |
| 198 console.log('Received:', event.data); | |
| 199 appendMessage('Server: ' + event.data); | |
| 200 }; | |
| 201 | |
| 202 // Function to send message | |
| 203 sendBtn.onclick = () => { | |
| 204 const message = messageInput.value; | |
| 205 if (message) { | |
| 206 ws.send(message); | |
| 207 appendMessage('You: ' + message); | |
| 208 messageInput.value = ''; // Clear input | |
| 209 } | |
| 210 }; | |
| 211 | |
| 212 // Helper to show messages on screen | |
| 213 function appendMessage(text) { | |
| 214 const msg = document.createElement('p'); | |
| 215 msg.textContent = text; | |
| 216 messagesDiv.appendChild(msg); | |
| 217 messagesDiv.scrollTop = messagesDiv.scrollHeight; | |
| 218 } | |
| 219 | |
| 220 messageInput.addEventListener('keydown', (event) => { | |
| 221 if (event.key === 'Enter' && !event.shiftKey) | |
| 222 { | |
|
145
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
223 event.preventDefault(); |
|
c1eab8c0b0f9
[MrJuneJune] Small improvement UX and tests passes now.
June Park <parkjune1995@gmail.com>
parents:
129
diff
changeset
|
224 sendBtn.click(); |
| 129 | 225 } |
| 226 }); | |
| 227 </script> | |
| 228 </body> | |
| 229 </html> |