-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathart-viewer.css
More file actions
251 lines (218 loc) · 4.25 KB
/
art-viewer.css
File metadata and controls
251 lines (218 loc) · 4.25 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
:root {
--gap: 12px;
--bg: #f6f7f9;
--panel: #ffffff;
--muted: #666;
}
html,
body {
height: 100%;
margin: 0;
font-family: Inter, Segoe UI, Roboto, system-ui, Arial;
}
header {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 16px;
background: var(--panel);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
header .back {
border: 0;
padding: 8px 10px;
border-radius: 8px;
cursor: pointer;
background: #eee;
text-decoration: none;
color: black;
}
header h1 {
font-size: 16px;
margin: 0;
flex: 1;
}
/* Theme toggle button */
.theme-toggle {
border: 0;
padding: 6px 12px;
border-radius: 8px;
cursor: pointer;
background: #eee;
font-size: 13px;
color: black;
transition: all 0.3s ease;
}
.theme-toggle:hover {
background: #ddd;
}
.wrap {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--gap);
padding: var(--gap);
height: calc(100vh - 64px);
background: var(--bg);
box-sizing: border-box;
}
.preview-panel,
.code-panel {
background: var(--panel);
border-radius: 10px;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
overflow: hidden;
display: flex;
flex-direction: column;
}
iframe.preview {
width: 100%;
height: 100%;
border: 0;
flex: 1;
background: white;
}
.code-header {
display: flex;
gap: 8px;
padding: 10px;
align-items: center;
border-bottom: 1px solid #eee;
background: #fafafa;
}
.code-header .filename {
font-weight: 600;
}
.btn {
border: 0;
padding: 8px 10px;
border-radius: 8px;
cursor: pointer;
background: #eee;
font-size: 13px;
text-decoration: none;
color: black;
}
.code-area {
padding: 12px;
overflow: auto;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New",
monospace;
font-size: 13px;
line-height: 1.4;
background: #0f1720;
color: #d6e9ff;
height: 100%;
box-sizing: border-box;
white-space: pre;
}
.controls {
margin-left: auto;
display: flex;
gap: 8px;
}
@media (max-width: 920px) {
.wrap {
grid-template-columns: 1fr;
height: auto;
}
iframe.preview {
height: 50vh;
}
.code-area {
height: 50vh;
}
}
/* --- Dark Mode --- */
body.dark {
--bg: #0f0f0f;
--panel: #1a1a1a;
--muted: #aaa;
color: #f0f0f0;
}
body.dark header {
background: var(--panel);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.dark .wrap {
background: var(--bg);
}
body.dark .preview-panel,
body.dark .code-panel {
background: var(--panel);
box-shadow: 0 6px 18px rgba(255, 255, 255, 0.06);
}
body.dark .code-area {
background: #0b0f14;
color: #cde0ff;
}
body.dark .code-header {
background: #181818;
border-bottom: 1px solid #333;
}
body.dark .btn,
body.dark .back,
body.dark .theme-toggle {
background: #222;
color: #eee;
border: 1px solid #333;
}
body.dark .btn:hover,
body.dark .back:hover,
body.dark .theme-toggle:hover {
background: #333;
}
.like-container {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
border-radius: 10px;
border: 1px solid var(--border-color);
background: transparent;
color: var(--secondary-text);
cursor: pointer;
transition: all 0.2s ease-in-out;
}
/* Unified hover effects for both buttons */
.view-code:hover,
.like-container:hover {
background-color: var(--accent-subtle);
border-color: var(--accent-color);
color: var(--accent-color);
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(108, 99, 255, 0.1);
}
/* Dark theme adjustments */
.dark-theme .view-code,
.dark-theme .like-container {
border-color: var(--button-border);
color: var(--secondary-text);
}
.dark-theme .view-code:hover,
.dark-theme .like-container:hover {
background-color: var(--accent-subtle);
border-color: var(--accent-color);
color: var(--accent-color);
box-shadow: 0 4px 15px rgba(139, 127, 255, 0.2);
}
/* Icon styling to inherit color and handle the 'liked' state */
.heart-icon {
width: 20px;
height: 20px;
stroke: currentColor;
/* Icon color will now match the text color */
fill: none;
transition: fill 0.2s, stroke 0.2s;
}
.heart-icon.liked {
fill: #ff4d4d;
stroke: #ff4d4d;
}
/* This prevents the icon from changing color on hover if it's already liked */
.like-container:hover .heart-icon.liked {
color: #ff4d4d;
}
.like-count {
font-weight: 500;
font-size: 0.9rem;
}