aboutsummaryrefslogtreecommitdiff
path: root/public/main.css
blob: e5d3bcf8ecf868d7362f0dac3bda2043246ecc8b (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
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
/* Variables */

:root {
  --color-focus: #888833;

  --width-close-button: 4rem;

  --font-size-dog: 1.5rem;

  --spacing-beetle: 0.25rem;
  --spacing-mouse: 0.5rem;
  --spacing-cat: 1rem;
}

/* Top level */

html {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  height: 100%;
  font-family: sans-serif;
}

/* Modal */

.g-Modal {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.g-Modal__Close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  cursor: pointer;
  font-weight: bold;
  border-radius: 50%;
  border: 1px solid #EEE;
  background-color: transparent;
  width: var(--width-close-button);
  height: var(--width-close-button);
  font-size: 2rem;
  font-family: monospace;
}

.g-Modal__Close:hover, .g-Modal__Close:focus {
  background-color: #EEE;
}

.g-Modal__Content {
  position: relative;
  background-color: white;
  width: 50%;
  height: 50%;
  border-radius: 0.2rem;
  border: 1px solid #EEE;
  padding: 2rem;
  padding-right: calc(2rem + var(--width-close-button) + 2rem);
}

/* Filters */

aside {
  background-color: #333;
  color: white;
  width: 200px;
  overflow-y: auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.g-FilterTitle {
  padding: 0.5rem 1rem;
  background-color: #555;
  border-left: 8px solid transparent;
  font-weight: bold;
}

.g-Filter--Unselected {
  border-left: 8px solid #555;
}

.g-Filter--Selected {
  border-left: 8px solid #883333;
}

.g-Filter button {
  border: none;
  background-color: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  width: 100%;
  text-align: left;
}

.g-Filter button:hover {
  background-color: var(--color-focus);
}

/* Books */

main {
  width: 100%;
  padding: 1rem;
  overflow-y: auto;
}

header {
  display: flex;
  font-size: 120%;
  margin-bottom: 1rem;
}

.g-Search {
  margin-right: 1rem;
}

.g-Books {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-gap: 1rem;
}

.g-Book {
  align-self: center;
  border: 1px solid #DDDDDD;
  padding: 0;
  width: fit-content;
}

.g-Book:hover, .g-Book:focus {
  cursor: pointer;
  outline: none;
}

.g-Book:hover .g-Book__Image, .g-Book:focus .g-Book__Image {
  transform: scale(105%);
  opacity: 0.9;
}

.g-Book__Image {
  display: flex;
  width: 13rem;
  transition: all 0.2s ease-in-out;
}

/* Book detail */

.g-BookDetail {
  display: flex;
  justify-content: space-between;
}

.g-BookDetail img {
  width: 10rem;
}

.g-BookDetail__Title {
  font-size: var(--font-size-dog);
  margin-bottom: var(--spacing-beetle);
}

.g-BookDetail__Subtitle {
  font-style: italic;
  margin-bottom: var(--spacing-beetle);
}

.g-BookDetail__Genres {
  margin-top: var(--spacing-cat);
}