-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.css
177 lines (156 loc) · 4.15 KB
/
index.css
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
/* Base font settings for easy readability */
html {
font: 18px/1.5 -apple-system, BlinkMacSystemFont, sans-serif;
font-family: "berkeley mono"; /* Custom font for a magical feel */
}
/* Makes sure all elements have the same box model for consistency */
* {
box-sizing: border-box;
}
/* Styling for the body: dark mode with light text for contrast */
body {
background-color: black;
color: ivory;
}
/* Positioning of the body and custom elements to fill entire viewport */
body,
magic-library {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: 0;
}
/* Center form elements horizontally and vertically */
form {
display: flex;
justify-content: center;
align-items: center;
}
/* Styling for input fields inside forms */
input {
width: 100%;
padding: 0.5rem;
font-size: 1rem;
line-height: 1.5rem;
border: none;
background-color: black;
margin: 0.5rem;
color: #e0e0e0;
}
/* Container style for magic-book, allows horizontal scrolling */
magic-book {
display: flex;
margin: auto;
overflow-x: scroll;
scroll-snap-type: x mandatory;
}
/* Links in the books are titles; reset styling */
magic-book a {
color: inherit;
font-weight: bold;
text-decoration: none;
}
/* Detailed styling when magic-book is the target of a navigation */
magic-book:target {
height: 100%;
flex-direction: column;
overflow-y: scroll;
scroll-snap-type: y mandatory;
}
/* Styling for images not in target mode, with some border radius for visual comfort */
magic-book:not(:target) img {
max-height: 10rem;
border-radius: 1rem 0rem 0rem 1rem;
}
/* Background and alignment for figures outside of target mode */
magic-book:not(:target) figure {
display: flex;
align-items: center;
background-color: #111;
border: 4px solid #333;
border-radius: 1rem;
}
/* Ensures paragraphs within non-targeted books are centered and constrained in width */
magic-book:not(:target) p {
max-width: 7rem;
text-align: center;
}
/* Hides all but the first figure in non-target mode for clarity */
magic-book:not(:target) figure:not(:first-child) {
display: none;
}
/* Layout for figures, using grid for precise placement of child elements */
figure {
display: grid;
grid-template-columns: 2fr 1fr;
grid-template-rows: 0 min-content;
align-items: center;
align-content: center;
height: 100%;
scroll-snap-align: center;
flex-shrink: 0;
}
/* Styling for images within figures, ensuring fit and adding soft shadow */
figure img {
grid-column: 1;
grid-row: 2;
max-width: 100%;
max-height: 100%;
object-fit: contain;
box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.1);
border-radius: 2rem;
}
/* Audio elements are made slightly transparent for a subtle appearance */
figure audio {
grid-column: 1 / span 2;
grid-row: 1;
width: 100%;
opacity: 0.5;
}
/* Detailed styling for divs in figures, including margins for readability */
figure div {
grid-column: 2;
grid-row: 2;
margin-top: 0;
margin-left: 1.5rem;
margin-right: 1rem;
text-align: justify;
}
/* Figcaptions are hidden by default for a cleaner look */
figcaption {
display: none;
}
/* Marks the currently playing item with bold text for easy identification */
.playing {
font-weight: bold;
}
/* Utility class to hide elements */
.hide {
display: none;
}
/* Spinner animation for loading images, centered with rotation effect */
.img.generating::before {
content: "";
display: block;
width: 40px; /* Size of the spinner */
height: 40px; /* Size of the spinner */
border: 4px solid rgba(0, 0, 0, 0.1); /* Light grey border, less focus drawing */
border-radius: 50%; /* Circular spinner */
border-top-color: #3498db; /* Color hint for visual tracking */
animation: spin 1s ease-in-out infinite; /* Smooth, continuous rotation */
position: absolute; /* Positioned relative to the parent */
top: 50%; /* Centered vertically */
left: 50%; /* Centered horizontally */
transform: translate(-50%, -50%); /* Precise centering adjustment */
}
/* Keyframes for spinner animation, ensuring a smooth 360-degree rotation */
@keyframes spin {
from {
transform: translate(-50%, -50%) rotate(0deg);
}
to {
transform: translate(-50%, -50%) rotate(360deg);
}
}