Hexo魔改 - Twikoo评论新样式 部署教程

评论样式参照张洪Heo博客,是F12来的,没有技术含量,就自己看着很喜欢,自用没问题。另外,本文也作记录,以备日后使用需要。

效果展示

电脑显示样式

手机显示样式

实现方法

整个界面的实现是通过CSS完成,无其他附加文件,附加的CSS内容可以放到自定义文件或者直接放在twikoo.styl文件内。

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
/*twikoo样式修改*/
#twikoo .tk-row .tk-avatar {
display: none;
}

#twikoo .tk-row .tk-col {
flex-direction: column-reverse !important;
}

.tk-col {
flex: 1;
display: flex;
flex-direction: column;
}

.tk-meta-input {
margin-bottom: 0.5rem;
width: 70%
}

.tk-meta-input {
display: flex;
}

.tk-meta-input {
position: relative !important;
margin-top: 0.8rem;
width: calc(100% - 5.5rem);
}
.el-input.el-input--small.el-input-group.el-input-group--prepend {
border-radius: 12px;
background: var(--anzhiyu-secondbg);
border: var(--style-border-always);
}

.tk-row.actions {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
margin-left: 3.5rem;
align-items: center;
justify-content: flex-end;
}
.OwO .OwO-body {
display: none;
position: absolute;
left: 0;
right: 0;
max-width: 500px;
color: #4a4a4a;
background-color: #ffffff;
border: 1px solid rgba(144,147,153,0.31);
top: 2em;
border-radius: 0 4px 4px;
z-index: 1000;
}
.OwO .OwO-body {
width: 600px;
border: var(--style-border-always) !important;
border-radius: 8px !important;
overflow: hidden;
background-color: var(--Jay-maskbg) !important;
backdrop-filter: saturate(180%) blur(10px);
-webkit-backdrop-filter: blur(10px);
}
@media screen and (max-width: 768px){
.OwO .OwO-body {
width: 250px;
}
}
.OwO .OwO-body .OwO-items-show {
margin: 12px 8px !important;
min-height: 197px;
}
.OwO .OwO-body .OwO-items {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: none;
padding: 10px;
padding-right: 0;
margin: 0;
overflow: auto;
font-size: 0;
}

@media screen and (max-width: 400px){
#twikoo .OwO-items > .OwO-item {
width: 25%;
}
}
@media screen and (max-width: 460px){
#twikoo .OwO-items > .OwO-item {
width: 20%;
}
}
@media screen and (max-width: 600px){
#twikoo .OwO-items > .OwO-item {
width: 16%;
}
}
.OwO .OwO-body .OwO-items-image .OwO-item {
width: 25%;
box-sizing: border-box;
}

.OwO .OwO-body .OwO-items .OwO-item {
list-style-type: none;
padding: 5px 10px;
border-radius: 5px;
display: inline-block;
font-size: 12px;
line-height: 14px;
cursor: pointer;
-webkit-transition: .3s;
transition: .3s;
text-align: center;
}
.tk-row.actions {
margin-bottom: 0 !important;
margin-left: 0 !important;
margin-top: 0 !important;
justify-content: space-around !important;
}
.tk-row-actions-start {
flex: 1;
display: flex;
align-items: center;
}
.tk-row-actions-start {
position: absolute;
top: -87px;
left: 17px;
}
@media screen and (max-width: 768px){
.tk-row-actions-start {
top: -176px;
}
}
@media screen and (width: 768px){
.tk-row-actions-start {
bottom: 0px;
}
}
#twikoo>div.tk-comments>div.tk-submit>div.tk-row.actions>a {
display: none !important;
}

.tk-submit-action-icon.__markdown {
color: #909399;
}

.tk-submit-action-icon {
align-self: center;
display: inline-block;
width: 1.25em;
line-height: 0;
margin-right: 10px;
cursor: pointer;
flex-shrink: 0;
}

.el-button.tk-preview {
display: none !important;
}

.el-button--small, .el-button--small.is-round {
padding: 9px 15px;
}

.el-button--mini, .el-button--small {
font-size: 12px;
border-radius: 3px;
}

.tk-comments .el-button--primary.is-disabled,
.tk-comments .el-button--primary.is-disabled:active,
.tk-comments .el-button--primary.is-disabled:focus,
.tk-comments .el-button--primary.is-disabled:hover {
opacity: .2;
}

.tk-comments .el-button--primary {
/*border-color: var(--anzhiyu-fontcolor)!important;*/
color: var(--anzhiyu-card-bg)!important;
border-radius: 12px!important;
box-shadow: var(--anzhiyu-shadow-black);
transition: .3s;
width: 5rem;
position: absolute;
top: -43px;
right: 0;
margin-left: 0.5rem!important;
height: 32px;
}

@media screen and (max-width: 768px){
.tk-submit .el-button--primary {
width: 5rem;
height: 122px;
top: -132px;
}
}

@media screen and (max-width: 768px){
.tk-comments button.el-button.tk-send, .tk-comments button.el-button.tk-cancel {
width: 5rem;
}
}

#page .tk-meta-input .el-input {
box-shadow: var(--anzhiyu-shadow-border);
}

@media screen and (max-width: 769px){
.el-input.el-input--small.el-input-group.el-input-group--prepend {
background: var(--anzhiyu-card-bg);
margin-bottom: 0;
}
}

.el-input.el-input--small.el-input-group.el-input-group--prepend {
border-radius: 12px;
background: var(--anzhiyu-secondbg);
border: var(--style-border-always);
}

.tk-meta-input .el-input .el-input-group__prepend {
padding: 0 1rem;
}

@media screen and (max-width: 768px){
.tk-meta-input .el-input .el-input-group__prepend {
padding: 0 8px!important;
}
}

.tk-meta-input .el-input .el-input-group__prepend {
-webkit-user-select: none;
border-radius: 10px 0 0 10px;
border-right: var(--style-border-always);
}

.el-input-group__append, .el-input-group__prepend {
background-color: #F5F7FA;
color: #909399;
vertical-align: middle;
display: table-cell;
position: relative;
border: 1px solid #DCDFE6;
border-radius: 4px;
padding: 0 20px;
width: 1px;
white-space: nowrap;
}
.el-input-group__append, .el-input-group__prepend {
background-color: var(--anzhiyu-card-bg)!important;
color: var(--anzhiyu-fontcolor)!important;
border-color: var(--anzhiyu-card-border)!important;
border: none!important;
font-weight: 700;
}

.el-input-group--prepend .el-input__inner, .el-input-group__append {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}

.el-input-group>.el-input__inner {
vertical-align: middle;
display: table-cell;
}

.el-input--small .el-input__inner {
height: 32px;
line-height: 32px;
}

.el-input-group--prepend .el-input__inner, .el-input-group__append {
border-radius: 12px!important;
}

.el-input--small .el-input__inner {
padding: 8px;
padding-left: 16px;
}

.el-input-group--prepend .el-input__inner, .el-input-group__append {
border-left-width: 0!important;
}

.el-input__inner {
-webkit-appearance: none;
background-color: #FFF;
border-radius: 4px;
border: 1px solid #DCDFE6;
box-sizing: border-box;
color: #606266;
display: inline-block;
height: 40px;
line-height: 40px;
outline: 0;
padding: 0 15px;
transition: border-color .2s cubic-bezier(.645,.045,.355,1);
width: 100%;
}

.el-input-group__append .el-button, .el-input-group__append .el-input, .el-input-group__prepend .el-button, .el-input-group__prepend .el-input, .el-input__inner {
font-size: inherit;
}

.el-input__inner, .el-textarea__inner {
background-image: none;
-webkit-box-sizing: border-box;
-webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
}

@media screen and (max-width: 769px){
.el-input__inner {
background: var(--anzhiyu-card-bg)!important;
}
}

.el-input__inner {
background: var(--anzhiyu-secondbg)!important;
border: none!important;
color: var(--anzhiyu-fontcolor)!important;
padding-left: 8px;
}

.tk-submit-action-icon.__markdown {
display: none;
}

button.el-button.tk-cancel.el-button--default.el-button--small {
background: var(--anzhiyu-secondbg) !important;
border-radius: 8px !important;
color: var(--anzhiyu-fontcolor) !important;
}

#page .tk-meta-input .el-input {
box-shadow: var(--anzhiyu-shadow-border);
}

@media screen and (max-width: 768px){
.tk-meta-input .el-input {
margin-left: 0px !important;
width: 100% !important;
margin-bottom: 8px;
}
}
.el-input.el-input--small.el-input-group.el-input-group--prepend::before {
z-index: 100;
}
#page .tk-meta-input .el-input {
box-shadow: var(--Jay-shadow-border);
}
.twikoo .el-input__inner,
.twikoo .el-textarea__inner {
color: currentColor;
background-color: transparent;
border-color: rgba(144,147,153,0.31);
color: white;
}
[data-theme="dark"] details > summary {
background: none !important;
}

另外需要删除 以下内容

1
2
3
4
5
6
7
8
9
10
.tk-comments .tk-row-actions-start {
position: relative;
top: -56px;
left: 17px;
}
.tk-comments .tk-main .tk-row-actions-start {
position: relative;
top: -56px;
left: 16px;
}

完事~