Hexo NexT主题移动端样式适配

个人网站搭建也有一段时间了,期间整合了挺多个性化功能,都是基于 PC 端而做的。最近在推自己小站时,朋友间的分享都是基于手机,然而 NexT 自有的样式在移动端的效果并不大理想,遂萌生了样式适配的想法。NexT 主题有预留给用户自定义 css 样式的文件:custom.styl,在这里可以添加自己喜欢的样式代码。

本站主题已 Share 至 Github,欢迎访问

手机端主页:

lD2Cfx.png

其它的页面也做了美化,就不一一贴图了,具体效果可在手机端查看,以下是之前保存的截图链接地址

本站基于 Hexo v3.9.0、 NexT v5.1.4 魔改,其它版本不敢保证都能兼容!

附上本站自定义的 custom.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
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
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
#days {
display: block;
color: rgb(7, 179, 155);
font-size: 13px;
}

/*网站底部订阅图标*/
.subscribe-box {
position: absolute;
bottom: 45px;
left: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,.35);
animation: heartAnimate 2s ease-in-out infinite;
}
.subscribe-menu {
position: relative;
height: 24px;
width: 24px;
cursor: url(/images/pointer.cur),auto;
background: url(/images/wechat.svg);
background-size: 24px 24px;
}
.subscribe-hover {
position: absolute;
bottom: 0;
left: 0;
height: 0;
width: 0;
border-radius: 3px;
box-shadow: 0 0 10px 0 rgba(0,0,0,.35);
background: url(https://s2.ax1x.com/2019/11/02/KLhDeA.th.jpg);
background-color: #fff;
background-repeat: no-repeat;
background-size: 150px 150px;
transition: all .35s ease-in-out;
z-index: 1024;
opacity: 0;
}
.subscribe-description {
opacity: 0;
position: absolute;
bottom: 3%;
left: 5%;
right: 5%;
font-size: 12px;
transition: all .35s cubic-bezier(1,0,0,1);
}
.subscribe-menu:hover .subscribe-hover {
bottom: 24px;
left: 24px;
height: 140px;
width: 150px;
opacity: 1
}
.subscribe-menu:hover .subscribe-description {
opacity: 1
}

/*菜单*/
.menu-item:hover{
transform: scale(1.1);
box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);
//border-radius: 3px;
}

/*近期文章*/
.my-links-of-blogroll-li:hover{
transform: scale(1.1);
box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);
/* 动画效果 */
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: hue 1.5s linear infinite;
background-image: linear-gradient(
to right,
#fffed4,
#fffede,
#fdffe2,
#f7ffec,
#ecfaf3,
#f1fffd,
#fafbff,
#f7fffc,
#fffee4
);
}

/* 排行榜 */
.my-article-top:hover{
transform: scale(1.1);
box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);
border-radius: 30px;
width: 400px;
padding: 5px 10px;
transition-duration: 0.15s;
+mobile(){
width: 315px;
}
/* 动画效果 */
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: hue 1.5s linear infinite;
background-image: linear-gradient(
to right,
#fffed4,
#fffede,
#fdffe2,
#f7ffec,
#ecfaf3,
#f1fffd,
#fafbff,
#f7fffc,
#fffee4
);
}

/*归档页样式优化 began*/
.page-archive .archive-page-counter {
font-size: 18px;
background-color: #49b1f5;
padding-left: 10px;
padding-right: 10px;
border-radius: 8px;
color: #fff;
+mobile() {
font-size: 16px;
}
}
.my-post-time{
font-size: 11px;
position: absolute;
color: #fff;
background-color: #49b1f5;
border-radius: 5px;
padding-left: 5px;
padding-right: 5px;
margin-left: 15px;
}
.mypost{
position: relative;
margin-bottom: 1rem;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
a.my-post-title-link:before{
top: 10px;
width: 18px;
height: 18px;
content: "📚";
margin-right: 5px;
font: normal normal normal 14px/1 FontAwesome;
font-size: 15px;
line-height: 18px;
}
.my-post:hover{
transform: scale(1.1);
box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);
border-radius: 30px;
width: 400px;
padding: 1px 10px;
margin-left: 25px;
font-size: 16px;
transition-duration: 0.15s;
+mobile(){
width: 260px;
margin-left: 18px;
}
/* 动画效果 */
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: hue 2s linear infinite;
background-image: linear-gradient(
to right,
#fffed4,
#fffede,
#fdffe2,
#f7ffec,
#ecfaf3,
#f1fffd,
#fafbff,
#f7fffc,
#fffee4
);
}
a.my-post-title-link{
text-decoration: none;
font-size: 15px;
font-weight: 400;
+mobile() {
font-size: 14px;
}
}
.my-post-title{
display: block;
margin-left: 4.5rem;
color: #4c4948;
text-decoration: none;
font-size: .8rem;
cursor: pointer;
+mobile() {
//margin-left: 4rem;
}
}
.my-post-header{
position: top;
margin-bottom: 1rem;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.my-post-meta{
position: absolute;
color: #99a9bf;
width: 80px;
color: #114142;
}
div.post-block.tag .collection-title h2 {
border-width: 1px;
border-style: solid;
border-color: #3f3f3f;
border-radius: 20px;
font-size: 22px;
background-color: #b4e8fa;
padding: 2px 15px;
letter-spacing: 1.5px;
box-sizing: border-box;
color: #3f3f3f;
display: inline-block;
margin: 10px 0 10px;
text-align: center;
+mobile(){
font-size: 18px;
}
}
.category-list-link:hover{
transform: scale(1.1);
box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);
border-radius: 8px;
padding: 1px 1px;
margin-left: 5px;
font-size: 16px;
transition-duration: 0.15s;
}
/*归档页样式优化 end */

.main{
padding-bottom: 150px;
}

.headband {
//display: none;
height: 1px;
background: $gainsboro;
+mobile(){
height: 0px;
}
}

body {
background-repeat: no-repeat;
background-attachment:fixed;
background-position:50% 50%;
}

/*评论数*/
.posts-expand .post-comments-count {
display: none;
}

/*鼠标样式*/
* {
cursor: url(/images/default.cur),auto;
}
:link {
cursor: url(/images/pointer.cur),auto
}

/*文章底部评分相关*/
.post-widgets {
margin-bottom: 45px;
margin-top: 30px;
}

/*文章底部标签样式*/
.posts-expand .post-tags a {
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
font-family: 'Comic Sans MS', sans-serif;
transition: .2s ease-out;
padding: 3px 5px;
margin: 5px;
background: #f5f5f5;
border-bottom: none;
border-radius: 15px;

+mobile(){
padding: 1px 3px;
font-size: 8px;
}

&:hover {
background: rgba(100,154,182,0.902);
color: #fff;
-webkit-box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
-moz-box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
}

/* pc主页文章添加阴影效果 */
.post {
margin-top: 0px;
margin-bottom: 50px;
padding: 25px;
-webkit-box-shadow: 0 0 5px rgba(202, 203, 203, .5);
-moz-box-shadow: 0 0 5px rgba(202, 203, 204, .5);
}

/* 1~4级标题设置 */
h1,
h2,
h3,
h4,
strong {
font-weight: 600;
color: #2c3e50;
}

blockquote{// PC端>符号表示的内容样式
font-size: 15px;
background: #d9efdc5e;
border-left-color: #0fc53085;
}
.tip, blockquote {
padding: 12px 24px 12px 30px;
margin: 1em 0;
}
p {
margin: 10px 0 10px 0;
}

/*文章页*/
.posts-expand{
margin: 0 1px;
padding-top: 0px;
}

.posts-expand .post-body p{
font-size: 15px;
letter-spacing: 1px;
margin:3px 0;
padding-bottom:4px;
}

.posts-expand .post-body .fancybox img {
margin: 10px auto 10px;
}

/* 一到六级标题设置 */
.posts-expand .post-body h1,
.posts-expand .post-body h2,
.posts-expand .post-body h3,
.posts-expand .post-body h4,
.posts-expand .post-body h5,
.posts-expand .post-body h6 {
padding-top: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
}

.posts-expand .post-body ul li{
margin-bottom: 10px;
list-style: none;
color: #000;
font-size: 15px;
}
.posts-expand .post-body ul li p{
text-align: left;
}

/* 隐藏返回顶部猫,使用魔方替代 */
.back-to-top {
width: 70px; //图片素材宽度
height: 900px; //图片素材高度
top: -900px;
bottom: unset;
transition: all .5s ease-in-out;
background: url("/images/scroll.png");
> i {
display: none;
}
&.back-to-top-on {
bottom: unset;
top: 100vh < (900px + 200px) ? calc( 100vh - 900px - 200px ) : 0px;
}
}
*/

/*代码块复制按钮*/
.highlight{
position: static;
}

highlight-wrap {
background: #008b89;
}

.btn-copy {
display: inline-block;
cursor: pointer;
background-color: #eee;
background-image: linear-gradient(#fcfcfc,#eee);
border: 1px solid #d5d5d5;
border-radius: 3px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-appearance: none;
font-size: 13px;
font-weight: 700;
line-height: 20px;
color: #333;
-webkit-transition: opacity .3s ease-in-out;
-o-transition: opacity .3s ease-in-out;
transition: opacity .3s ease-in-out;
padding: 2px 6px;
position: absolute;
right: 5px;
top: 5px;
opacity: 0;
}
.btn-copy span {
margin-left: 5px;
}
.highlight:hover .btn-copy{
opacity: 1;
}
.read-over{//本文阅读结束
text-align: center;
margin-top: 20px;
color: #ea103d91;
font-size:18px;
}

.share_reward{//pc打赏
margin: 10px auto;
width: 90%;
text-align: center;
}
#rewardButton {//打赏
margin: 15px auto;
}

code {
color: #c7254e;
background: #f9f2f4;
border: 1px solid #d6d6d6;
padding:1px 4px;
word-break: break-all;
border-radius:4px;
}
/*大代码块的自定义样式*/
.highlight, pre {
margin: 0px 0;
border-radius: 3px;
}
.highlight, code, pre {
border: 1px solid #d6d6d6;
}

.post-body {
color: #000;
}
.post-body .note{//提示条
font-size: 15px;
}

/*文章标题字体*/
.posts-expand .post-title {
font-size: 28px;
letter-spacing: 1px;
font-weight: 700;
text-align: center;
+mobile() {
font-size: 20px;
}
}

/*文章标题动态效果*/
.posts-expand .post-title-link::before {
background-image: linear-gradient(90deg, #a166ab 0%, #ef4e7b 25%, #f37055 50%, #ef4e7b 75%, #a166ab 100%);
}
/*文章大标题*/
.posts-expand .post-title-link:hover{
transform: scale(1.1);
}

.posts-expand .post-meta{
margin-bottom: 20px!important;
}

.post-body a{
color: #0593d3;
border-bottom: none;
border-bottom: 1px solid #0593d3;
//text-decoration: underline // none || underline || blink || overline || line-through
&:hover {
color: #fc6423;
text-decoration: none;
border-bottom: 1px solid #fc6423;
}
}

/* 精品文章 began */
.jingping{
background : #00a8c3;
padding:2px 4px 2px 4px;
color: #fff;
}
/* 精品文章 end */

/*热评文章 */
.ds-top-threads li a {
padding-left: 5px;
transition: border-width 0.2s linear 0s, color 0.2s linear 0s;
border-bottom: none;
}
.ds-top-threads li a:hover {
border-left: 8px solid #4d768c;
}

/*相关文章推荐 pc样式设置*/
summary{
outline: 0;
cursor: pointer;
margin-top: 15px;
+mobile() {/*手机端*/
font-size: 14px;
margin-top: 10px;
}
}
details{
margin-left: 20px;
}
details .popular-posts{
+mobile() {
margin: 5px -12px;
}
}
.popular-posts-header {
margin-top: 45px;
font-size: 20px;
font-weight: 900;
border-bottom: 1px solid #eee;
+mobile() {/*手机端*/
font-size: 18px;
margin-top: 25px;
}
}
ul.popular-posts .popular-posts-item .popular-posts-title a {
border-bottom: 1px solid #999;
&:hover{
border-bottom: none;
}
}

.xiaohutong-img-class{
width:960px;
height:660px;
}

/*友链页样式 begain --------> */
#links{
margin-top: 5rem;
}
.links-content{
margin-top:1rem;
}
.link-navigation::after {
content: " ";
display: block;
clear: both;
}
.card {
width: 300px;
font-size: 1rem;
padding: 10px 20px;
border-radius: 4px;
transition-duration: 0.15s;
margin-bottom: 1rem;
display:flex;
}
.card:nth-child(odd) {
float: left;
}
.card:nth-child(even) {
float: right;
}
.card:hover {
transform: scale(1.1);
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
/* 动画效果 */
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: hue 1.5s linear infinite;
background-image: linear-gradient(
to right,
#fffed4,
#fffede,
#fdffe2,
#f7ffec,
#ecfaf3,
#f1fffd,
#fafbff,
#f7fffc,
#fffee4
);
}
.card a, .card a:hover {
border:none;
}
.card .ava {
width: 3rem!important;
height: 3rem!important;
margin:0!important;
margin-right: 1em!important;
border-radius:4px;
}
.card .card-header {
font-style: italic;
overflow: hidden;
width: 236px;
}
.card .card-header a {
font-style: normal;
color: #2bbc8a;
font-weight: bold;
text-decoration: none;
}
.card .card-header a:hover {
color: #d480aa;
text-decoration: none;
}
.card .card-header .info {
font-style:normal;
color:#a3a3a3;
font-size:14px;
min-width: 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
span.focus-links {
font-style: normal;
margin-left: 10px;
position: unset;
left: 0;
padding: 0 7px 0 5px;
font-size: 11px;
border-color: #42c02e;
border-radius: 40px;
line-height: 24px;
height: 22px;
color: #fff !important;
background-color: #42c02e;
display: inline-block;
}
span.focus-links:hover{
background-color: #318024;
}
.friends-btn{
text-align: center;
color: #555!important;
background-color: #fff;
border-radius: 3px;
font-size: 15px;
box-shadow: inset 0 0 10px 0 rgba(0,0,0,.35);
border: none!important;
transition-property: unset;
padding: 0 15px;
margin: inherit;
}
.friends-btn:hover{
color: rgb(255, 255, 255) !important;
border-radius: 3px;
font-size: 15px;
box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, 0.35);
background-image: linear-gradient(90deg, #a166ab 0%, #ef4e7b 25%, #f37055 50%, #ef4e7b 75%, #a166ab 100%);
margin: inherit;
}
/*友链页样式 end --------> */

.menu {
float: none;
}
.logo-line-before,
.logo-line-after {
display: none;
}
.menu .menu-item a {
font-size: 14px;
color: rgb(15, 46, 65);
border-radius: 4px;
}

/* 网站标题 炫彩效果1 */
.site-title{
background-image: linear-gradient(
to right,
orangered,
orange,
gold,
lightgreen,
cyan,
dodgerblue,
mediumpurple,
hotpink,
orangered
);
/*注意颜色得始终要相同,不然就会有突变颜色线条,影响视觉*/
background-size: 110vw;
-webkit-background-clip: text;
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: sliding 30s linear infinite;
}
@keyframes sliding{
to{
background-position: -2000vw;
}
}

/* 网站副标题 炫彩效果2 */
.site-meta, /* 移动端炫动效果 */
.site-subtitle {
font-family: 'Apple Chancery', fantasy, 'Comic Sans MS', sans-serif; // Luminari
letter-spacing: 2px;
+mobile(){
font-size: 12px;
}
color: rgba(0,0,0,0.1); /* transparent IE 不支持 */
animation: hue 1.5s linear infinite;
background-image: linear-gradient(to right bottom, rgb(255,0,0), rgb(255,128,0), rgb(255,255,0), rgb(0,255,0), rgb(0,255,128), rgb(0,255,255), rgb(0,128,255), rgb(0,0,255), rgb(128,0,255), rgb(255,0,255), rgb(255,0,128));
-webkit-background-clip: text;
}
@keyframes hue {
from {
filter: hue-rotate(0);
}
to {
filter: hue-rotate(-360deg);
}
}

.site-meta{
background: #ecf9f8;
+mobile(){
padding: 10px 0;
background-image: linear-gradient(90deg,#f79533 0,#f37055 15%,#ef4e7b 30%,#a166ab 44%,#5073b8 58%,#1098ad 72%,#07b39b 86%,#6dba82 100%)!important;
}
}
.site-meta .site-title {
font-size: 22px;
font-weight: bold;
font-family: Zapfino, 'Comic Sans MS', sans-serif;
letter-spacing: 5px;
margin: 5px 0px 15px 0;
+mobile(){
margin: 5px 0px 0px 0px;
letter-spacing: 3px;
font-size: 18px;
}
}
.footer {
//background: none;
//font-size: 14px;
}
.footer-inner {
font-family: 'Comic Sans MS', sans-serif;
text-align: center;
color: #4c618f;
}

/* 尾部不蒜子访客统计 */
.site-uv
{
margin-right: -13px;
display: inline; /* safari 不换行*/
&::after {
content: "";
}
}
.site-uv,
.site-pv,
.page-pv {
display: inline; /*百度浏览器不换行*/
}
.busuanzi-value {
color: #1890ff;
}

.site-author-name {
margin: 18px 0 0;
color: #090909;
//font-family: 'Comic Sans MS', sans-serif;
}
.site-description{
margin-top: 10px;
font-size: 14px;
}
.links-of-blogroll {
font-size: 13px;
margin-bottom: 15px;
margin-top: 10px;
}
.links-of-author {
margin-top: 10px;
}
.links-of-author-item{
padding: 0 1px;
}
.links-of-author-item a{
padding: 0 1px;
}

.site-overview {//左侧socia标签居中
text-align: center;
}
.sidebar-inner {
color: #649ab6;
}
.sidebar {
margin-left: auto; /* for IE */
margin-left: inherit;
box-shadow: inset 2px 2px 40px #bdb2b2;
}
.sidebar a {
color: #649ab6;
border-bottom-color: #649ab6;
border-bottom: none;
}
.sidebar a:hover {
color: #0c0b0b;
}
.site-state-item {
display: inline-block;
padding: 1px 15px;
border-left: 1px solid #649ab659;
}
.sidebar-nav .sidebar-nav-active {
color: #649ab6;
border-bottom-color: #649ab6;
}
.sidebar-nav li:hover {
color: #0c0b0b;
}
.sidebar-toggle {
background: #649ab6;
}
/*文章目录样式*/
.post-toc .nav .active>a {
color: #4f7e96;
}
.post-toc ol a:hover {
color: #7784ba;
}
.sidebar-nav .sidebar-nav-active:hover {
color: #37596c;
}
a {
border-bottom: none;
}

/* 首页文章图片 */
.index_img_class{
width: 100%;
height: 450px;
+mobile(){
height: 190px;
}
}

/* 文章首字下沉、大号字体效果 */
.post-body>p:first-child::first-letter{
float: left;
margin-top: 14px;
margin-right: 6px;
color: #555;
font-size: 42px;
line-height: 28px;
font-style: normal;
font-weight: 400;
+mobile(){
margin-top: 10px;
margin-right: 4px;
font-size: 26px;
line-height: 20px;
}
}

/*首页阅读全文样式*/
.post-button {
margin: 10px auto;
}
.post-button {
margin: 30px auto;
+mobile(){
margin: 10px auto;
}
}
.posts-expand .post-eof{
margin: 30px auto;
+mobile(){
margin: 20px auto 10px;
}
}
.post-button .btn {
color: #555;
background-color: rgb(255, 255, 255);
border-radius: 3px;
font-size: 15px;
box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, 0.35);
border: none !important;
transition-property: unset;
padding: 0px 15px;
margin: inherit;
+mobile(){
color: rgb(255, 255, 255);
background-image: linear-gradient(90deg, #a166ab 0%, #ef4e7b 25%, #f37055 50%, #ef4e7b 75%, #a166ab 100%);
}
}
.post-button .btn:hover {
color: rgb(255, 255, 255);
border-radius: 3px;
font-size: 15px;
box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, 0.35);
background-image: linear-gradient(90deg, #a166ab 0%, #ef4e7b 25%, #f37055 50%, #ef4e7b 75%, #a166ab 100%);
margin: inherit;
}

/* 自定义页脚跳动的心样式 began */
@keyframes heartAnimate {
0%,100%{transform:scale(1);}
10%,30%{transform:scale(0.9);}
20%,40%,60%,80%{transform:scale(1.1);}
50%,70%{transform:scale(1.1);}
}
.with-love {
animation: heartAnimate 1.33s ease-in-out infinite;
color: rgb(255, 113, 168);
}
/* 自定义页脚跳动的心样式 end */

/*修改选择字体块背景颜色*/
::selection {
background: #fff159;
color: #222;
}

.pagination{
margin: 50px;
text-align: center;
border-top:0px;
}
/* 页码数字显示当前页码样式设置 */
.pagination .page-number.current{
background-color: #49b1f5;
background: #49b1f5;
border-radius: 50%;
}
/* 页码样式设置 */
.pagination .page-number{
border: 3px solid #49b1f5;
border-radius: 50%;
}


/* valine 评论系统样式 began ------------------> */
/* 评论列表边框*/
.valine .vlist .vcard {
border-radius: 8px;
border: 1px solid #4aeb877d;
}
.valine .vlist .vcard .vcomment-children .vlist .vcard {
border: none!important;
}

/* valine 评论系统样式 end ------------------> */


/* 适配手机样式 began ------------------------> */
@media (max-width: 767px){
/*手机端body体显示*/
body{
background-image: none;
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #34495e;
}
/*手机端菜单栏样式*/
.menu {
display: flex;
margin-left: 5px;
float: none !important;
}

.menu .menu-item a{
/*font-weight: 600;*/
color: #2c3e50;
font-size: 14px;
padding: 5px 12px;
}
/*选中菜单样式*/
.menu-item-active a:after{
top: -10%;
right: 24px;
}

blockquote p{
font-size: 13px;
}
.back-to-top{
display: none;
right: 0px;
opacity: .2;
}

/*手机屏幕下多级标签样式修改*/
.posts-expand .post-body h1 {
margin: 0 0 0em;
}
.posts-expand .post-body h2,
.posts-expand .post-body h3 {
pointer-events: none;
}
.posts-expand .post-body h1 ,
.posts-expand .post-body h2 ,
.posts-expand .post-body h3 ,
.posts-expand .post-body h4 {
pointer-events: auto;
color: #2c3e50;
}
.posts-expand .post-body h1:before
.posts-expand .post-body h2:before
.posts-expand .post-body h3:before
.posts-expand .post-body h4:before
.posts-expand .post-body h5:before
.posts-expand .post-body h6:before{
display: none;
}
.posts-expand .post-body h2 {
padding-bottom: 0.7em;
border-bottom: 1px solid #ddd;
}
.posts-expand .post-body h3 {
line-height: 1.2;
position: relative;
}
.posts-expand .post-body h3 > a:before {
content: "";
color: #42b983;
position: absolute;
left: -0.7em;
margin-top: -0.05em;
padding-right: 0.5em;
font-size: 1.2em;
line-height: 1;
font-weight: bold;
}
.posts-expand .post-body figure {
/*margin: 1.2em 0;*/
}
/*手机段落样式修改*/
.posts-expand .post-body p {
line-height: 1.6em;
text-align: left;
font-size: 14px;
margin: 5px 0;
padding-bottom: 6px;
position: relative;
z-index: 1;
color: #5e6d82;
}

/* 手机端 列表样式修改*/
.posts-expand .post-body ul,
.posts-expand .post-body ol {
position: inherit;
}
.posts-expand .post-body ul ul,
.posts-expand .post-body ol ul,
.posts-expand .post-body ul ol,
.posts-expand .post-body ol ol {
margin: 0;
}
.posts-expand .post-body ul li{
font-size: 13px;
color: #5e6d82;
}
.posts-expand .post-body a {
font-weight: 400;
}
p{
line-height: 1.6em;
margin: 1.2em 0 -1.2em;
padding-bottom: 1.2em;
position: relative;
z-index: 1;
font-size: 14px;
word-spacing: 0.05em;
}

li{
font-size: 14px;
color: #5e6d82;
}
.post-button a {
font-size: 16px;
}
.posts-expand .post-meta {
font-size: 8px;
text-align: center;
margin: 1px 0 20px 0;
}
/*设置不展示字数统计*/
.posts-expand .post-meta .post-wordcount{
//display: none;
}

.page-post-detail .post-meta{
margin: 10px 0px;
}

.page-post-detail .post-title {
font-weight: 600;
font-size: 20px !important;
}

.my_post_copyright{/* 版权所有 */
width: 95%;
font-size: .73rem
margin: 2em auto 0
}
.my_post_copyright p {
font-size: 12px;
margin: 3px;
line-height: 1.2em;
padding-bottom: 0.5em;
}
}
/*适应手机屏幕设置*/
@media (max-width: 767px) {
.header-inner {
margin-bottom: 10px !important;
background: none;
}
.posts-expand .post-body h1 {
padding-top: 20px;
}
.posts-expand .post-body h2,
.posts-expand .post-body h3 {
pointer-events: none;
}
.posts-expand .post-body h1 ,
.posts-expand .post-body h2 ,
.posts-expand .post-body h3 ,
.posts-expand .post-body h4 {
pointer-events: auto;
color: #2c3e50;
}
.posts-expand .post-body h1:before
.posts-expand .post-body h2:before
.posts-expand .post-body h3:before
.posts-expand .post-body h4:before
.posts-expand .post-body h5:before
.posts-expand .post-body h6:before{
display: none;
}
.posts-expand .post-body h2 {
padding-bottom: 0.7em;
border-bottom: 1px solid #ddd;
}
.posts-expand .post-body h3 {
line-height: 1.2;
position: relative;
}
}
/*手机端显示设置信息*/
@media (max-width: 767px)
{
/*手机端代码行上text文档设置*/
.highlight figcaption{
font-size: 12px;
}
/*手机端显示代码行数背景设置*/
.highlight .gutter pre{
padding-left: 2px;
}

/*手机端显示代码行数字体大小*/
.highlight, pre{
font-size: 10px;
}
/*手机端显示代码字体大小*/
.code span{
font-size: 12px;
}
div#comments.comments.v{
margin-left: 0px !important;
margin-right: 0px !important;
}
.comments{
margin: 20px 10px 0;
}
}

/*手机适配文章底部信息*/
@media (max-width: 767px) {
.main{
padding-bottom: 130px;
}
.footer{
font-size: 12px;
}
.read-over{/*本文阅读结束*/
text-align: center;
margin-top: 20px;
color: #ea103d91;
font-size: 12px;
}
.share_reward{/*打赏*/
font-size: 12px;
padding: 10px 0;
margin: 5px auto;
width: 90%;
text-align: center;
}
#rewardButton {
margin: 15px auto;
}
#rewardButton span {/*打赏*/
display: inline-block;
width: 50px;
height: 35px;
}
#QR{
padding-top: 5px;
}
#QR a{
border:0;
}
#QR img{
width: 60px;
display: inline-block;
margin: 0.8em 2em 0 2em;
}
.post-copyright{
padding: .1em .5em;
margin: 0em 0 0;
border-left: 2px solid #ff1700;
}
.post-copyright li{
font-size: 13.5px;
}
.posts-expand .post-tags{
margin-top: 10px;
font-size: 8px;
}
.post-nav-item a{
font-size: 12px;
line-height: unset;
}
.pagination{/*分页按钮*/
margin: 30px;
text-align: center;
border-top:0px;
}
/*TopX适应手机屏幕设置*/
#top p{
font-size: 12px;
display: block;
}
.post-body .note{
margin: 10px auto;
font-size: 14px;
}
.post-body .note.info p{
font-size: 13px;
}
.post-body .tabs .tab-content .note {
margin: 10px auto;
font-size: 14px;
}

}
@media (max-width: 767px) {

/* 手机端文章布局 */
.post {
margin-bottom: 20px;
padding: 10px;
}

/*手机友链页*/
.card{
width: 88%;
padding: 3px 20px;
margin-bottom: 0rem;
}
#links {
margin-top: 3rem;
}

/*移动端 本地搜索框美化*/
.local-search-popup{
top: 10%;
margin: 10px 35px;
width: 80%;
height: 60%;
}
.local-search-popup .search-icon, .local-search-popup .popup-btn-close {
color: #15a1d8f2;
}
.local-search-popup .local-search-input-wrapper input {
padding-left: 10px;
height: 21px;
background-color: rgb(255, 255, 255);
}
.local-search-popup .popup-btn-close {
border-left: none;
}
.local-search-popup p.search-result{
padding-bottom: 1.2em;
font-size: 13px;
margin: .1em 0 .5em;
}
.local-search-popup a.search-result-title{
font-size: 14px;
}

}

/* 适配手机样式 end ------------------------> */

注意:样式不保证完全兼容,请酌情调整

其它美化文章可参考:

hexo 美化 2.0

点击查看

本文标题:Hexo NexT主题移动端样式适配

文章作者:北宸

发布时间:2019年08月31日 - 11:23:29

最后更新:2020年05月31日 - 17:20:24

原始链接:https://www.liaofuzhan.com/posts/507826828.html

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

-------------------本文结束 感谢您的阅读-------------------
🌞