bep40 commited on
Commit
4e84eef
·
verified ·
1 Parent(s): a465a19

News box styles: thumbnails, fallback avatar bubble, drag/resize handles, load-more spinner

Browse files
Files changed (1) hide show
  1. src/style.css +147 -24
src/style.css CHANGED
@@ -142,14 +142,14 @@ body { background: var(--bg); color: var(--text); font-family: Inter, system-ui,
142
  #chat-resize-handle:hover::after { opacity: 1; }
143
  #text-chat.resizing #chat-resize-handle::after { opacity: 1; }
144
 
145
- /* ── News Panel ─────────────────────────────────────────────────────────── */
146
  #news-panel {
147
  position: fixed;
148
  z-index: 9998;
149
  bottom: 80px;
150
  right: 20px;
151
- width: min(360px, calc(100vw - 40px));
152
- max-height: 60vh;
153
  display: flex;
154
  flex-direction: column;
155
  background: rgba(10, 11, 16, 0.95);
@@ -158,8 +158,14 @@ body { background: var(--bg); color: var(--text); font-family: Inter, system-ui,
158
  border: 1px solid var(--border-strong);
159
  border-radius: var(--radius-md);
160
  overflow: hidden;
161
- box-shadow: 0 8px 32px rgba(0,0,0,0.6);
 
 
 
 
162
  }
 
 
163
 
164
  #news-header {
165
  display: flex;
@@ -169,13 +175,17 @@ body { background: var(--bg); color: var(--text); font-family: Inter, system-ui,
169
  border-bottom: 1px solid var(--border);
170
  background: var(--bg-elev);
171
  flex-shrink: 0;
 
 
172
  }
 
173
 
174
  #news-title {
175
  font-size: 13px;
176
  font-weight: 600;
177
  color: var(--text);
178
  letter-spacing: 0.02em;
 
179
  }
180
 
181
  #news-list {
@@ -186,35 +196,77 @@ body { background: var(--bg); color: var(--text); font-family: Inter, system-ui,
186
  flex-direction: column;
187
  gap: 8px;
188
  }
189
-
190
- #news-list::-webkit-scrollbar { width: 5px; }
191
  #news-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
192
 
193
  .news-item {
194
- padding: 8px 10px;
 
 
195
  border-radius: var(--radius-sm);
196
  background: var(--bg-elev-2);
197
  border: 1px solid var(--border);
198
  cursor: pointer;
199
- transition: border-color 0.15s ease, background 0.15s ease;
200
- display: flex;
201
- flex-direction: column;
202
- gap: 4px;
203
  }
204
-
205
  .news-item:hover {
206
  border-color: var(--border-strong);
207
  background: var(--bg-elev);
208
  }
 
209
 
210
- .news-index {
211
- font-size: 11px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  font-weight: 600;
213
- color: var(--live);
 
 
214
  }
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  .news-title {
217
- font-size: 12px;
218
  line-height: 1.4;
219
  color: var(--text);
220
  display: -webkit-box;
@@ -223,20 +275,91 @@ body { background: var(--bg); color: var(--text); font-family: Inter, system-ui,
223
  overflow: hidden;
224
  }
225
 
226
- .news-source {
227
- font-size: 11px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  color: var(--text-dim);
229
- font-style: italic;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  }
 
 
231
 
232
  @media (max-width: 600px) {
233
  #identity p { display: none; }
234
  #subtitles { bottom: 128px; font-size: 14px; }
235
  #text-chat { top: 60px; left: 10px; width: calc(100vw - 20px); height: 40vh; }
236
- #news-panel {
237
- bottom: 70px;
238
- right: 10px;
239
- width: calc(100vw - 20px);
240
- max-height: 50vh;
 
 
241
  }
242
  }
 
142
  #chat-resize-handle:hover::after { opacity: 1; }
143
  #text-chat.resizing #chat-resize-handle::after { opacity: 1; }
144
 
145
+ /* ── News Box (draggable + resizable, with thumbnails) ─────────────────── */
146
  #news-panel {
147
  position: fixed;
148
  z-index: 9998;
149
  bottom: 80px;
150
  right: 20px;
151
+ width: min(380px, calc(100vw - 40px));
152
+ height: min(520px, 70vh);
153
  display: flex;
154
  flex-direction: column;
155
  background: rgba(10, 11, 16, 0.95);
 
158
  border: 1px solid var(--border-strong);
159
  border-radius: var(--radius-md);
160
  overflow: hidden;
161
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
162
+ resize: none;
163
+ touch-action: none;
164
+ min-width: 300px;
165
+ min-height: 180px;
166
  }
167
+ #news-panel.dragging { cursor: grabbing !important; user-select: none !important; }
168
+ #news-panel.resizing { user-select: none !important; }
169
 
170
  #news-header {
171
  display: flex;
 
175
  border-bottom: 1px solid var(--border);
176
  background: var(--bg-elev);
177
  flex-shrink: 0;
178
+ cursor: grab;
179
+ touch-action: none;
180
  }
181
+ #news-panel.dragging #news-header { cursor: grabbing !important; }
182
 
183
  #news-title {
184
  font-size: 13px;
185
  font-weight: 600;
186
  color: var(--text);
187
  letter-spacing: 0.02em;
188
+ pointer-events: none;
189
  }
190
 
191
  #news-list {
 
196
  flex-direction: column;
197
  gap: 8px;
198
  }
199
+ #news-list::-webkit-scrollbar { width: 6px; }
 
200
  #news-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
201
 
202
  .news-item {
203
+ display: flex;
204
+ gap: 10px;
205
+ padding: 8px;
206
  border-radius: var(--radius-sm);
207
  background: var(--bg-elev-2);
208
  border: 1px solid var(--border);
209
  cursor: pointer;
210
+ transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
211
+ align-items: center;
 
 
212
  }
 
213
  .news-item:hover {
214
  border-color: var(--border-strong);
215
  background: var(--bg-elev);
216
  }
217
+ .news-item:active { transform: scale(0.99); }
218
 
219
+ .news-thumb {
220
+ flex-shrink: 0;
221
+ width: 56px;
222
+ height: 56px;
223
+ border-radius: 6px;
224
+ overflow: hidden;
225
+ background: var(--bg);
226
+ border: 1px solid var(--border);
227
+ display: grid;
228
+ place-items: center;
229
+ }
230
+ .news-thumb img {
231
+ width: 100%;
232
+ height: 100%;
233
+ object-fit: cover;
234
+ display: block;
235
+ }
236
+ .news-thumb--fallback {
237
+ font-size: 16px;
238
  font-weight: 600;
239
+ color: var(--text);
240
+ background: linear-gradient(135deg, #1f6feb55, #22d3ee44);
241
+ letter-spacing: 0.02em;
242
  }
243
 
244
+ .news-body {
245
+ flex: 1;
246
+ min-width: 0;
247
+ display: flex;
248
+ flex-direction: column;
249
+ gap: 4px;
250
+ }
251
+ .news-meta {
252
+ display: flex;
253
+ align-items: center;
254
+ justify-content: space-between;
255
+ gap: 8px;
256
+ }
257
+ .news-source {
258
+ font-size: 11px;
259
+ color: var(--live);
260
+ font-weight: 600;
261
+ white-space: nowrap;
262
+ }
263
+ .news-index {
264
+ font-size: 10px;
265
+ color: var(--text-faint);
266
+ font-family: var(--font-mono);
267
+ }
268
  .news-title {
269
+ font-size: 12.5px;
270
  line-height: 1.4;
271
  color: var(--text);
272
  display: -webkit-box;
 
275
  overflow: hidden;
276
  }
277
 
278
+ .news-empty {
279
+ padding: 20px;
280
+ text-align: center;
281
+ color: var(--text-dim);
282
+ font-size: 13px;
283
+ }
284
+
285
+ /* Load more */
286
+ #news-loadmore {
287
+ flex-shrink: 0;
288
+ padding: 8px 10px 10px;
289
+ border-top: 1px solid var(--border);
290
+ background: var(--bg-elev);
291
+ position: relative;
292
+ }
293
+ .news-loadmore-btn {
294
+ width: 100%;
295
+ padding: 9px 12px;
296
+ border: 1px solid var(--border-strong);
297
+ border-radius: var(--radius-sm);
298
+ background: var(--bg-elev-2);
299
  color: var(--text-dim);
300
+ font-family: inherit;
301
+ font-size: 12px;
302
+ font-weight: 500;
303
+ cursor: pointer;
304
+ transition: color 0.15s ease, border-color 0.15s ease;
305
+ }
306
+ .news-loadmore-btn:hover:not(:disabled) {
307
+ color: var(--text);
308
+ border-color: var(--live);
309
+ }
310
+ .news-loadmore-btn:disabled { opacity: 0.6; cursor: default; }
311
+ .news-loadmore-btn.loading::after {
312
+ content: "";
313
+ display: inline-block;
314
+ width: 11px;
315
+ height: 11px;
316
+ margin-left: 8px;
317
+ vertical-align: -1px;
318
+ border: 2px solid var(--text-faint);
319
+ border-top-color: var(--live);
320
+ border-radius: 50%;
321
+ animation: news-spin 0.7s linear infinite;
322
+ }
323
+ @keyframes news-spin { to { transform: rotate(360deg); } }
324
+ #news-sentinel { position: absolute; bottom: 0; left: 0; right: 0; height: 1px; pointer-events: none; }
325
+
326
+ /* News resize handle (bottom-right) */
327
+ #news-resize-handle {
328
+ position: absolute;
329
+ bottom: 0;
330
+ right: 0;
331
+ width: 24px;
332
+ height: 24px;
333
+ cursor: nwse-resize;
334
+ background: transparent;
335
+ z-index: 2;
336
+ touch-action: none;
337
+ }
338
+ #news-resize-handle::after {
339
+ content: '';
340
+ position: absolute;
341
+ bottom: 3px;
342
+ right: 3px;
343
+ width: 14px;
344
+ height: 14px;
345
+ border-right: 2px solid var(--text-dim);
346
+ border-bottom: 2px solid var(--text-dim);
347
+ opacity: 0.4;
348
+ transition: opacity 0.15s;
349
  }
350
+ #news-resize-handle:hover::after { opacity: 1; }
351
+ #news-panel.resizing #news-resize-handle::after { opacity: 1; }
352
 
353
  @media (max-width: 600px) {
354
  #identity p { display: none; }
355
  #subtitles { bottom: 128px; font-size: 14px; }
356
  #text-chat { top: 60px; left: 10px; width: calc(100vw - 20px); height: 40vh; }
357
+ #news-panel {
358
+ bottom: 70px;
359
+ right: 10px;
360
+ left: 10px;
361
+ width: calc(100vw - 20px);
362
+ height: 60vh;
363
+ min-width: 0;
364
  }
365
  }