summaryrefslogtreecommitdiff
path: root/assets/css/components/_library.scss
blob: 5fcafae4071e302640934e416a9b8cae2b19eaf6 (plain)
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
#library {
    .book-group {
        --gap: 1rem;
        display: flex;
        align-items: center;
        gap: var(--gap);
        margin: 1rem 0;
        flex-wrap: wrap;

        .book {
            --number-in-line: 4;
            @media screen and (min-width: 768px) {
                --number-in-line: 6;
            }

            width: calc(100% / var(--number-in-line) - var(--gap));
            position: relative;
            &.badbook {
                opacity: 0.5;
                z-index: 0;
                &::before {
                    position: absolute;
                    z-index: 1;
                    content: "";
                    top: 25%;
                    left: 25%;
                    height: 50%;
                    width: 50%;

                    background-image: url('/img/thumbs-down.png');
                    background-size: 100%;
                    background-position: center;
                    background-repeat: no-repeat;
                }
            }
            &.goodbook {
                .book-cover {
                    border-color: gold;
                    box-shadow: 0 0.1rem 0.75rem goldenrod;
                }
            }
        }
    }
}

.book-body {
    line-height: 2;

    hr {
        clear: both
    }

    .book-footer {
        font-size: 1rem;
        color: var(--secondary-text-color);
    }
}

#book-page {
    --book-cover-width: 10rem;
    @media screen and (min-width: 768px) {
        --book-cover-width: 15rem;
    }

    .book-page-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;

        p {
            margin: 0;
        }

        .book-cover {
            @include framed;
            img {
                width: var(--book-cover-width);
            }
        }

        .book-title {
            filter: url(#x)
        }

        position: relative;
        .title-image-container {
            --size: 5rem;
            position: absolute;
            top: 2rem;
            right: calc(50% - var(--book-cover-width) / 2 - var(--size));
            @include roundSticker;
            width: var(--size);
            height: var(--size);

            .title-image {
                width: 100%;
            }
        }
    }
}

.book-cover {
    display: block;
    img {
        display: block;
        width: 100%;
    }

    #library & {
        @include framed;

        transition: transform 0.3s ease;
        transform: rotate(3deg);
        &:hover {
            transform: rotate(0) translateY(-0.5rem) scale(1.1)
        }
    }

    #post-content & {
        margin: 0 auto;
        max-width: 50%;
        @media screen and (min-width: 768px) {
            display: inxwline-block;
            float: left;
            width: 12rem;
            margin: 0 2rem 1.2rem 0;
        }
    }
}