forked from PRO-2684/transitio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.html
344 lines (334 loc) · 11.7 KB
/
settings.html
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
<style id="-transitio-style-settings">
/* 设置界面用到的 CSS */
/* Color scheme */
body {
&.q-theme-tokens-light[q-theme="light"] .transitio {
color-scheme: light;
}
&.q-theme-tokens-dark[q-theme="dark"] .transitio {
color-scheme: dark;
}
}
/* 文件选择框 */
.transitio input {
&[type="file"] {
border-color: var(--fill_standard_primary);
border-style: dashed;
border-radius: 0.5em;
padding: 0.5em;
transition: border-color 0.2s ease-in-out;
&:focus, &:hover {
border-color: var(--text_secondary);
}
&::file-selector-button {
background-color: transparent;
border-radius: 8px;
color: var(--text_primary);
border: 1px solid;
border-color: var(--fill_standard_primary);
height: 2em;
transition: background-color 0.2s ease-in-out;
}
&::file-selector-button:hover {
background-color: var(--overlay_hover);
}
}
&[type="checkbox"] {
appearance: auto;
width: 1.2em;
height: 1.2em;
}
&[type="number"], &[type="search"] {
border: 1px solid gray;
border-radius: 0.5em;
padding-left: 0.5em;
}
&[type="number"] {
max-width: 5em;
}
&[type="range"] {
appearance: auto;
}
&#transitio-search {
float: right;
padding-top: 0.1em;
padding-bottom: 0.1em;
scroll-margin-top: 3em; /* Prevent overlapping with logo */
}
&:invalid {
border-color: red;
}
}
/* 各个用户样式 */
.transitio details {
&.is-loading { /* Loading snippets */
cursor: progress;
opacity: 0.6;
> * {
pointer-events: none;
}
}
&[data-deleted] { /* Deleted snippets */
cursor: not-allowed;
filter: grayscale(1);
opacity: 0.6;
> summary > setting-item > div > setting-text[data-type="primary"]::after {
display: none;
}
> * {
pointer-events: none;
}
}
&[data-search-hidden] { /* Hidden by search */
display: none;
+ setting-divider { /* Hide divider */
display: none;
}
}
> summary {
list-style: none;
outline: none;
&::highlight(transitio-search-highlight) {
background-color: yellow;
color: black;
}
> setting-item > div > setting-text[data-type="primary"] {
&::after { /* Preprocessor hashtag */
content: "#" attr(data-preprocessor);
text-transform: capitalize;
font-size: smaller;
border-radius: 4px;
margin-left: 0.1em;
padding: 2px;
opacity: 0.8;
}
&[data-preprocessor="none"]::after {
background: #808080aa;
}
&[data-preprocessor="transitio"]::after {
background: #74a9f6aa;
}
&[data-preprocessor="stylus"]::after {
background: #6da13faa;
}
&[data-hashtag-highlight]::after {
opacity: 1;
font-weight: bold;
}
}
&:hover .transitio-more {
opacity: 0.6;
&:not([disabled]):hover {
scale: 1.2;
opacity: 1;
}
&[disabled] {
opacity: 0.3;
cursor: not-allowed;
}
}
}
&[open] > summary {
border-bottom: 1px dashed var(--fill_standard_secondary);
.transitio-more.transitio-configure {
scale: 1.2;
transform: rotate(180deg);
opacity: 1;
}
}
> label {
display: list-item;
margin-left: 1.5em;
padding: 0.5em 0;
> input, > select {
float: right;
}
}
}
/* 关于 */
.transitio .about setting-item {
flex: 1;
margin: 0px 10px;
border-radius: 8px;
text-align: center;
background-repeat: no-repeat;
background-size: 3em;
background-position: center;
transition: background 0.2s ease-in-out;
&:hover {
background-size: 2em;
background-position: left;
}
}
.transitio #transitio-tips {
display: block;
margin: -1em auto 1em auto;;
opacity: 0.5;
background: none;
font-size: smaller;
text-align: center;
&::before {
content: "💡";
padding-right: 0.5em;
}
code, kbd {
background: var(--fill_standard_primary);
border-radius: 4px;
padding: 0.1em 0.3em;
margin: 0 0.1em;
}
b, em {
font-weight: bold;
}
i {
font-style: italic;
}
}
/* 链接 */
.transitio .transitio-link {
cursor: pointer;
width: fit-content;
margin: auto;
transition: color 0.2s ease-in-out;
&:hover {
color: var(--brand_standard);
}
}
/* 菜单 */
.transitio .transitio-menu {
display: flex;
justify-content: center;
align-items: center;
gap: 0.8em;
}
/* 悬浮显示的按钮 */
.transitio .transitio-more {
opacity: 0;
transition-property: color, opacity, scale, transform;
transition-duration: 0.2s;
transition-timing-function: ease-in-out;
font-family: system-ui, PingFang SC, PingFangSC-Regular, Microsoft YaHei, Hiragino Sans GB, Heiti SC, WenQuanYi Micro Hei, sans-serif, Apple Braille;
}
/* Logo */
.transitio .logo {
position: fixed;
right: 20px;
top: 40px;
width: 4em;
height: 4em;
z-index: 9999;
opacity: 0;
transition: opacity 0.2s ease-in-out;
background: none !important;
&:hover {
opacity: 1;
animation: 4s magic 0.2s;
}
}
/* Easter eggs */
.setting-title {
&.lumos::after {
content: "🌟 Lumos!";
padding-left: 1em;
opacity: 0.5;
}
&.nox::after {
content: "🌙 Nox!";
padding-left: 1em;
opacity: 0.5;
}
&.wand > .icon-area::after {
content: "🪄";
padding-right: 0.5em;
}
}
/* 动画 */
/* Magic wand - Adapted from https://codepen.io/averyhw/pen/xyxKjO/ */
@keyframes magic {
0% { transform: rotate(0deg) translateX(0px) rotate(0deg) scale(1); transform-origin: 50% 50%; }
15% { transform: rotate(0deg) translateX(20px) rotate(0deg) scale(1); transform-origin: 50% 50%; }
70% { transform: rotate(360deg) translateX(0px) rotate(-360deg) scale(1); transform-origin: 50% 50%; }
77% { transform: rotate(360deg) translateX(0px) rotate(-360deg) scale(0.9); transform-origin: 50% 50%; }
80% { transform: rotate(360deg) translateX(0px) rotate(-360deg) scale(1); transform-origin: 50% 50%; }
100% { transform: rotate(360deg) translateX(0px) rotate(-360deg) scale(1); transform-origin: 50% 50%; }
}
</style>
<img class="logo" src=""></img>
<setting-section data-title="调试" class="dev">
<setting-panel>
<setting-list data-direction="column">
<setting-item data-direction="row">
<div>
<setting-text id="transitio-debug">开发者模式</setting-text>
<setting-text data-type="secondary">监听文件目录,本地修改 CSS 后自动重载所有样式(可能造成性能损失)</setting-text>
</div>
<setting-switch id="transitio-dev"></setting-switch>
</setting-item>
<setting-item data-direction="row">
<div>
<setting-text>打开样式目录</setting-text>
<setting-text data-type="secondary">点击以打开存放样式的目录</setting-text>
</div>
<setting-button data-type="primary" id="transitio-open-folder">打开目录</setting-button>
</setting-item>
</setting-list>
</setting-panel>
</setting-section>
<input autofocus type="search" id="transitio-search" title="键入内容以搜索..." placeholder="🔍 Search...">
<setting-section data-title="用户样式列表" class="snippets">
<setting-panel>
<setting-list data-direction="column">
<setting-item data-direction="row">
<div>
<setting-text id="transitio-reload" title="双击以立即重载样式">导入用户样式...</setting-text>
<setting-text data-type="secondary">导入自定义的用户样式,或查看<span class="transitio-link"
id="transitio-snippets" style="font-style: italic;"
data-transitio-url="https://pro-2684.github.io/?page=transitio_userstyles">用户样式列表</span></setting-text>
</div>
<input id="transitio-import" type="file" accept="text/css" multiple />
</setting-item>
</setting-list>
</setting-panel>
</setting-section>
<setting-section data-title="关于" class="about">
<setting-panel>
<setting-list data-direction="row">
<setting-item id="transitio-about-version">
<div>
<setting-text>版本</setting-text>
<setting-text data-type="secondary">
<span class="transitio-link" id="transitio-version"
data-transitio-url="https://github.com/PRO-2684/transitio">NaN</span>
</setting-text>
</div>
</setting-item>
<setting-item id="transitio-about-author">
<div>
<setting-text>作者</setting-text>
<setting-text data-type="secondary">
<span class="transitio-link" data-transitio-url="https://github.com/PRO-2684/">PRO-2684</span>
</setting-text>
</div>
</setting-item>
<setting-item id="transitio-about-issues">
<div>
<setting-text>反馈</setting-text>
<setting-text data-type="secondary">
<span class="transitio-link"
data-transitio-url="https://github.com/PRO-2684/transitio/issues">GitHub Issues</span>
</setting-text>
</div>
</setting-item>
<setting-item id="transitio-about-submit">
<div>
<setting-text>投稿</setting-text>
<setting-text data-type="secondary">
<span class="transitio-link"
data-transitio-url="https://github.com/PRO-2684/transitio/issues/4">提交您的片段</span>
</setting-text>
</div>
</setting-item>
</setting-list>
</setting-panel>
</setting-section>
<span id="transitio-tips"></span>