-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.css
More file actions
868 lines (761 loc) · 20.2 KB
/
Copy pathstyles.css
File metadata and controls
868 lines (761 loc) · 20.2 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
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/*
* Library Amber colour system
* ---------------------------
* These five values are the site's complete core palette. If you want to
* recolour the website in the future, change these values first. The rest of
* the stylesheet refers to their descriptive names instead of repeating hex
* codes in dozens of places.
*
* The second group contains role names such as "text-on-dark". These are not
* extra unrelated colours: they are aliases or transparent versions of the
* same five palette colours. Giving colours a job makes the CSS much easier for
* one person to understand and maintain.
*/
:root {
--palette-page: #171512;
--palette-surface: #2a251f;
--palette-paper: #fcfaf5;
--palette-primary: #d9a441;
--palette-secondary: #8c6a3c;
--text-on-dark: var(--palette-paper);
--text-on-light: var(--palette-surface);
--muted-on-dark: rgba(252, 250, 245, 0.72);
--muted-on-light: rgba(42, 37, 31, 0.68);
/* 64% keeps secondary card text above the 4.5:1 readability target. */
--faint-on-light: rgba(42, 37, 31, 0.64);
--border-on-dark: rgba(252, 250, 245, 0.18);
--hover-on-dark: rgba(252, 250, 245, 0.09);
--strong-hover-on-dark: rgba(252, 250, 245, 0.14);
--card-shadow: rgba(23, 21, 18, 0.24);
--card-shadow-hover: rgba(23, 21, 18, 0.36);
}
body {
font-family: 'Podkova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--palette-page);
min-height: 100vh;
color: var(--text-on-light);
line-height: 1.6;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
/* Header */
.header {
text-align: center;
margin-bottom: 3rem;
color: var(--text-on-dark);
}
.title {
font-size: 3rem;
font-weight: 700;
margin-bottom: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.title i {
font-size: 2.5rem;
color: var(--palette-primary);
}
.subtitle {
font-size: 1.2rem;
opacity: 0.9;
font-weight: 300;
}
/* Status Buttons */
.status-buttons {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 3rem;
}
.status-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--palette-surface);
border: 1px solid var(--border-on-dark);
/*
* These are the four main navigation buttons: Read, Reading, Want to Read,
* and All Books. They used to have a 20px radius, which made them look like
* rounded pills. A small 6px radius gives them a clearly rectangular shape
* while keeping the corners slightly soft and consistent with the search
* box and filter controls elsewhere on the page.
*
* Change this one value if you ever want a different button shape:
* 0 = completely square corners
* 6px = the current rectangular design
* 20px = the old pill-shaped design
*/
border-radius: 6px;
color: var(--muted-on-dark);
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
}
.status-btn:hover {
background: var(--strong-hover-on-dark);
color: var(--text-on-dark);
border-color: var(--palette-secondary);
}
.status-btn.active {
background: var(--palette-primary);
color: var(--palette-page);
border-color: var(--palette-primary);
font-weight: 600;
}
/* Make the selected button obvious when navigating with the Tab key. */
.status-btn:focus-visible {
outline: 2px solid var(--palette-primary);
outline-offset: 3px;
}
.status-btn i {
font-size: 0.8rem;
}
.sidebar-toggle {
display: none;
}
/* Main Content Layout */
.main-content {
display: grid;
grid-template-columns: 1fr 250px;
gap: 2rem;
align-items: start;
}
/* Sidebar */
.sidebar {
position: sticky;
top: 2rem;
width: 100%;
max-height: calc(100vh - 4rem);
background: transparent;
padding: 8px;
overflow-y: auto;
}
.sidebar-header {
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border-on-dark);
}
.sidebar-header h3 {
color: var(--text-on-dark);
font-size: 16px;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.sidebar-header i {
color: var(--palette-primary);
}
.filter-section {
margin-bottom: 1rem;
}
.filter-section h4 {
color: var(--muted-on-dark);
font-size: 14px;
font-weight: 600;
margin-bottom: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.checkbox-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.checkbox-group.tags {
display: flex;
flex-wrap: wrap;
gap: 0.2rem;
flex-direction: row;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
padding: 4px 8px;
border-radius: 6px;
transition: all 0.3s ease;
color: var(--muted-on-dark);
font-size: 14px;
}
.checkbox-group.tags .checkbox-label {
padding: 3px 6px;
font-size: 12px;
white-space: nowrap;
}
.checkbox-label:hover {
background: var(--hover-on-dark);
color: var(--text-on-dark);
}
.filter-checkbox {
display: none;
}
.checkmark {
width: 14px;
height: 14px;
border: 2px solid var(--palette-secondary);
border-radius: 3px;
position: relative;
transition: all 0.3s ease;
background: transparent;
}
.filter-checkbox:checked + .checkmark {
background: var(--palette-primary);
border-color: var(--palette-primary);
}
.filter-checkbox:checked + .checkmark::after {
content: '✓';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--palette-page);
font-size: 12px;
font-weight: bold;
}
.radio-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.radio-label {
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
padding: 4px 8px;
border-radius: 6px;
transition: all 0.3s ease;
color: var(--muted-on-dark);
font-size: 14px;
}
.radio-label:hover {
background: var(--hover-on-dark);
color: var(--text-on-dark);
}
.sort-radio {
display: none;
}
.radio-button {
width: 14px;
height: 14px;
border: 2px solid var(--palette-secondary);
border-radius: 50%;
position: relative;
transition: all 0.3s ease;
}
.sort-radio:checked + .radio-button {
border-color: var(--palette-primary);
}
.sort-radio:checked + .radio-button::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 8px;
height: 8px;
background: var(--palette-primary);
border-radius: 50%;
}
.search-bar {
position: relative;
margin-bottom: 1rem;
}
.search-bar input {
width: 100%;
padding: 8px 8px 8px 32px;
background: var(--palette-surface);
border: 1px solid var(--border-on-dark);
border-radius: 6px;
color: var(--text-on-dark);
font-size: 14px;
transition: all 0.3s ease;
}
.search-bar input::placeholder {
color: var(--muted-on-dark);
}
.search-bar input:focus {
outline: none;
border-color: var(--palette-primary);
background: var(--hover-on-dark);
}
.search-bar i {
position: absolute;
top: 50%;
left: 12px;
transform: translateY(-50%);
color: var(--palette-primary);
font-size: 14px;
}
/*
* Collapsible filter options
* --------------------------
* The HTML <details> element performs all opening and closing behaviour. These
* rules change only its appearance; there is intentionally no JavaScript here.
*/
.filter-dropdown {
border: 1px solid var(--border-on-dark);
border-radius: 8px;
background: var(--palette-surface);
}
.filter-dropdown-summary {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.65rem 0.75rem;
color: var(--text-on-dark);
font-size: 14px;
font-weight: 600;
cursor: pointer;
/* Remove the browser's small default triangle; ::after supplies a larger one. */
list-style: none;
}
/* Chrome and Safari use a special marker that needs its own rule. */
.filter-dropdown-summary::-webkit-details-marker {
display: none;
}
.filter-dropdown-summary::after {
content: '▾';
margin-left: auto;
color: var(--palette-primary);
transition: transform 0.2s ease;
}
/* Turn the arrow upward while the dropdown is open. */
.filter-dropdown[open] .filter-dropdown-summary::after {
transform: rotate(180deg);
}
.filter-dropdown-summary:hover {
background: var(--hover-on-dark);
}
/* Make keyboard navigation as obvious as mouse hover. */
.filter-dropdown-summary:focus-visible {
outline: 2px solid var(--palette-primary);
outline-offset: 2px;
}
.filter-dropdown-content {
padding: 1rem 0.75rem 0.75rem;
border-top: 1px solid var(--border-on-dark);
}
.clear-filters-btn {
width: 100%;
padding: 8px;
background: transparent;
border: 1px solid var(--border-on-dark);
border-radius: 6px;
color: var(--muted-on-dark);
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}
.clear-filters-btn:hover {
background: var(--hover-on-dark);
color: var(--text-on-dark);
border-color: var(--palette-secondary);
}
/*
* Sidebar statistics
* ------------------
* The four totals used to sit below hundreds of book cards, where most people
* would never reach them. They now form a compact two-by-two panel at the top
* of the sidebar, immediately before search.
*
* A grid is simpler than calculating widths by hand: two equal columns work in
* both the 250px desktop sidebar and the full-width sidebar shown on phones.
*/
.stats {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.65rem;
margin-bottom: 1.25rem;
padding: 0.75rem;
background: var(--palette-surface);
border: 1px solid var(--border-on-dark);
border-radius: 8px;
}
.stat {
text-align: center;
color: var(--text-on-dark);
}
.stat-number {
display: block;
font-size: 1.5rem;
font-weight: 700;
line-height: 1.15;
color: var(--palette-primary);
}
.stat-label {
display: block;
margin-top: 0.15rem;
font-size: 0.7rem;
opacity: 0.9;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Books Grid */
.books-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 2rem;
margin-bottom: 3rem;
/*
* Book descriptions have different lengths. Keep each card at its natural
* height instead of stretching shorter cards to match the tallest card in
* the same row.
*/
align-items: start;
}
/*
* A book card is an information container, not a button.
*
* Older versions hid all text until the mouse hovered over the cover. That made
* titles, authors, ratings, dates, and review links difficult or impossible to
* reach on phones, tablets, and keyboards. The card is now a simple vertical
* layout: cover first, permanently visible information underneath.
*
* We intentionally do not add `tabindex` to the whole card. A non-clickable card
* should not create an extra keyboard stop. Real actions such as "Read Review"
* are normal links and remain keyboard-focusable by default.
*/
.book-card {
display: flex;
flex-direction: column;
background: var(--palette-paper);
border-radius: 16px;
overflow: hidden;
box-shadow: 0 8px 25px var(--card-shadow);
transition: transform 0.2s ease, box-shadow 0.2s ease;
position: relative;
}
/*
* Devices with a real mouse may show a small decorative lift. There is no zoom,
* so a card cannot cover its neighbours. Touch devices skip this rule entirely
* because they do not have a reliable hover state.
*/
@media (hover: hover) and (pointer: fine) {
.book-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 30px var(--card-shadow-hover);
}
.book-card:hover .book-cover {
filter: brightness(0.95);
}
}
.book-cover {
/*
* Every cover gets the same rectangular display area so the card grid stays
* tidy, even though the original image files have many different shapes.
*
* `object-fit: contain` is the important part of this rule. It asks the
* browser to shrink or enlarge the image until the WHOLE cover fits inside
* the rectangle. Nothing is cut off. A particularly tall or wide cover may
* leave a little empty space at its sides or above and below; that is the
* unavoidable trade-off for showing the complete artwork.
*
* Do not change this back to `object-fit: cover`. Despite its confusing
* name, `cover` fills the rectangle by cropping parts of the image, which is
* exactly the problem this rule fixes.
*/
display: block;
width: 100%;
height: 280px;
object-fit: contain;
/* Keep each image centred when its proportions leave some empty space. */
object-position: center;
/*
* The subtle background makes that empty space look intentional. It also
* avoids a harsh white flash while a lazily loaded image is arriving.
*/
background: var(--palette-paper);
transition: filter 0.2s ease;
}
.book-info {
/*
* `position: static` keeps this section in the normal page layout directly
* below the cover. Opacity and hover tricks are deliberately avoided: if the
* card exists on screen, its information should be readable too.
*
* The text used to be very small while this section had 16 pixels of empty
* space on every side. We now spend that space on larger, easier-to-read
* text: 0.65rem is about 10 pixels with the site's normal font settings.
* Keeping this value here (instead of repeating different padding values in
* the phone rules) makes future changes much easier for one maintainer.
*/
position: static;
flex: 1;
padding: 0.65rem;
background: var(--palette-paper);
opacity: 1;
}
.book-title {
/* 1rem normally equals 16px. The old title size was only 14px. */
font-size: 1rem;
font-weight: 600;
margin-bottom: 0.3rem;
color: var(--text-on-light);
line-height: 1.3;
}
.book-author {
/* About 14px: readable, but still visually secondary to the title. */
font-size: 0.875rem;
color: var(--muted-on-light);
margin-bottom: 0.4rem;
font-style: italic;
line-height: 1.35;
word-wrap: break-word;
overflow-wrap: break-word;
}
.book-details {
display: flex;
flex-direction: column;
/*
* A smaller gap lets the larger detail text fit in roughly the same card
* height. The information remains separated without looking wasteful.
*/
gap: 0.2rem;
font-size: 0.8125rem;
line-height: 1.35;
}
.book-rating {
display: flex;
align-items: center;
gap: 0.3rem;
}
.stars {
color: var(--palette-primary);
font-size: 0.875rem;
}
/* Make an intentionally missing rating look different from a numeric score. */
.rating-not-set {
color: var(--faint-on-light);
font-style: italic;
}
.book-date {
font-size: 0.8125rem;
color: var(--muted-on-light);
display: flex;
align-items: center;
gap: 0.3rem;
}
.format-icon {
margin-left: 0.5rem;
font-size: 1.2em;
color: var(--muted-on-light);
}
.book-tags {
display: flex;
flex-wrap: wrap;
gap: 0.2rem;
margin-top: 0.3rem;
}
.tag {
background: var(--palette-secondary);
color: var(--palette-paper);
padding: 0.18em 0.55em;
border-radius: 10px;
/* The old 9px tag text was especially difficult to read. */
font-size: 0.6875rem;
font-weight: 500;
white-space: nowrap;
line-height: 1.4;
}
.book-language {
font-size: 0.8125rem;
color: var(--muted-on-light);
display: flex;
align-items: center;
gap: 0.3rem;
}
.book-review {
margin-top: 0.2rem;
}
.review-link {
color: var(--palette-secondary);
text-decoration: none;
font-size: 0.8125rem;
font-weight: 500;
display: flex;
align-items: center;
gap: 0.3rem;
transition: color 0.3s ease;
}
.review-link:hover {
color: var(--palette-surface);
}
/* Give keyboard users a strong, visible indication of the selected link. */
.review-link:focus-visible {
outline: 2px solid var(--palette-secondary);
outline-offset: 3px;
border-radius: 2px;
}
.book-status {
position: absolute;
top: 1rem;
right: 1rem;
background: var(--palette-surface);
color: var(--palette-paper);
border: 1px solid transparent;
padding: 0.3rem 0.8rem;
border-radius: 12px;
font-size: 0.7rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
z-index: 10;
/* Status is useful information on touchscreens too, so never hide it. */
opacity: 1;
}
.status-read {
background: var(--palette-primary);
color: var(--palette-page);
border-color: var(--palette-primary);
}
.status-reading {
background: var(--palette-secondary);
color: var(--palette-paper);
border-color: var(--palette-secondary);
}
.status-want-to-read {
background: var(--palette-surface);
color: var(--palette-paper);
border-color: var(--palette-primary);
}
/* No results */
.no-results {
text-align: center;
color: var(--text-on-dark);
padding: 3rem;
}
.no-results i {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.3;
}
.no-results h3 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.no-results p {
opacity: 0.6;
}
/* Responsive Design */
@media (max-width: 768px) {
/*
* Four buttons in one row are wider than a phone screen. A two-column grid
* gives us two tidy rows and does not depend on the exact length of each
* label. `minmax(0, 1fr)` is important: the zero allows a column to shrink
* when the screen is narrow, while `1fr` makes both columns equally wide.
*/
.status-buttons {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.75rem;
margin-bottom: 2rem;
}
.status-btn {
/* Fill one grid cell and centre the icon plus label inside it. */
width: 100%;
min-width: 0;
justify-content: center;
/* Every current label fits on one line, even on a 320px-wide phone. */
white-space: nowrap;
}
.main-content {
grid-template-columns: 1fr;
}
.sidebar {
display: block;
position: static;
max-height: none;
overflow-y: visible;
grid-row: 2;
}
/*
* Only the named controls wrapper is collapsible. The .stats element is a
* separate sibling, so it remains visible without relying on selector tricks
* or duplicating the statistics markup.
*/
.sidebar-controls {
display: none;
}
.sidebar-controls.open {
display: block;
}
.sidebar-toggle {
display: block;
margin-bottom: 1rem;
padding: 0.5rem 1rem;
background: var(--palette-surface);
border: 1px solid var(--border-on-dark);
border-radius: 20px;
color: var(--muted-on-dark);
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
}
.container {
padding: 1rem;
}
.title {
font-size: 2rem;
}
.books-grid {
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 1rem;
}
.book-cover {
height: 220px;
}
}
@media (max-width: 480px) {
.books-grid {
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.book-cover {
height: 180px;
}
}
/* Loading animation */
.loading {
display: flex;
justify-content: center;
align-items: center;
padding: 3rem;
color: var(--text-on-dark);
}
.spinner {
border: 3px solid var(--border-on-dark);
border-radius: 50%;
border-top: 3px solid var(--palette-primary);
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin-right: 1rem;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}