Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
540 lines (472 loc) · 9.43 KB
/
Copy pathstyles.css
File metadata and controls
540 lines (472 loc) · 9.43 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
/* 基础容器样式 */
body {
margin: 0;
padding: 0;
min-width: 600px;
background-color: #fff;
height: 100vh;
overflow: hidden;
}
.container {
width: 100%;
height: 100%;
padding: 20px;
background: #fff;
position: relative;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
.header {
flex-shrink: 0;
margin-bottom: 20px;
padding: 0 20px;
}
.header h1 {
margin: 0;
font-size: 20px;
color: #5c6b89;
font-weight: 500;
}
/* 内容区域布局 */
.content-wrapper {
flex: 1;
display: flex;
overflow: hidden;
padding: 0 20px;
position: relative;
}
/* 左侧输入区域 */
.input-section {
width: 35%;
min-width: 300px;
max-width: calc(100% - 300px);
display: flex;
flex-direction: column;
overflow: hidden;
flex: none;
}
#markdown-input {
width: 100%;
flex: 1;
min-height: 150px;
padding: 16px;
border: 1px solid #e0e0e0;
border-radius: 8px;
font-size: 16px;
margin-bottom: 20px;
font-family: "JetBrains Mono", Menlo, Consolas, monospace;
line-height: 1.6;
resize: none;
box-sizing: border-box;
}
.button-group {
text-align: right;
margin-bottom: 20px;
flex-shrink: 0;
padding-right: 4px;
}
/* 分隔条 */
.resizer {
width: 4px;
background-color: #f0f2f7;
cursor: col-resize;
margin: 0 12px;
border-radius: 2px;
transition: all 0.2s ease;
position: relative;
}
.resizer::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 2px;
height: 40px;
background-color: #e2e8f0;
border-radius: 1px;
transition: all 0.2s ease;
}
.resizer:hover,
.resizer.resizing {
background-color: #63b3ed;
}
.resizer:hover::after,
.resizer.resizing::after {
background-color: #63b3ed;
height: 60px;
}
/* 按钮样式 */
button {
padding: 8px 16px;
margin-left: 12px;
background-color: var(--link-color, #63b3ed);
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.3s ease;
}
button:hover {
background-color: var(--primary-color, #4a5568);
transform: translateY(-1px);
}
/* 右侧预览区域 */
.preview-section {
flex: 1;
min-width: 300px;
display: flex;
flex-direction: column;
align-items: stretch;
overflow: hidden;
padding: 20px;
background-color: #f8fafc;
border-radius: 16px;
}
/* 手机外壳样式 */
#preview {
flex: 1;
overflow-y: overlay;
overflow-x: hidden;
padding: 2em;
border: 1px solid #eef2f8;
border-radius: 32px;
background-color: #fff;
font-family: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif", source-han-serif-sc, "PT Serif", "SongTi SC", "MicroSoft Yahei", Georgia, serif;
font-size: 16px;
line-height: 2;
color: #34495e;
box-shadow:
0 4px 20px rgba(138, 162, 211, 0.1),
0 8px 40px rgba(138, 162, 211, 0.1),
inset 0 2px 0 rgba(255, 255, 255, 0.1),
0 0 0 1px rgba(0, 0, 0, 0.05);
box-sizing: border-box;
display: none;
letter-spacing: 0.01em;
transition: box-shadow 0.3s ease;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
#preview:not(:empty) {
display: flex;
flex-direction: column;
}
/* 手机状态栏 */
#preview::before {
content: '';
position: sticky;
top: 0;
left: 0;
right: 0;
height: 24px;
background-color: #fff;
border-bottom: 1px solid #eef2f8;
border-radius: 32px 32px 0 0;
z-index: 2;
}
#preview:hover {
box-shadow:
0 8px 30px rgba(138, 162, 211, 0.15),
0 12px 50px rgba(138, 162, 211, 0.15),
inset 0 2px 0 rgba(255, 255, 255, 0.1),
0 0 0 1px rgba(0, 0, 0, 0.05);
}
/* 修改滚��条样式,同时应用于左侧文本框和右侧预览区域 */
#markdown-input::-webkit-scrollbar,
#preview::-webkit-scrollbar {
width: 8px;
}
#markdown-input::-webkit-scrollbar-track,
#preview::-webkit-scrollbar-track {
background: transparent;
}
#markdown-input::-webkit-scrollbar-thumb,
#preview::-webkit-scrollbar-thumb {
background-color: rgba(203, 213, 225, 0);
border-radius: 4px;
transition: background-color 0.3s;
}
#markdown-input:hover::-webkit-scrollbar-thumb,
#preview:hover::-webkit-scrollbar-thumb {
background-color: rgba(203, 213, 225, 0.5);
}
#markdown-input::-webkit-scrollbar-thumb:hover,
#preview::-webkit-scrollbar-thumb:hover {
background-color: rgba(148, 163, 184, 0.8);
}
/* 移除之前单独的预览区域滚动条样式 */
/* 添加新的样式来控制滚动条的显示 */
#preview {
-webkit-overflow-scrolling: touch;
}
/* 手机外壳样式 */
.phone-container {
flex: 1;
width: 85%;
height: auto;
margin: 0 auto;
background: #fff;
border-radius: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 20px;
position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
/* 其他样式保持不变... */
.image-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
cursor: zoom-out;
}
.overlay-image {
max-width: 90%;
max-height: 90%;
object-fit: contain;
cursor: default;
}
/* 预览区域内的图片样式 */
#preview img {
max-width: 100%;
height: auto;
display: block;
margin: 1em auto;
border-radius: 4px;
}
/* 表格样式 */
#preview table {
width: 100%;
border-collapse: collapse;
margin: 1.5em 0;
font-size: 0.95em;
display: table;
}
#preview thead {
display: table-header-group;
}
#preview tbody {
display: table-row-group;
}
#preview tr {
display: table-row;
}
#preview th,
#preview td {
border: 1px solid #e2e8f0;
padding: 12px;
text-align: left;
display: table-cell;
min-width: 100px;
}
#preview th {
background-color: #f8fafc;
color: #2d3748;
font-weight: 600;
}
#preview tr:nth-child(even) {
background-color: #f9fafb;
}
#preview tr:hover {
background-color: #f1f5f9;
}
/* 确保表格在小屏幕上可以水平滚动 */
#preview .table-container {
width: 100%;
overflow-x: auto;
margin: 1.5em 0;
border: 1px solid #e2e8f0;
border-radius: 4px;
display: block;
}
/* Markdown 基础样式 */
#preview {
/* 现有样式保持不变... */
}
/* 加粗文本 */
#preview strong {
font-weight: 600;
color: #2d3748;
}
/* 斜体文本 */
#preview em {
font-style: italic;
color: #4a5568;
}
/* 行内代码 */
#preview code:not(pre code) {
font-family: "JetBrains Mono", Menlo, Consolas, monospace;
background-color: #f7fafc;
padding: 2px 4px;
border-radius: 3px;
font-size: 0.9em;
color: #e53e3e;
border: 1px solid #edf2f7;
}
/* 链接样式 */
#preview a {
color: #4299e1;
text-decoration: none;
border-bottom: 1px solid transparent;
transition: all 0.2s ease;
}
#preview a:hover {
border-bottom-color: #4299e1;
color: #2b6cb0;
}
/* 分割线 */
#preview hr {
border: none;
border-top: 1px solid #e2e8f0;
margin: 2em 0;
}
/* 表格样式优化 */
#preview table {
width: 100%;
border-collapse: collapse;
margin: 1.5em 0;
font-size: 0.95em;
border: 1px solid #e2e8f0;
}
#preview th {
background-color: #f8fafc;
color: #2d3748;
font-weight: 600;
border: 1px solid #e2e8f0;
padding: 12px;
}
#preview td {
border: 1px solid #e2e8f0;
padding: 12px;
}
#preview tr:nth-child(even) {
background-color: #f9fafb;
}
#preview tr:hover {
background-color: #f1f5f9;
}
/* 表格容器 */
.table-container {
width: 100%;
overflow-x: auto;
margin: 1.5em 0;
border: 1px solid #e2e8f0;
border-radius: 4px;
display: block;
}
/* 删除线 */
#preview del {
color: #718096;
text-decoration: line-through;
}
/* 任务列表 */
#preview input[type="checkbox"] {
margin-right: 0.5em;
}
/* 图片说明文字 */
#preview img + em {
display: block;
text-align: center;
color: #718096;
font-size: 0.9em;
margin-top: 0.5em;
}
/* 代码块样式 */
#preview pre {
background-color: #282c34;
padding: 1em;
border-radius: 4px;
overflow-x: auto;
font-family: "JetBrains Mono", Menlo, Consolas, monospace;
font-size: 14px;
line-height: 1.5;
margin: 1em 0;
}
#preview pre code {
color: #abb2bf;
background: none;
padding: 0;
border: none;
font-size: inherit;
}
/* 引用块样式 */
#preview blockquote {
margin: 1em 0;
padding: 0.8em 1em;
background-color: #f7fafc;
border-left: 4px solid #a0aec0;
color: #4a5568;
font-style: normal;
}
#preview blockquote p {
margin: 0;
line-height: 1.8;
}
/* 处理引用块中的其他元素 */
#preview blockquote * {
font-style: normal;
}
/* 表格样式重写 */
#preview table {
width: 100%;
border-collapse: collapse;
margin: 1em 0;
font-size: 0.95em;
}
#preview table th,
#preview table td {
border: 1px solid #e2e8f0;
padding: 12px;
text-align: left;
}
#preview table th {
background-color: #f8fafc;
font-weight: 600;
color: #2d3748;
}
#preview table tr:nth-child(even) {
background-color: #f9fafb;
}
#preview table tr:hover {
background-color: #f1f5f9;
}
/* 移除表格容器的多余边框 */
#preview .table-container {
border: none;
margin: 1em 0;
overflow-x: auto;
}
/* 复制成功提示样式 */
.notification {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%) translateY(-100px);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 8px 16px;
border-radius: 4px;
font-size: 14px;
opacity: 0;
transition: all 0.3s ease;
z-index: 1000;
}
.notification.show {
transform: translateX(-50%) translateY(0);
opacity: 1;
}