generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
362 lines (299 loc) · 7.02 KB
/
styles.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
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
/*
This CSS file will be included with your plugin, and
available in the app when your plugin is enabled.
If your plugin does not need CSS, delete this file.
*/
/* 使用 CSS 变量来存储模糊大小 */
:root {
--blur-amount: 5px;
}
/* 基础模糊效果 */
.blur-plugin-editor {
filter: blur(var(--blur-amount, 0.5em)) !important;
}
/* 不同标题级别的模糊效果 */
.blur-h1 {
filter: blur(calc(var(--blur-amount) * 2)) !important;
}
.blur-h2 {
filter: blur(calc(var(--blur-amount) * 1.75)) !important;
}
.blur-h3 {
filter: blur(calc(var(--blur-amount) * 1.5)) !important;
}
.blur-h4 {
filter: blur(calc(var(--blur-amount) * 1.25)) !important;
}
/* 普通元素的模糊效果 */
.blur-element {
filter: blur(var(--blur-amount)) !important;
}
/* 关键词模糊效果 */
.blur-keyword {
filter: blur(var(--blur-amount)) !important;
}
/* 确保模糊效果应用到编辑器的所有子元素 */
.blur-plugin-editor * {
filter: blur(var(--blur-amount)) !important;
}
/* 选择模式下的高亮效果 */
.blur-plugin-selecting {
outline: 2px solid rgba(255, 255, 0, 0.7) !important;
}
/* 预设中元素的高亮效果 */
.blur-plugin-preset {
outline: 2px solid rgba(0, 255, 0, 0.7) !important;
}
/* 编辑器元素的悬停高亮 */
.blur-plugin-hover {
outline: 2px solid rgba(255, 0, 0, 0.7) !important;
}
/* 确保 ribbon 元素不会被模糊 */
.ribbon-tab,
.side-dock-ribbon,
.ribbon-tab *,
.side-dock-ribbon * {
filter: none !important;
}
/* 预设列表样式 */
.preset-list-container {
max-height: 400px;
overflow-y: auto;
padding: 10px;
}
.preset-list {
list-style: none;
padding: 0;
margin: 0;
}
.preset-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px;
margin: 4px 0;
background: var(--background-secondary);
border-radius: 4px;
cursor: pointer;
}
.preset-item:hover {
background: var(--background-modifier-hover);
}
.preset-selector {
flex: 1;
margin-right: 10px;
word-break: break-all;
}
.preset-delete-btn {
color: var(--text-muted);
cursor: pointer;
padding: 0 8px;
font-size: 1.2em;
}
.preset-delete-btn:hover {
color: var(--text-error);
}
.preset-panel {
position: fixed;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
width: 300px;
z-index: 1000;
touch-action: none;
user-select: none;
top: 0;
left: 0;
transform: translate3d(20px, 50px, 0);
pointer-events: auto !important;
filter: none !important;
}
.preset-panel-handle {
padding: 10px;
background: var(--background-secondary);
border-radius: 8px 8px 0 0;
cursor: move;
user-select: none;
display: flex;
justify-content: space-between;
align-items: center;
touch-action: none;
}
.preset-panel-close {
cursor: pointer;
padding: 0 8px;
font-size: 1.2em;
}
.preset-panel-close:hover {
color: var(--text-error);
}
.preset-list-container {
max-height: 300px;
overflow-y: auto;
padding: 10px;
}
.preset-panel * {
pointer-events: auto !important;
filter: none !important;
}
.keywords-list {
margin: 10px 0;
padding: 10px;
border: 1px solid var(--background-modifier-border);
border-radius: 4px;
}
.keyword-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
margin: 5px 0;
background: var(--background-secondary);
border-radius: 4px;
}
.keyword-item button {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
padding: 0 5px;
}
.keyword-item button:hover {
color: var(--text-error);
}
.blur-manage-panel {
position: fixed;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
width: 300px;
z-index: 1000;
top: 50px;
left: 20px;
pointer-events: auto !important;
filter: none !important;
}
.blur-manage-panel * {
pointer-events: auto !important;
filter: none !important;
}
.blur-panel-handle {
padding: 10px;
background: var(--background-secondary);
border-radius: 8px 8px 0 0;
cursor: move;
user-select: none;
display: flex;
justify-content: space-between;
align-items: center;
}
.blur-panel-close {
cursor: pointer;
padding: 0 8px;
}
.blur-panel-tabs {
display: flex;
border-bottom: 1px solid var(--background-modifier-border);
}
.blur-panel-tab {
padding: 8px 16px;
cursor: pointer;
border-bottom: 2px solid transparent;
}
.blur-panel-tab.active {
border-bottom-color: var(--interactive-accent);
color: var(--interactive-accent);
}
.blur-panel-content {
padding: 16px;
}
.keyword-input-container {
display: flex;
gap: 8px;
margin-bottom: 16px;
}
.keyword-add-button {
opacity: 1 !important;
color: var(--text-normal) !important;
}
/* 编辑器元素的悬停高亮 */
.blur-plugin-hover {
outline: 2px solid rgba(255, 0, 0, 0.7) !important;
}
.panel-draggable {
position: absolute;
transform: translate3d(var(--panel-x, 0px), var(--panel-y, 0px), 0);
transition: transform 0ms;
user-select: none;
}
.blur-element {
filter: blur(calc(var(--blur-base-amount) * var(--blur-multiplier, 1) * 1em));
}
/* 为不同标题级别添加特定的模糊倍数 */
.blur-element[data-tag="h1"] {
--blur-multiplier: 2;
}
.blur-element[data-tag="h2"] {
--blur-multiplier: 1.75;
}
.blur-element[data-tag="h3"] {
--blur-multiplier: 1.5;
}
.blur-element[data-tag="h4"] {
--blur-multiplier: 1.25;
}
/* 面板容器布局 */
.blur-panel-container {
display: flex;
flex-direction: column;
}
/* 选择器和关键词容器 */
.panel-container-visible {
display: block;
}
.panel-container-hidden {
display: none;
}
/* 标签页容器 */
.blur-panel-tabs {
display: flex;
border-bottom: 1px solid var(--background-modifier-border);
}
.blur-panel-tab {
padding: 8px 16px;
cursor: pointer;
border-bottom: 2px solid transparent;
}
.blur-panel-tab.active {
border-bottom-color: var(--interactive-accent);
color: var(--interactive-accent);
}
.blur-panel-content {
padding: 16px;
}
/* 面板容器显示状态 */
.panel-container-hidden {
display: none !important;
}
.panel-container-visible {
display: block !important;
}
/* 预设元素的高亮效果 - 适用于所有元素 */
.blur-plugin-preset {
outline: 2px solid rgba(0, 255, 0, 0.7) !important;
}
/* 悬停时的高亮效果 - 适用于所有元素 */
.blur-plugin-hover {
outline: 2px solid rgba(255, 0, 0, 0.7) !important;
}
/* 选择模式下的高亮效果 */
.blur-plugin-selecting {
outline: 2px solid rgba(255, 255, 0, 0.7) !important;
}
/* 确保关键词模糊效果应用到所有元素 */
[data-keyword].blur-element,
[data-keyword].blur-plugin-editor {
filter: blur(var(--blur-amount)) !important;
}