-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlens.css
More file actions
707 lines (596 loc) · 19.7 KB
/
lens.css
File metadata and controls
707 lines (596 loc) · 19.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
/* NODUS HN Radar — Lens v0.2
* Overlay over Hacker News. Activates when html.lens-on is present.
*/
/* ── Theme variables ─────────────────────────────────────── */
html.lens-on {
--hn-orange: #ff6600;
--nodus-gold: #facc15;
--highlight-show: #16a34a;
--highlight-ask: #ea580c;
--highlight-launch: #8b5cf6;
--highlight-tell: #0891b2;
--highlight-poll: #db2777;
--op-bg: rgba(255, 102, 0, 0.07);
--op-border: rgba(255, 102, 0, 0.35);
/* Light theme defaults */
--bg-body: #ffffff;
--bg-main: #ffffff;
--bg-header: #ff6600;
--bg-card: #fafafa;
--bg-code: #f4f4f4;
--bg-chip: #f0f0f0;
--text-primary: #1a1a1a;
--text-secondary: #555555;
--text-meta: #828282;
--text-link: #1a1a1a;
--text-link-visited:#9a9a9a;
--border-soft: rgba(0,0,0,0.08);
--border-card: rgba(0,0,0,0.06);
}
html.lens-theme-dark {
--bg-body: #0f0f0f;
--bg-main: #0f0f0f;
--bg-header: #c95300;
--bg-card: #181818;
--bg-code: #1a1a1a;
--bg-chip: #1e1e1e;
--text-primary: #e5e5e5;
--text-secondary: #bbbbbb;
--text-meta: #808080;
--text-link: #e5e5e5;
--text-link-visited:#6a6a6a;
--border-soft: rgba(255,255,255,0.08);
--border-card: rgba(255,255,255,0.05);
}
/* ── Font + width variants ───────────────────────────────── */
html.lens-font-small { --fs-title: 13px; --fs-meta: 11px; --fs-comment: 13px; }
html.lens-font-medium { --fs-title: 15px; --fs-meta: 12px; --fs-comment: 14px; }
html.lens-font-large { --fs-title: 17px; --fs-meta: 13px; --fs-comment: 15px; }
html.lens-width-normal #hnmain { max-width: 920px !important; }
html.lens-width-wide #hnmain { max-width: 1240px !important; }
/* ── Base body and main container ─────────────────────────── */
html.lens-on body {
background: var(--bg-body) !important;
color: var(--text-primary) !important;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif !important;
}
html.lens-on #hnmain {
background: var(--bg-main) !important;
margin: 0 auto !important;
padding: 0 !important;
border: none !important;
}
/* Body padding for content rows only — exclude the HN header row (td[bgcolor="#ff6600"]).
The header is intentionally left untouched so it renders exactly like vanilla HN. */
html.lens-on #hnmain > tbody > tr > td:not([bgcolor="#ff6600"]) {
padding: 0 24px !important;
}
html.lens-on table {
border-collapse: separate !important;
}
/* ── Top header bar — DO NOT STYLE ──────────────────────────
The native HN orange header is preserved as-is. No background,
padding, color or font overrides are applied to it. Any rule
targeting td[bgcolor="#ff6600"], .pagetop or .hnname has been
removed to prevent visual breakage of the header row. */
/* ── Frontpage post rows ──────────────────────────────────── */
html.lens-on tr.athing,
html.lens-on tr.athing + tr {
background: transparent !important;
}
html.lens-on tr.athing > td {
vertical-align: top !important;
padding-top: 6px !important;
padding-bottom: 0 !important;
}
html.lens-on tr.athing + tr > td {
padding-top: 2px !important;
padding-bottom: 0 !important;
}
/* Separator between posts (subtle hairline in light, more visible in dark) */
html.lens-on tr.athing + tr + tr.spacer {
height: 14px !important;
border-bottom: 1px solid var(--border-card) !important;
}
html.lens-compact tr.athing + tr + tr.spacer {
height: 6px !important;
}
/* Rank number */
html.lens-on .rank {
color: var(--text-meta) !important;
font-size: var(--fs-meta) !important;
font-weight: 600 !important;
min-width: 20px;
display: inline-block;
}
/* Title text */
html.lens-on .titleline {
display: inline;
}
html.lens-on .titleline > a:first-child {
color: var(--text-link) !important;
font-size: var(--fs-title) !important;
line-height: 1.45 !important;
font-weight: 500 !important;
text-decoration: none !important;
}
html.lens-on .titleline > a:first-child:hover {
color: var(--hn-orange) !important;
}
html.lens-on .titleline > a:visited {
color: var(--text-link-visited) !important;
}
html.lens-on .sitebit,
html.lens-on .sitebit a,
html.lens-on .sitestr {
color: var(--text-meta) !important;
font-size: calc(var(--fs-meta) - 1px) !important;
}
/* Subtext line (points, user, hide, comments) */
html.lens-on .subtext {
color: var(--text-meta) !important;
font-size: var(--fs-meta) !important;
line-height: 1.8 !important;
}
html.lens-on .subtext a,
html.lens-on .subtext a:link,
html.lens-on .subtext a:visited {
color: var(--text-meta) !important;
}
html.lens-on .subtext a:hover {
color: var(--hn-orange) !important;
}
/* Points as chip */
html.lens-on .score {
display: inline-block;
background: var(--bg-chip);
color: var(--text-secondary) !important;
padding: 1px 7px;
border-radius: 999px;
font-weight: 600;
margin-right: 4px;
}
/* User name slightly emphasized */
html.lens-on .hnuser {
color: var(--text-secondary) !important;
font-weight: 500 !important;
}
/* ── Post-type badges (real spans, clickable to open side panel) ── */
html.lens-on .lens-type-badge,
html.lens-on .lens-pin-badge {
display: inline-block;
font-size: 9.5px;
font-weight: 800;
letter-spacing: 0.7px;
color: #ffffff;
padding: 2px 7px;
border-radius: 4px;
margin-right: 6px;
vertical-align: 2px;
line-height: 1.2;
text-transform: uppercase;
text-shadow: 0 1px 1px rgba(0,0,0,0.2);
cursor: pointer;
user-select: none;
transition: transform 0.12s ease, filter 0.15s, box-shadow 0.15s;
text-decoration: none !important;
}
html.lens-on .lens-type-badge:hover,
html.lens-on .lens-pin-badge:hover {
transform: translateY(-1px) scale(1.04);
filter: brightness(1.1);
}
html.lens-on .lens-type-badge:active,
html.lens-on .lens-pin-badge:active {
transform: translateY(0) scale(0.97);
}
/* Show only types whose highlight is enabled */
html:not(.lens-hl-show) .lens-tb-show,
html:not(.lens-hl-ask) .lens-tb-ask,
html:not(.lens-hl-launch) .lens-tb-launch {
display: none;
}
html.lens-on .lens-tb-show {
background: linear-gradient(135deg, #22c55e, #15803d);
box-shadow: 0 1px 4px rgba(22, 163, 74, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
html.lens-on .lens-tb-ask {
background: linear-gradient(135deg, #fb923c, #c2410c);
box-shadow: 0 1px 4px rgba(234, 88, 12, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
html.lens-on .lens-tb-launch {
background: linear-gradient(135deg, #a78bfa, #6d28d9);
box-shadow: 0 1px 4px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
html.lens-on .lens-tb-tell {
background: linear-gradient(135deg, #22d3ee, #0e7490);
box-shadow: 0 1px 4px rgba(8, 145, 178, 0.4);
}
html.lens-on .lens-tb-poll {
background: linear-gradient(135deg, #f472b6, #be185d);
box-shadow: 0 1px 4px rgba(219, 39, 119, 0.4);
}
/* Subtle row tint for type posts */
html.lens-hl-show tr.athing.lens-show > td,
html.lens-hl-show tr.athing.lens-show + tr > td {
background: rgba(22, 163, 74, 0.04) !important;
}
html.lens-hl-ask tr.athing.lens-ask > td,
html.lens-hl-ask tr.athing.lens-ask + tr > td {
background: rgba(234, 88, 12, 0.04) !important;
}
html.lens-hl-launch tr.athing.lens-launch > td,
html.lens-hl-launch tr.athing.lens-launch + tr > td {
background: rgba(139, 92, 246, 0.05) !important;
}
html.lens-theme-dark.lens-hl-show tr.athing.lens-show > td,
html.lens-theme-dark.lens-hl-show tr.athing.lens-show + tr > td {
background: rgba(34, 197, 94, 0.06) !important;
}
html.lens-theme-dark.lens-hl-ask tr.athing.lens-ask > td,
html.lens-theme-dark.lens-hl-ask tr.athing.lens-ask + tr > td {
background: rgba(251, 146, 60, 0.06) !important;
}
html.lens-theme-dark.lens-hl-launch tr.athing.lens-launch > td,
html.lens-theme-dark.lens-hl-launch tr.athing.lens-launch + tr > td {
background: rgba(167, 139, 250, 0.06) !important;
}
/* ── Pin button (injected into subtext) ──────────────────── */
html.lens-on .lens-pin {
color: var(--text-meta) !important;
text-decoration: none !important;
font-size: var(--fs-meta) !important;
transition: transform 0.12s ease, filter 0.15s;
display: inline-block;
cursor: pointer;
}
html.lens-on .lens-pin .lens-pin-icon {
display: inline-block;
filter: grayscale(1) opacity(0.5);
transition: filter 0.15s;
}
html.lens-on .lens-pin:hover .lens-pin-icon {
filter: grayscale(0) opacity(1);
transform: scale(1.15);
}
html.lens-on .lens-pin.pinned .lens-pin-icon {
filter: grayscale(0) opacity(1) drop-shadow(0 0 3px rgba(255, 102, 0, 0.5));
transform: rotate(-15deg);
}
/* ── Zebra striping (alternating row background for plain posts) ──
* Applies only to posts WITHOUT a type tint and not pinned, to avoid
* stacking with the type/pin colors. Uses --lens-zebra-color set by JS.
*/
html.lens-on.lens-zebra tr.athing.lens-zebra-even:not(.lens-show):not(.lens-ask):not(.lens-launch):not(.lens-tell):not(.lens-poll):not(.lens-pinned) > td,
html.lens-on.lens-zebra tr.athing.lens-zebra-even:not(.lens-show):not(.lens-ask):not(.lens-launch):not(.lens-tell):not(.lens-poll):not(.lens-pinned) + tr > td {
background: var(--lens-zebra-color, rgba(255, 136, 0, 0.06)) !important;
}
/* ── PIN badge (injected before titleline when post is pinned) ── */
html.lens-on .lens-pin-badge {
display: inline-block;
font-size: 9.5px;
font-weight: 800;
letter-spacing: 0.7px;
color: #ffffff;
padding: 2px 7px;
border-radius: 4px;
margin-right: 6px;
vertical-align: 2px;
line-height: 1.2;
text-transform: uppercase;
text-shadow: 0 1px 1px rgba(0,0,0,0.2);
background: linear-gradient(135deg, #ff9447, #ff6600);
box-shadow: 0 1px 4px rgba(255, 102, 0, 0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
/* Subtle row tint for pinned posts (lighter than type tint) */
html.lens-on tr.athing.lens-pinned > td,
html.lens-on tr.athing.lens-pinned + tr > td {
background: rgba(255, 102, 0, 0.045) !important;
}
/* ── Per-post translate button (inline 🌐) ───────────────── */
html.lens-on .lens-trans-btn {
display: inline-block;
margin-left: 6px;
background: transparent;
border: none;
padding: 0 2px;
font-size: 11px;
line-height: 1;
cursor: pointer;
filter: grayscale(1) opacity(0.4);
transition: filter 0.15s, transform 0.12s;
vertical-align: 1px;
}
html.lens-on .lens-trans-btn:hover {
filter: grayscale(0) opacity(1);
transform: scale(1.15);
}
html.lens-on .lens-trans-btn.loading {
filter: grayscale(0) opacity(1);
cursor: progress;
animation: lens-pulse 1s ease-in-out infinite;
}
html.lens-on .lens-trans-btn.no-op {
filter: grayscale(0) opacity(0.85);
outline: 1px dashed rgba(255, 102, 0, 0.55);
outline-offset: 1px;
border-radius: 3px;
cursor: help;
}
@keyframes lens-pulse {
0%, 100% { opacity: 0.55; }
50% { opacity: 1; }
}
/* ── "Translate all" bar above the post list ─────────────── */
html.lens-on .lens-translate-bar {
margin: 8px 0 6px;
padding: 0;
}
html.lens-on .lens-translate-all {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: 6px;
padding: 7px 14px;
font-size: var(--fs-meta);
font-weight: 600;
color: var(--text-secondary);
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 8px;
transition: background 0.15s, border-color 0.15s, color 0.15s;
}
html.lens-on .lens-translate-all:hover {
border-color: var(--hn-orange);
color: var(--hn-orange);
}
html.lens-on .lens-translate-all.active {
background: rgba(255, 102, 0, 0.08);
border-color: rgba(255, 102, 0, 0.35);
color: var(--hn-orange);
}
html.lens-on .lens-translate-all.loading {
cursor: wait;
}
html.lens-on .lens-translate-all .ti {
font-size: 13px;
}
/* ── Tag chips on pinned posts (propagated from side panel) ── */
html.lens-on .lens-tags-inline {
display: inline-flex;
flex-wrap: wrap;
gap: 4px;
margin-left: 8px;
vertical-align: 1px;
}
html.lens-on .lens-tag-chip {
--tag-hue: 25;
display: inline-block;
background: hsla(var(--tag-hue), 70%, 50%, 0.13);
color: hsl(var(--tag-hue), 65%, 38%);
border: 1px solid hsla(var(--tag-hue), 70%, 50%, 0.32);
padding: 1px 7px;
border-radius: 10px;
font-size: 10px;
font-weight: 600;
cursor: pointer;
transition: background 0.12s, transform 0.12s;
line-height: 1.4;
}
html.lens-on .lens-tag-chip:hover {
background: hsla(var(--tag-hue), 70%, 50%, 0.25);
transform: translateY(-1px);
}
html.lens-theme-dark .lens-tag-chip {
color: hsl(var(--tag-hue), 75%, 68%);
}
/* ── Translation indicator on post titles ────────────────── */
html.lens-on .lens-trans-badge {
display: inline-block;
margin-left: 6px;
font-size: 9.5px;
font-weight: 700;
color: #ff6600;
background: rgba(255, 102, 0, 0.1);
border: 1px solid rgba(255, 102, 0, 0.3);
padding: 1px 5px;
border-radius: 3px;
letter-spacing: 0.3px;
cursor: pointer;
user-select: none;
vertical-align: 1px;
transition: background 0.12s, opacity 0.12s, transform 0.12s;
text-decoration: none !important;
}
html.lens-on .lens-trans-badge:hover {
background: rgba(255, 102, 0, 0.22);
transform: translateY(-1px);
}
html.lens-theme-dark tr.athing.lens-pinned > td,
html.lens-theme-dark tr.athing.lens-pinned + tr > td {
background: rgba(255, 102, 0, 0.07) !important;
}
/* ── Visited posts ───────────────────────────────────────── */
html.lens-mark-visited tr.athing.lens-visited .titleline > a:first-child {
color: var(--text-link-visited) !important;
font-weight: 400 !important;
}
html.lens-mark-visited tr.athing.lens-visited + tr {
opacity: 0.55;
}
/* ── Item page (story details + comments) ─────────────────── */
/* Story header */
html.lens-on .fatitem .title .titleline > a:first-child {
font-size: calc(var(--fs-title) + 3px) !important;
font-weight: 600 !important;
}
html.lens-on .toptext {
color: var(--text-primary) !important;
font-size: var(--fs-comment) !important;
line-height: 1.65 !important;
margin: 10px 0 !important;
padding: 12px 14px !important;
background: var(--bg-card) !important;
border-radius: 6px !important;
border: 1px solid var(--border-card) !important;
}
/* Comment input form */
html.lens-on textarea {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
border: 1px solid var(--border-soft) !important;
border-radius: 4px !important;
padding: 8px !important;
font-family: inherit !important;
font-size: var(--fs-comment) !important;
}
html.lens-on input[type="submit"] {
background: var(--hn-orange) !important;
color: #fff !important;
border: none !important;
padding: 6px 14px !important;
border-radius: 4px !important;
cursor: pointer !important;
font-weight: 600 !important;
}
/* ── Comments ────────────────────────────────────────────── */
html.lens-on .comment-tree {
margin-top: 8px !important;
}
html.lens-on tr.comtr {
background: transparent !important;
}
html.lens-on tr.comtr > td {
padding: 8px 0 !important;
}
html.lens-on .comhead {
font-size: var(--fs-meta) !important;
color: var(--text-meta) !important;
line-height: 1.6 !important;
margin-bottom: 4px !important;
}
html.lens-on .comhead a,
html.lens-on .comhead a:link,
html.lens-on .comhead a:visited {
color: var(--text-meta) !important;
}
html.lens-on .comhead .hnuser {
color: var(--text-secondary) !important;
font-weight: 600 !important;
}
html.lens-on .comhead a:hover {
color: var(--hn-orange) !important;
}
html.lens-on .comment,
html.lens-on .commtext {
font-size: var(--fs-comment) !important;
color: var(--text-primary) !important;
line-height: 1.6 !important;
}
html.lens-on .commtext a,
html.lens-on .commtext a:link {
color: var(--hn-orange) !important;
text-decoration: none !important;
}
html.lens-on .commtext a:hover {
text-decoration: underline !important;
}
html.lens-on .commtext a:visited {
color: #a85100 !important;
}
html.lens-theme-dark .commtext a:visited {
color: #c9803d !important;
}
/* Reply link */
html.lens-on .reply {
margin-top: 6px !important;
font-size: var(--fs-meta) !important;
}
html.lens-on .reply a {
color: var(--text-meta) !important;
}
html.lens-on .reply a:hover {
color: var(--hn-orange) !important;
}
/* ── Original Poster (OP) highlight in comments ───────────── */
html.lens-on tr.comtr.lens-op > td {
position: relative;
}
html.lens-on tr.comtr.lens-op .commtext {
background: var(--op-bg) !important;
border-left: 3px solid var(--op-border) !important;
padding: 6px 10px !important;
border-radius: 0 4px 4px 0 !important;
}
html.lens-on tr.comtr.lens-op .comhead .hnuser::after {
content: "OP";
display: inline-block;
margin-left: 6px;
background: var(--hn-orange);
color: #fff;
font-size: 9px;
font-weight: 700;
padding: 1px 5px;
border-radius: 3px;
letter-spacing: 0.5px;
vertical-align: middle;
}
/* ── Code blocks in comments and posts ────────────────────── */
html.lens-on pre {
background: var(--bg-code) !important;
border: 1px solid var(--border-card) !important;
border-radius: 4px !important;
padding: 10px 12px !important;
margin: 8px 0 !important;
font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace !important;
font-size: calc(var(--fs-comment) - 1px) !important;
line-height: 1.45 !important;
white-space: pre-wrap !important;
overflow-x: auto !important;
color: var(--text-primary) !important;
}
html.lens-on code {
background: var(--bg-code) !important;
padding: 1px 5px !important;
border-radius: 3px !important;
font-family: "SFMono-Regular", "Consolas", monospace !important;
font-size: 0.92em !important;
color: var(--text-primary) !important;
}
/* Quote blocks (HN uses italics+indent for replies) */
html.lens-on .commtext p i {
color: var(--text-secondary) !important;
border-left: 2px solid var(--border-soft) !important;
padding-left: 10px !important;
margin-left: 0 !important;
display: block !important;
font-style: normal !important;
}
/* ── Footer (yclinks) ─────────────────────────────────────── */
html.lens-on .yclinks,
html.lens-on .yclinks a {
color: var(--text-meta) !important;
font-size: var(--fs-meta) !important;
}
html.lens-on hr {
border: none !important;
border-top: 1px solid var(--border-card) !important;
margin: 16px 0 !important;
}
/* ── Misc cleanups ────────────────────────────────────────── */
html.lens-theme-dark input[type="text"],
html.lens-theme-dark input[type="password"] {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
border: 1px solid var(--border-soft) !important;
border-radius: 4px !important;
padding: 4px 8px !important;
}
/* Search bar at the bottom of frontpage */
html.lens-on .yclinks form input {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
border: 1px solid var(--border-soft) !important;
border-radius: 4px !important;
padding: 4px 8px !important;
}