hexo官方文档

butterfly帮助文档

butterfly官方文档

Hexo介绍

Hexo 是一个基于 Node.js 的快速、简洁且高效的静态博客框架,常被用来搭建个人博客或技术博客。以下是对 Hexo 的简单介绍:

核心特点

  1. 静态站点生成: Hexo 可以将 Markdown 文件转换为静态的 HTML 页面,这些页面可以直接部署到静态文件托管服务(如 GitHub Pages、Netlify)。
  2. 速度快: Hexo 使用 Node.js 提供高效性能,支持快速生成成千上万篇文章的静态文件。
  3. 支持 Markdown: 使用简单且流行的 Markdown 语法撰写文章,提升写作效率。
  4. 主题丰富: Hexo 社区提供了大量主题,可以通过配置文件快速切换,满足不同用户的个性化需求。
  5. 插件生态: Hexo 拥有丰富的插件库,可扩展功能如 SEO 优化、RSS 支持、站点地图生成等。
  6. 支持多种部署方式: 内置一键部署到 GitHub Pages、GitLab Pages 或其他静态文件托管服务。

Hexo 的基本工作流程

  1. 安装 Hexo: 使用 npm 安装 Hexo:

    1
    npm install -g hexo-cli
  2. 初始化博客项目: 在本地创建一个新的 Hexo 项目:

    1
    2
    3
    hexo init my-blog
    cd my-blog
    npm install
  3. 撰写文章: 使用以下命令生成新文章并编辑:

    1
    hexo new "文章标题"

    编辑生成的 Markdown 文件 source/_posts/文章标题.md

  4. 本地预览: 启动本地服务器预览博客效果:

    1
    hexo server

    访问 http://localhost:4000 查看。

  5. 生成静态文件: 使用以下命令生成静态页面:

    1
    hexo generate
  6. 部署到线上: 使用以下命令部署博客(例如 GitHub Pages):

    1
    hexo deploy

文件结构

Hexo 项目的主要文件结构如下:

  • source/:存放博客内容(文章、页面等)。
  • themes/:存放主题文件。
  • _config.yml:全局配置文件,用于设置博客基本参数。
  • scaffolds/:存放文章模板。
  • public/:生成的静态页面,部署时上传的内容。

适用场景

  • 个人博客:轻松管理和发布个人文章。
  • 技术博客:结合主题和插件,可以美观展示代码片段、数学公式等。
  • 静态网站:可以用于搭建简单的静态网站,如文档网站、公司主页等。

总之,Hexo 是一个易于上手、高效且功能丰富的静态博客工具,非常适合初学者和开发者使用。


创建文章

命令行中输入:

1
$ hexo new "new article"

之后在source/_posts目录下面,多了一个new-article.md的文件。

打开之后我们会看到:

1
2
3
4
5
---
title: new article
date: 2014-11-01 20:10:33
tags:
---

文件的开头是属性,采用统一的yaml格式,用三条短横线分隔。下面是文章正文。

文章的正文支持markdown格式,采用markdown语法编写。

新建、删除或修改文章后,不需要重启hexo server,刷新一下即可预览。


font-matter

Front-matter 是 markdown 文件最上方以 —- 分隔的区域,用于指定个别档案的变数。

  • Page Front-matter 用于 页面 配置
  • Post Front-matter 用于 文章页 配置

介绍不同

Hexo 中,Page Front-matterPost Front-matter 都是 YAML 格式的元数据,用于定义页面或文章的属性。然而,它们的用途和适用范围有所不同。以下是两者的主要区别:


1. Page Front-matter

适用范围

  • Page 是通过 hexo new page <name> 命令创建的,主要用于生成独立页面,例如关于页面(About)、标签页面(Tags)、分类页面(Categories)等。

常见用途

  • 定义独立页面的属性,例如标题、是否显示侧边栏、顶部图片等。
  • 一般用于非博客文章类的内容。

常见字段

以下字段在 Page Front-matter 中更常用:

  • title: 页面标题。
  • date: 页面创建日期。
  • type: 页面类型(如标签、分类或友情链接页面需要配置)。
  • description: 页面描述。
  • aside: 是否显示侧边栏。
  • top_img: 页面顶部图片。
  • comments: 是否显示评论模块。

    示例

1
2
3
4
5
title: About Me
date: 2024-11-26
description: 这是关于我的页面
comments: false
aside: true

2. Post Front-matter

适用范围

  • Post 是通过 hexo new <post-name> 命令创建的,主要用于博客文章。

常见用途

  • 定义文章的元信息,例如标题、发布时间、标签、分类等。
  • 针对博客内容,可以用于 SEO、文章排序、分类导航等功能。

    常见字段

以下字段在 Post Front-matter 中更常用:

  • title: 文章标题。
  • date: 文章创建日期。
  • updated: 文章更新日期。
  • tags: 文章标签(可以是数组或字符串)。
  • categories: 文章分类(可以是多级分类)。
  • description: 文章摘要。
  • keywords: 文章关键词。
  • top: 置顶权重(数值越高优先级越高)。
  • cover: 文章封面图片。
  • excerpt: 自定义文章摘要内容。

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
title: Hello Hexo
date: 2024-11-26
updated: 2024-11-27
tags:
- Hexo
- Blogging
categories:
- Technology
- Web Development
description: 如何用 Hexo 创建博客。
keywords: Hexo,博客,教程
top: 1
cover: /images/hello-hexo-cover.jpg

主要区别总结

特性 Page Front-matter Post Front-matter
用途 独立页面(关于、标签等) 博客文章
命令 hexo new page <name> hexo new <post-name>
字段 偏向页面布局和功能控制(aside, type 等) 偏向内容属性和分类(tags, categories, top 等)
适合场景 独立功能页面、非文章内容 博客内容,具有标签、分类和时间序列属性的文章

如果你需要创建一个用于展示博客内容的页面(如归档、分类),应使用 Page Front-matter;如果是日常博客内容,选择 Post Front-matter 更合适。

page front markdown

如果标注可选的参数,可根据自己需要添加,不用全部都写在 markdown 里

Page Front-matter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
title:
date:
updated:
type:
comments:
description:
keywords:
top_img:
mathjax:
katex:
aside:
aplayer:
highlight_shrink:
random:
limit:
type:
value:
---
参数 解释
title 【必需】页面标题
date 【必需】页面创建日期
type 【必需】标签、分类和友情链接三个页面需要配置
updated 【可选】页面更新日期
description 【可选】页面描述
keywords 【可选】页面关键字
comments 【可选】显示页面评论模块 (默认 true)
top_img 【可选】页面顶部图片
mathjax 【可选】显示 mathjax (当设置 mathjaxper_page: false 时,才需要配置,默认 false)
katex 【可选】显示 katex (当设置 katexper_page: false 时,才需要配置,默认 false)
aside 【可选】显示侧边栏 (默认 true)
aplayer 【可选】在需要的页面加载 aplayer 的 js 和 css, 请参考文章下面的音乐配置
highlight_shrink 【可选】配置代码框是否展开 (true/false) (默认为设置中 highlight_shrink 的配置)
random 【可选】配置友情链接是否随机排序(默认为 false
limit 【可选】配置説説显示数量
limit.type 【可选】配置説説显示数量的类型 (date 或者 num
limit.value 【可选】配置説説显示数量的值

Post Front-matter

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
---
title:
date:
updated:
tags:
categories:
keywords:
description:
top_img:
comments:
cover:
toc:
toc_number:
toc_style_simple:
copyright:
copyright_author:
copyright_author_href:
copyright_url:
copyright_info:
mathjax:
katex:
aplayer:
highlight_shrink:
aside:
abcjs:
noticeOutdate:
---
写法 解释
title 【必需】文章标题
date 【必需】文章创建日期
updated 【可选】文章更新日期
tags 【可选】文章标签
categories 【可选】文章分类
keywords 【可选】文章关键字
description 【可选】文章描述
top_img 【可选】文章顶部图片
cover 【可选】文章缩略图 (如果没有设置 top_img, 文章页顶部将显示缩略图,可设为 false/图片地址/留空)
comments 【可选】显示文章评论模块 (默认 true)
toc 【可选】显示文章 TOC (默认为设置中 tocenable 配置)
toc_number 【可选】显示 TOC 编号 (默认为设置中 tocnumber 配置)
toc_style_simple 【可选】显示 TOC 简洁模式
copyright 【可选】显示文章版权模块 (默认为设置中 post_copyrightenable 配置)
copyright_author 【可选】文章版权模块的文章作者
copyright_author_href 【可选】文章版权模块的文章作者链接
copyright_url 【可选】文章版权模块的文章链接
copyright_info 【可选】文章版权模块的版权声明文字
mathjax 【可选】显示 MathJax (当设置 mathjaxper_page: false 时,才需要配置,默认 false)
katex 【可选】显示 KaTeX (当设置 katexper_page: false 时,才需要配置,默认 false)
aplayer 【可选】在需要的页面加载 aplayer 的 JS 和 CSS,请参考文章下面的音乐配置
highlight_shrink 【可选】配置代码框是否展开 (true/false) (默认为设置中 highlight_shrink 的配置)
aside 【可选】显示侧边栏 (默认 true)
abcjs 【可选】加载 abcjs (当设置 abcjsper_page: false 时,才需要配置,默认 false)
noticeOutdate 【可选】文章过期提醒 (默认为设置中 noticeOutdateenable 配置)

更改preloader

所得教程1

所得教程2

其实主要由.pug与.styl两个文件决定。于是,我做了以下修改:

temp.pug:

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
#loading-box
.loading-left-bg
.loading-right-bg
.magic-container.power-level-1
// Cosmic background layer with stars
.cosmic-background
each i in Array(30)
.background-star(style=`--x:${Math.random() * 100}%; --y:${Math.random() * 100}%; --size:${Math.random() * 2 + 1}px; --delay:${Math.random() * 5}s;`)

// Outer celestial ring
.celestial-ring
.constellation-layer
each i in [0, 1, 2, 3, 4, 5, 6, 7]
.constellation-point(style=`--i:${i}`)

// Main outer circle
.magic-outer-circle.magic-circle
.outer-circle-glow
.outer-inscription
// Ancient runes - expanded set
each i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
.magic-rune.outer-rune(style=`--i:${i}`)
span= ["ᚠ", "ᚢ", "ᚦ", "ᚨ", "ᚱ", "ᚲ", "ᚷ", "ᚹ", "ᚺ", "ᚾ", "ᛁ", "ᛃ"][i]

// Zodiac ring with symbols
.zodiac-ring.magic-circle
each i in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
.zodiac-symbol(style=`--i:${i}`)
span= ["∑", "∫", "λ", "Ω", "∞", "π", "θ", "φ", "γ", "Γ", "α", "β"][i]

// Middle rotating circle with alchemical symbols
.magic-middle-circle.magic-circle
.magic-middle-pattern
.middle-circle-glow
// Alchemical symbols
each i in [0, 1, 2, 3, 4, 5, 6, 7]
.magic-symbol.alchemical(style=`--i:${i}`)
span= ["🜂", "🜄", "🜃", "🜁", "🜍", "🜏", "🜔", "🜞"][i]

// Sacred geometry layer
.sacred-geometry
.geometry-pattern
each i in [0, 1, 2, 3, 4, 5]
.geometry-node(style=`--i:${i}`)
.node-pulse

// Inner circle with geometric pattern
.magic-inner-circle.magic-circle
.magic-inner-pattern
.inner-circle-glow
// Planetary symbols
each i in [0, 1, 2, 3, 4, 5, 6]
.planetary-symbol(style=`--i:${i}`)
span= ["☉", "☽", "☿", "♀", "♂", "♃", "♄"][i]

// Elemental quadrants
.elemental-quadrants
each i in [0, 1, 2, 3]
.elemental-quadrant(style=`--i:${i}`)
span= ["🜂", "🜃", "🜁", "🜄"][i]

// Center celestial core
.magic-core
.core-rays
each i in [0, 1, 2, 3, 4, 5, 6, 7]
.ray(style=`--i:${i}`)
.magic-core-outer
.core-glyph
.magic-core-middle
.magic-core-inner
.core-star
each i in [0, 1, 2, 3, 4, 5]
.star-point(style=`--i:${i}`)

// Orbiting celestial bodies
.magic-orbits
each i in [0, 1, 2, 3, 4, 5, 6, 7]
.magic-orbit(style=`--i:${i}`)
.celestial-body
.celestial-glow
.celestial-surface
.celestial-highlight

// Mystical particles
.mystical-particles
each i in Array(20)
.particle(style=`--x:${Math.random() * 100}%; --y:${Math.random() * 100}%; --size:${Math.random() * 3 + 2}px; --delay:${Math.random() * 5}s;`)

// Star of six points overlay with detailed designs
.magic-star
.star-center
each i in [0, 1, 2, 3, 4, 5]
.star-line(style=`--i:${i}`)
.star-glyph

// Rotating gear elements with runes
.magic-gears
each i in [0, 1, 2, 3, 4, 5, 6, 7]
.gear-element(style=`--i:${i}`)
.gear-rune

// Rotating script ring
.script-ring
.script-content

// Power level indicator
.power-indicator
.power-level-bar

// Script to handle magic circle power progression
script.
document.addEventListener('DOMContentLoaded', function() {
const magicContainer = document.querySelector('.magic-container');
const powerLevelBar = document.querySelector('.power-level-bar');
let rotationCount = 0;
let currentPowerLevel = 1;
const maxPowerLevel = 5;

// Track rotation with animation events
magicContainer.addEventListener('animationiteration', function(e) {
// Only increase power on container rotation
if (e.animationName === 'containerRotate') {
rotationCount++;

// Every full rotation, increase power level up to max
if (currentPowerLevel < maxPowerLevel) {
currentPowerLevel++;

// Update power level class
magicContainer.classList.remove(`power-level-${currentPowerLevel - 1}`);
magicContainer.classList.add(`power-level-${currentPowerLevel}`);

// Update power bar width
powerLevelBar.style.width = `${20 * currentPowerLevel}%`;
}
}
});
});

temp.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
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
@keyframes starLinePulse
0%, 100%
opacity 0.5
height 2px
50%
opacity 0.8
height 4px

@keyframes starGlyphRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes gearRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes gearGlow
0%, 100%
opacity 0.6
box-shadow 0 0 5px #52fefe
50%
opacity 1
box-shadow 0 0 12px #52fefe

@keyframes gearRuneFloat
0%, 100%
transform translateX(-50%) translateY(-3px)
50%
transform translateX(-50%) translateY(3px)

@keyframes gearRuneRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes scriptRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)//
// 1. 通用背景与位置设置
//
.loading-bg
position fixed
z-index 1000
width 50%
height 100%
background var(--preloader-bg, #000)

#loading-box
// 左右背景覆盖,加载完成后将通过 transform 移出屏幕
.loading-left-bg
@extend .loading-bg
left 0
.loading-right-bg
@extend .loading-bg
right 0
// 当页面加载完毕时,向两侧滑动隐藏
&.loaded
z-index -1000
.loading-left-bg
transition all 1s
transform translate(-100%, 0)
.loading-right-bg
transition all 1s
transform translate(100%, 0)

//
// 2. 总体布局设置
//
#loading-box
position fixed
z-index 1000
display flex
align-items center
justify-content center
flex-direction column
width 100vw
height 100vh
overflow hidden
background-color #000
&.loaded
.magic-container
display none

// 3. 魔法阵动态效果与能量等级系统
//

// 魔法能量等级系统 - CSS变量定义
:root
--base-rotation-duration: 30s
--base-glow-intensity: 1
--power-multiplier: 1

// 能量等级类样式定义
.magic-container
// 基础配置
--current-rotation-duration: 30s
--current-glow-intensity: 1

// 能量等级1(默认)
&.power-level-1
--current-rotation-duration: 30s
--current-glow-intensity: 1

// 能量等级2
&.power-level-2
--current-rotation-duration: 25s
--current-glow-intensity: 1.2
.magic-circle
box-shadow 0 0 18px rgba(82, 254, 254, 0.6)
.magic-core-middle
box-shadow 0 0 18px #ffffff, 0 0 30px #52fefe

// 能量等级3
&.power-level-3
--current-rotation-duration: 21s
--current-glow-intensity: 1.4
.magic-circle
box-shadow 0 0 21px rgba(82, 254, 254, 0.7)
.magic-core-middle
box-shadow 0 0 28px #ffffff, 0 0 42px #52fefe
.magic-core-inner
box-shadow 0 0 35px #ffffff, 0 0 21px #52fefe inset

// 能量等级4
&.power-level-4
--current-rotation-duration: 18s
--current-glow-intensity: 1.6
.magic-circle
box-shadow 0 0 32px rgba(82, 254, 254, 0.8)
.magic-core-outer
box-shadow 0 0 48px #52fefe, 0 0 32px #ffffff inset
.star-line
background linear-gradient(90deg, transparent 5%, rgba(82, 254, 254, 0.9) 50%, transparent 95%)

// 能量等级5(最大)
&.power-level-5
--current-rotation-duration: 16s
--current-glow-intensity: 1.8
.magic-circle
box-shadow 0 0 45px rgba(82, 254, 254, 0.9)
.magic-core-outer
box-shadow 0 0 63px #52fefe, 0 0 45px #ffffff inset
.magic-core-middle
box-shadow 0 0 54px #ffffff, 0 0 72px #52fefe
.magic-core-inner
box-shadow 0 0 63px #ffffff, 0 0 54px #52fefe inset

// 能量指示器样式
.power-indicator
position absolute
bottom 20px
left 50%
transform translateX(-50%)
width 100px
height 8px
background rgba(0, 0, 0, 0.5)
border-radius 4px
overflow hidden
border 1px solid rgba(82, 254, 254, 0.5)

.power-level-bar
height 100%
width 20%
background linear-gradient(90deg, #52fefe, #ffffff)
border-radius 4px
transition width 0.5s ease

.magic-container.power-level-1 + &
width 20%
.magic-container.power-level-2 + &
width 40%
.magic-container.power-level-3 + &
width 60%
.magic-container.power-level-4 + &
width 80%
.magic-container.power-level-5 + &
width 100%

//
// 4. 魔法阵容器与多层动画结构
//
.magic-circle
border-radius 50%
position absolute

.magic-container
position relative
z-index 1001
width 400px
height 400px
overflow visible
// 使用变量控制动画速度
animation containerRotate var(--current-rotation-duration) linear infinite

// 宇宙背景层与星空
.cosmic-background
position absolute
width 500px
height 500px
top 50%
left 50%
transform translate(-50%, -50%)
background radial-gradient(circle at center, rgba(10, 30, 50, 0.6) 0%, rgba(0, 0, 0, 0) 70%)

.background-star
position absolute
left var(--x)
top var(--y)
width var(--size)
height var(--size)
background #fff
border-radius 50%
box-shadow 0 0 calc(var(--size) * 2) #52fefe
opacity 0.8
animation starTwinkle 3s infinite ease-in-out alternate
animation-delay var(--delay)

&:before
content ''
position absolute
top 50%
left 50%
width calc(var(--size) * 6)
height calc(var(--size) * 6)
background transparent
border-radius 50%
transform translate(-50%, -50%)
box-shadow 0 0 calc(var(--size) * 0.5) rgba(82, 254, 254, 0.3)

// 星座环
.celestial-ring
position absolute
width 380px
height 380px
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%

.constellation-layer
position absolute
width 100%
height 100%
border 1px dotted rgba(82, 254, 254, 0.3)
border-radius 50%
animation constellationRotate var(--current-rotation-duration) linear infinite

&:before, &:after
content ''
position absolute
width 95%
height 95%
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
border 1px dotted rgba(120, 255, 255, 0.2)

.constellation-point
position absolute
width 4px
height 4px
left 50%
top 2px
transform-origin 0 190px
transform rotate(calc(var(--i) * 45deg)) translateX(190px)

&:before
content ''
position absolute
width 100%
height 100%
background #ffffff
border-radius 50%
box-shadow 0 0 8px #52fefe, 0 0 12px #52fefe
animation constellationGlow 4s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.5s)

&:after
content ''
position absolute
width 180px
height 1px
top 50%
left 2px
transform-origin 0 0
transform rotate(calc((var(--i) + 1) * 45deg))
background linear-gradient(90deg, rgba(82, 254, 254, 0.8), transparent)
opacity 0.3
animation constellationLinePulse 5s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.3s)

// 主外环
.magic-outer-circle
top 50%
left 50%
width 340px
height 340px
transform translate(-50%, -50%)
border 3px solid rgba(82, 254, 254, 0.8)
box-shadow 0 0 15px #52fefe, 0 0 5px #52fefe inset
animation outerRotate 60s linear infinite
.power-level-2 &
animation-duration 50s
.power-level-3 &
animation-duration 43s
.power-level-4 &
animation-duration 38s
.power-level-5 &
animation-duration 33s

.outer-circle-glow
position absolute
width 100%
height 100%
border-radius 50%
box-shadow 0 0 20px rgba(82, 254, 254, 0.5)
animation glowPulse 8s infinite ease-in-out

.outer-inscription
position absolute
width 110%
height 110%
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
&:before, &:after
content ''
position absolute
border-radius 50%

&:before
width 105%
height 105%
top 50%
left 50%
transform translate(-50%, -50%) rotate(0deg)
border 1px dashed rgba(82, 254, 254, 0.4)
animation dashRotate 40s linear infinite reverse
.power-level-2 &
animation-duration 33s
.power-level-3 &
animation-duration 29s
.power-level-4 &
animation-duration 25s
.power-level-5 &
animation-duration 22s

&:after
width 95%
height 95%
top 50%
left 50%
transform translate(-50%, -50%) rotate(0deg)
border 1px dashed rgba(82, 254, 254, 0.4)
animation dashRotate 30s linear infinite
.power-level-2 &
animation-duration 25s
.power-level-3 &
animation-duration 21s
.power-level-4 &
animation-duration 19s
.power-level-5 &
animation-duration 17s

// 外环符文 - 扩展为12个
.magic-rune
position absolute
width 40px
height 40px
left 50%
top 0
transform-origin 0 170px
transform rotate(calc(var(--i) * 30deg)) translateX(-20px)
display flex
align-items center
justify-content center
background rgba(0, 30, 40, 0.8)
clip-path polygon(50% 0%, 83% 12%, 100% 43%, 94% 78%, 68% 100%, 32% 100%, 6% 78%, 0% 43%, 17% 12%)
border 1px solid #52fefe
box-shadow 0 0 8px #52fefe
font-size 22px
color #52fefe
text-shadow 0 0 5px #52fefe
animation runeGlow 4s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.3s)

&:before
content ''
position absolute
width 130%
height 130%
background transparent
border 1px solid rgba(82, 254, 254, 0.3)
transform rotate(45deg)
animation runeBackgroundRotate 15s linear infinite
.power-level-2 &
animation-duration 12.5s
.power-level-3 &
animation-duration 10.7s
.power-level-4 &
animation-duration 9.4s
.power-level-5 &
animation-duration 8.3s

span
animation runeRotate 20s linear infinite reverse
display block
position relative
.power-level-2 &
animation-duration 16.7s
.power-level-3 &
animation-duration 14.3s
.power-level-4 &
animation-duration 12.5s
.power-level-5 &
animation-duration 11.1s
&:after
content ''
position absolute
width 120%
height 3px
background linear-gradient(90deg, transparent, #52fefe, transparent)
top 110%
left -10%
opacity 0.5

// 黄道十二宫环
.zodiac-ring
top 50%
left 50%
width 300px
height 300px
transform translate(-50%, -50%)
border 1px solid rgba(120, 255, 255, 0.5)
animation zodiacRotate 90s linear infinite
.power-level-2 &
animation-duration 75s
.power-level-3 &
animation-duration 64.3s
.power-level-4 &
animation-duration 56.3s
.power-level-5 &
animation-duration 50s
&:before
content ''
position absolute
width 104%
height 104%
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
background repeating-conic-gradient(rgba(82, 254, 254, 0.05) 0deg 3deg, transparent 3deg 30deg)

.zodiac-symbol
position absolute
width 35px
height 35px
left 50%
top 0
transform-origin 0 150px
transform rotate(calc(var(--i) * 30deg)) translateX(-17.5px)
display flex
align-items center
justify-content center
background transparent
font-size 20px
color #78ffff
text-shadow 0 0 8px #52fefe, 0 0 12px #52fefe
animation zodiacSymbolPulse 6s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.5s)

span
display block

// 中层旋转环
.magic-middle-circle
top 50%
left 50%
width 260px
height 260px
transform translate(-50%, -50%)
border 2px solid rgba(120, 255, 255, 0.8)
box-shadow 0 0 10px #78ffff
animation middleRotate 45s linear infinite reverse
.power-level-2 &
animation-duration 37.5s
.power-level-3 &
animation-duration 32.1s
.power-level-4 &
animation-duration 28.1s
.power-level-5 &
animation-duration 25s

.magic-middle-pattern
position absolute
width 100%
height 100%
border-radius 50%
overflow hidden
&:before, &:after
content ''
position absolute
width 100%
height 100%

&:before
background-image repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(120, 255, 255, 0.1) 10px, rgba(120, 255, 255, 0.1) 12px), repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(120, 255, 255, 0.1) 10px, rgba(120, 255, 255, 0.1) 12px)
animation patternRotate 30s linear infinite
.power-level-2 &
animation-duration 25s
.power-level-3 &
animation-duration 21.4s
.power-level-4 &
animation-duration 18.8s
.power-level-5 &
animation-duration 16.7s

&:after
background-image radial-gradient(circle at center, transparent 30%, rgba(120, 255, 255, 0.1) 60%, transparent 70%)

.middle-circle-glow
position absolute
width 100%
height 100%
border-radius 50%
box-shadow 0 0 15px rgba(120, 255, 255, 0.3) inset
animation middleGlowPulse 5s infinite ease-in-out alternate

// 炼金术符号
.magic-symbol.alchemical
position absolute
width 38px
height 38px
left 50%
top 0
transform-origin 0 130px
transform rotate(calc(var(--i) * 45deg)) translateX(-19px)
display flex
align-items center
justify-content center
color #a0fefe
font-size 24px
text-shadow 0 0 8px #52fefe
background rgba(0, 40, 60, 0.6)
border-radius 50%
border 1px solid rgba(82, 254, 254, 0.7)
box-shadow 0 0 10px rgba(82, 254, 254, 0.5)
animation symbolPulse 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.4s)

&:before
content ''
position absolute
width 130%
height 130%
border 1px dashed rgba(82, 254, 254, 0.3)
border-radius 50%

span
display block
animation symbolRotate 12s linear infinite alternate
.power-level-2 &
animation-duration 10s
.power-level-3 &
animation-duration 8.6s
.power-level-4 &
animation-duration 7.5s
.power-level-5 &
animation-duration 6.7s

// 神圣几何图形层
.sacred-geometry
position absolute
width 210px
height 210px
top 50%
left 50%
transform translate(-50%, -50%)
animation geometryRotate 60s linear infinite
.power-level-2 &
animation-duration 50s
.power-level-3 &
animation-duration 42.9s
.power-level-4 &
animation-duration 37.5s
.power-level-5 &
animation-duration 33.3s

.geometry-pattern
position absolute
width 100%
height 100%
&:before, &:after
content ''
position absolute
width 100%
height 100%
top 0
left 0
background-size contain

&:before
background-image linear-gradient(0deg, transparent 49.5%, rgba(82, 254, 254, 0.3) 50%, transparent 50.5%), linear-gradient(60deg, transparent 49.5%, rgba(82, 254, 254, 0.3) 50%, transparent 50.5%), linear-gradient(120deg, transparent 49.5%, rgba(82, 254, 254, 0.3) 50%, transparent 50.5%)
animation patternFade 4s infinite ease-in-out alternate

&:after
background-image linear-gradient(30deg, transparent 49.5%, rgba(120, 255, 255, 0.2) 50%, transparent 50.5%), linear-gradient(90deg, transparent 49.5%, rgba(120, 255, 255, 0.2) 50%, transparent 50.5%), linear-gradient(150deg, transparent 49.5%, rgba(120, 255, 255, 0.2) 50%, transparent 50.5%)
animation patternFade 4s infinite ease-in-out alternate-reverse

.geometry-node
position absolute
width 15px
height 15px
left 50%
top 0
transform-origin 0 105px
transform rotate(calc(var(--i) * 60deg)) translateX(105px)

.node-pulse
position absolute
width 100%
height 100%
background rgba(82, 254, 254, 0.7)
border-radius 50%
box-shadow 0 0 10px #52fefe
animation nodePulse 3s infinite ease-in-out
animation-delay calc(var(--i) * 0.5s)

&:before, &:after
content ''
position absolute
border-radius 50%

&:before
width 200%
height 200%
top 50%
left 50%
transform translate(-50%, -50%)
background transparent
border 1px solid rgba(82, 254, 254, 0.4)
animation nodeExpand 3s infinite ease-out
animation-delay calc(var(--i) * 0.5s)

&:after
width 300%
height 300%
top 50%
left 50%
transform translate(-50%, -50%)
background transparent
border 1px dashed rgba(82, 254, 254, 0.2)
animation nodeExpandFade 3s infinite ease-out
animation-delay calc(0.5s + var(--i) * 0.5s)

// 内层几何图形环
.magic-inner-circle
top 50%
left 50%
width 160px
height 160px
transform translate(-50%, -50%)
border 2px solid rgba(255, 255, 255, 0.8)
box-shadow 0 0 12px #ffffff, 0 0 6px #52fefe inset
animation innerRotate 30s linear infinite
.power-level-2 &
animation-duration 25s
.power-level-3 &
animation-duration 21.4s
.power-level-4 &
animation-duration 18.8s
.power-level-5 &
animation-duration 16.7s

.magic-inner-pattern
position absolute
width 100%
height 100%
border-radius 50%
overflow hidden
background-image repeating-conic-gradient(transparent 0deg, rgba(82, 254, 254, 0.2) 4deg, transparent 8deg)
animation patternFlicker 4s linear infinite

.inner-circle-glow
position absolute
width 100%
height 100%
border-radius 50%
box-shadow 0 0 10px rgba(255, 255, 255, 0.3) inset, 0 0 5px rgba(82, 254, 254, 0.5)
animation innerGlowPulse 3s infinite ease-in-out alternate

// 行星符号
.planetary-symbol
position absolute
width 25px
height 25px
left 50%
top 0
transform-origin 0 80px
transform rotate(calc(var(--i) * 51.4deg)) translateX(-12.5px)
display flex
align-items center
justify-content center
color rgba(255, 255, 255, 0.9)
font-size 18px
background rgba(10, 50, 80, 0.7)
border-radius 50%
border 1px solid rgba(255, 255, 255, 0.6)
box-shadow 0 0 8px rgba(82, 254, 254, 0.4)
animation planetaryPulse 4s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.5s)

span
display block
animation planetaryRotate 8s linear infinite alternate-reverse
animation-delay calc(var(--i) * 0.5s)
.power-level-2 &
animation-duration 6.7s
.power-level-3 &
animation-duration 5.7s
.power-level-4 &
animation-duration 5s
.power-level-5 &
animation-duration 4.4s

// 元素象限
.elemental-quadrants
position absolute
width 120px
height 120px
top 50%
left 50%
transform translate(-50%, -50%)

.elemental-quadrant
position absolute
width 60px
height 60px
display flex
align-items center
justify-content center
color #78ffff
font-size 28px
text-shadow 0 0 5px #52fefe
opacity 0.7
animation elementalPulse 8s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.7s)
.power-level-2 &
opacity 0.8
.power-level-3 &
opacity 0.9
.power-level-4 &
opacity 1
.power-level-5 &
opacity 1
text-shadow 0 0 9px #52fefe

&:nth-child(1)
top 0
left 0
&:nth-child(2)
top 0
right 0
&:nth-child(3)
bottom 0
right 0
&:nth-child(4)
bottom 0
left 0

// 中心天体核心
.magic-core
position absolute
top 50%
left 50%
width 100px
height 100px
transform translate(-50%, -50%)
border-radius 50%

// 核心光芒
.core-rays
position absolute
width 100%
height 100%

.ray
position absolute
width 2px
height 100px
left 50%
top 50%
transform-origin center top
transform rotate(calc(var(--i) * 45deg)) translateX(-1px)
background linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(82, 254, 254, 0.5) 50%, transparent)
animation rayPulse 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.3s)
.power-level-2 &
background linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(82, 254, 254, 0.6) 50%, transparent)
.power-level-3 &
background linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(82, 254, 254, 0.7) 50%, transparent)
.power-level-4 &
background linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(82, 254, 254, 0.8) 50%, transparent)
.power-level-5 &
background linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(82, 254, 254, 0.9) 50%, transparent)

// 外层光晕
.magic-core-outer
position absolute
width 85px
height 85px
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
background rgba(82, 254, 254, 0.2)
box-shadow 0 0 25px #52fefe, 0 0 15px #ffffff inset
animation coreOuterPulse 5s infinite ease-in-out

.core-glyph
position absolute
width 100%
height 100%
background-image linear-gradient(0deg, transparent 49%, rgba(255, 255, 255, 0.3) 50%, transparent 51%), linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.3) 50%, transparent 51%)
border-radius 50%
animation coreGlyphRotate 15s linear infinite
.power-level-2 &
animation-duration 12.5s
.power-level-3 &
animation-duration 10.7s
.power-level-4 &
animation-duration 9.4s
.power-level-5 &
animation-duration 8.3s

// 中层光晕
.magic-core-middle
position absolute
width 60px
height 60px
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
background radial-gradient(circle at center, rgba(255, 255, 255, 0.9), rgba(120, 255, 255, 0.7) 50%, rgba(82, 254, 254, 0.5) 70%)
box-shadow 0 0 15px #ffffff, 0 0 25px #52fefe
animation coreMiddlePulse 3s infinite ease-in-out alternate

// 内层核心与星型
.magic-core-inner
position absolute
width 40px
height 40px
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
background radial-gradient(circle at center, #ffffff, rgba(120, 255, 255, 0.9) 70%)
box-shadow 0 0 20px #ffffff, 0 0 15px #52fefe inset
animation coreInnerPulse 2s infinite ease-in-out alternate
overflow hidden

.core-star
position absolute
width 100%
height 100%
top 0
left 0
animation starRotate 10s linear infinite
.power-level-2 &
animation-duration 8.3s
.power-level-3 &
animation-duration 7.1s
.power-level-4 &
animation-duration 6.3s
.power-level-5 &
animation-duration 5.6s

.star-point
position absolute
left 50%
top 50%
width 0
height 0
transform-origin center
transform rotate(calc(var(--i) * 60deg))
&:before
content ''
position absolute
width 0
height 0
border-left 20px solid transparent
border-right 20px solid transparent
border-bottom 35px solid rgba(255, 255, 255, 0.7)
top -5px
left -20px
.power-level-2 &
border-bottom 35px solid rgba(255, 255, 255, 0.8)
.power-level-3 &
border-bottom 35px solid rgba(255, 255, 255, 0.85)
.power-level-4 &
border-bottom 35px solid rgba(255, 255, 255, 0.9)
.power-level-5 &
border-bottom 35px solid rgba(255, 255, 255, 0.95)

// 轨道天体
.magic-orbits
position absolute
width 100%
height 100%
top 0
left 0
animation orbitRotate 60s linear infinite
.power-level-2 &
animation-duration 50s
.power-level-3 &
animation-duration 42.9s
.power-level-4 &
animation-duration 37.5s
.power-level-5 &
animation-duration 33.3s

.magic-orbit
position absolute
left 50%
top 50%
width 15px
height 15px
transform-origin 0 130px
transform rotate(calc(var(--i) * 45deg)) translateX(130px)

.celestial-body
position relative
width 100%
height 100%
animation celestialRotate 12s infinite linear
.power-level-2 &
animation-duration 10s
.power-level-3 &
animation-duration 8.6s
.power-level-4 &
animation-duration 7.5s
.power-level-5 &
animation-duration 6.7s

.celestial-glow
position absolute
width 200%
height 200%
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
background transparent
box-shadow 0 0 15px rgba(82, 254, 254, 0.5)
animation celestialGlowPulse 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.4s)

.celestial-surface
position absolute
width 100%
height 100%
border-radius 50%
background radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(120, 255, 255, 0.7) 40%, rgba(82, 254, 254, 0.5) 60%, rgba(0, 40, 80, 0.8) 80%)
box-shadow 0 0 10px #52fefe
animation celestialSurfacePulse 4s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.4s)

.celestial-highlight
position absolute
width 30%
height 30%
top 20%
left 20%
border-radius 50%
background rgba(255, 255, 255, 0.8)
box-shadow 0 0 5px #ffffff
animation celestialHighlightFloat 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.3s)

// 神秘粒子
.mystical-particles
position absolute
width 100%
height 100%
top 0
left 0
pointer-events none

.particle
position absolute
left var(--x)
top var(--y)
width var(--size)
height var(--size)
background rgba(82, 254, 254, 0.8)
border-radius 50%
filter blur(1px)
box-shadow 0 0 calc(var(--size) * 2) rgba(82, 254, 254, 0.5)
animation particleFloat 15s infinite ease-in-out alternate
animation-delay var(--delay)

&:after
content ''
position absolute
width 150%
height 2px
background linear-gradient(90deg, transparent, rgba(82, 254, 254, 0.5), transparent)
top 50%
left -25%
transform translateY(-50%) rotate(calc(var(--i) * 36deg))
animation particleTrailFade 2s infinite ease-in-out alternate
animation-delay var(--delay)

// 星魔法叠加
.magic-star
position absolute
width 100%
height 100%
top 0
left 0
animation starRotate 45s linear infinite reverse
.power-level-2 &
animation-duration 37.5s
.power-level-3 &
animation-duration 32.1s
.power-level-4 &
animation-duration 28.1s
.power-level-5 &
animation-duration 25s

.star-center
position absolute
width 30px
height 30px
top 50%
left 50%
transform translate(-50%, -50%)
background rgba(82, 254, 254, 0.3)
border-radius 50%
box-shadow 0 0 15px rgba(82, 254, 254, 0.5)
animation starCenterPulse 4s infinite ease-in-out alternate

&:before
content ''
position absolute
width 300%
height 300%
top 50%
left 50%
transform translate(-50%, -50%)
border-radius 50%
border 1px solid rgba(82, 254, 254, 0.2)
animation starCenterExpand 4s infinite ease-in-out

.star-line
position absolute
left 50%
top 50%
width 300px
height 3px
transform-origin center
transform rotate(calc(var(--i) * 60deg))
background linear-gradient(90deg, transparent 5%, rgba(82, 254, 254, 0.8) 50%, transparent 95%)
animation starLinePulse 4s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.6s)

.star-glyph
position absolute
width 20px
height 20px
top 50%
left 70%
transform translate(-50%, -50%)
background transparent
border 1px solid rgba(82, 254, 254, 0.6)
transform-origin center
transform rotate(calc(var(--i) * 60deg))
animation starGlyphRotate 20s linear infinite
.power-level-2 &
animation-duration 16.7s
.power-level-3 &
animation-duration 14.3s
.power-level-4 &
animation-duration 12.5s
.power-level-5 &
animation-duration 11.1s

// 齿轮元素与符文
.magic-gears
position absolute
width 100%
height 100%
top 0
left 0
animation gearRotate 40s linear infinite
.power-level-2 &
animation-duration 33.3s
.power-level-3 &
animation-duration 28.6s
.power-level-4 &
animation-duration 25s
.power-level-5 &
animation-duration 22.2s

.gear-element
position absolute
left 50%
top 50%
width 6px
height 110px
background linear-gradient(to top, rgba(7, 60, 75, 0.7), rgba(82, 254, 254, 0.3))
transform-origin center bottom
transform rotate(calc(var(--i) * 45deg))
&:after
content ''
position absolute
width 16px
height 16px
top 5px
left 50%
transform translateX(-50%)
background transparent
border-radius 2px
border 2px solid #52fefe
box-shadow 0 0 8px #52fefe
animation gearGlow 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.25s)

.gear-rune
position absolute
width 30px
height 30px
top 30px
left 50%
transform translateX(-50%)
display flex
align-items center
justify-content center
animation gearRuneFloat 3s infinite ease-in-out alternate
animation-delay calc(var(--i) * 0.3s)
&:before
content "⚝"
color #52fefe
font-size 18px
text-shadow 0 0 5px #52fefe
animation gearRuneRotate 10s linear infinite
.power-level-2 &
text-shadow 0 0 6px #52fefe
.power-level-3 &
text-shadow 0 0 7px #52fefe
.power-level-4 &
text-shadow 0 0 8px #52fefe
.power-level-5 &
text-shadow 0 0 9px #52fefe

// 旋转文字环
.script-ring
position absolute
width 380px
height 380px
top 50%
left 50%
transform translate(-50%, -50%) rotate(0deg)
border-radius 50%
animation scriptRotate 120s linear infinite
.power-level-2 &
animation-duration 100s
.power-level-3 &
animation-duration 85.7s
.power-level-4 &
animation-duration 75s
.power-level-5 &
animation-duration 66.7s

.script-content
position absolute
width 100%
height 100%
border-radius 50%
overflow hidden
&:before
content "✧ ARCANUM ✧ MYSTICUM ✧ ETERNUM ✧ CELESTIA ✧ ASTRUM ✧ INFINITUM ✧ MAGICUS ✧ COSMOS ✧ DIVINUS ✧ ELEMENTUM ✧"
position absolute
width 1194px // 计算: 380px(直径) * π
height 30px
top 0
left 0
transform-origin 50% 190px
color rgba(82, 254, 254, 0.7)
font-size 16px
letter-spacing 3px
white-space nowrap
text-shadow 0 0 5px rgba(82, 254, 254, 0.5)
.power-level-2 &
color rgba(82, 254, 254, 0.75)
text-shadow 0 0 6px rgba(82, 254, 254, 0.6)
.power-level-3 &
color rgba(82, 254, 254, 0.8)
text-shadow 0 0 7px rgba(82, 254, 254, 0.7)
.power-level-4 &
color rgba(82, 254, 254, 0.9)
text-shadow 0 0 8px rgba(82, 254, 254, 0.8)
.power-level-5 &
color rgba(82, 254, 254, 1)
text-shadow 0 0 9px rgba(82, 254, 254, 0.9)

// Animation 定义
@keyframes containerRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes starTwinkle
0%, 100%
opacity 0.3
transform scale(0.8)
50%
opacity 1
transform scale(1.2)

@keyframes constellationRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes constellationGlow
0%, 100%
opacity 0.5
box-shadow 0 0 5px #52fefe, 0 0 8px #52fefe
50%
opacity 1
box-shadow 0 0 8px #52fefe, 0 0 15px #52fefe

@keyframes constellationLinePulse
0%, 100%
opacity 0.2
width 160px
50%
opacity 0.4
width 180px

@keyframes outerRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes glowPulse
0%, 100%
opacity 0.5
box-shadow 0 0 15px rgba(82, 254, 254, 0.3)
50%
opacity 0.8
box-shadow 0 0 25px rgba(82, 254, 254, 0.5)

@keyframes dashRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes runeGlow
0%, 100%
opacity 0.7
transform rotate(calc(var(--i) * 30deg)) translateX(-20px) scale(0.9)
50%
opacity 1
transform rotate(calc(var(--i) * 30deg)) translateX(-20px) scale(1.1)

@keyframes runeBackgroundRotate
0%
transform rotate(45deg)
100%
transform rotate(405deg)

@keyframes runeRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes zodiacRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes zodiacSymbolPulse
0%, 100%
opacity 0.7
transform rotate(calc(var(--i) * 30deg)) translateX(-17.5px) scale(0.9)
50%
opacity 1
transform rotate(calc(var(--i) * 30deg)) translateX(-17.5px) scale(1.1)

@keyframes middleRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(-360deg)

@keyframes patternRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes middleGlowPulse
0%, 100%
opacity 0.6
box-shadow 0 0 10px rgba(120, 255, 255, 0.2) inset
50%
opacity 1
box-shadow 0 0 20px rgba(120, 255, 255, 0.4) inset

@keyframes symbolPulse
0%, 100%
opacity 0.7
transform rotate(calc(var(--i) * 45deg)) translateX(-19px) scale(0.9)
50%
opacity 1
transform rotate(calc(var(--i) * 45deg)) translateX(-19px) scale(1.1)

@keyframes symbolRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes geometryRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes patternFade
0%, 100%
opacity 0.5
50%
opacity 1

@keyframes nodePulse
0%, 100%
opacity 0.6
transform scale(0.9)
50%
opacity 1
transform scale(1.1)

@keyframes nodeExpand
0%
opacity 0.7
transform translate(-50%, -50%) scale(1)
100%
opacity 0
transform translate(-50%, -50%) scale(1.5)

@keyframes nodeExpandFade
0%
opacity 0.5
transform translate(-50%, -50%) scale(1)
100%
opacity 0
transform translate(-50%, -50%) scale(1.8)

@keyframes innerRotate
0%
transform translate(-50%, -50%) rotate(0deg)
100%
transform translate(-50%, -50%) rotate(360deg)

@keyframes patternFlicker
0%, 100%
opacity 0.6
50%
opacity 1

@keyframes innerGlowPulse
0%, 100%
opacity 0.6
box-shadow 0 0 5px rgba(255, 255, 255, 0.1) inset, 0 0 3px rgba(82, 254, 254, 0.3)
50%
opacity 1
box-shadow 0 0 15px rgba(255, 255, 255, 0.4) inset, 0 0 8px rgba(82, 254, 254, 0.7)

@keyframes planetaryPulse
0%, 100%
opacity 0.7
transform rotate(calc(var(--i) * 51.4deg)) translateX(-12.5px) scale(0.9)
50%
opacity 1
transform rotate(calc(var(--i) * 51.4deg)) translateX(-12.5px) scale(1.1)

@keyframes planetaryRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes elementalPulse
0%, 100%
opacity 0.6
transform scale(0.9)
50%
opacity 1
transform scale(1.1)

@keyframes rayPulse
0%, 100%
opacity 0.6
height 90px
50%
opacity 1
height 110px

@keyframes coreOuterPulse
0%, 100%
transform translate(-50%, -50%) scale(0.95)
50%
transform translate(-50%, -50%) scale(1.05)

@keyframes coreGlyphRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes coreMiddlePulse
0%, 100%
opacity 0.8
transform translate(-50%, -50%) scale(0.95)
50%
opacity 1
transform translate(-50%, -50%) scale(1.05)

@keyframes coreInnerPulse
0%, 100%
opacity 0.8
transform translate(-50%, -50%) scale(0.9)
50%
opacity 1
transform translate(-50%, -50%) scale(1.1)

@keyframes starRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes orbitRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes celestialRotate
0%
transform rotate(0deg)
100%
transform rotate(360deg)

@keyframes celestialGlowPulse
0%, 100%
opacity 0.5
transform translate(-50%, -50%) scale(0.9)
50%
opacity 0.8
transform translate(-50%, -50%) scale(1.1)

@keyframes celestialSurfacePulse
0%, 100%
transform scale(0.9)
50%
transform scale(1.1)

@keyframes celestialHighlightFloat
0%, 100%
top 15%
left 15%
50%
top 25%
left 25%

@keyframes particleFloat
0%, 100%
transform translate(calc(var(--x) * 0.1), calc(var(--y) * 0.1)) scale(0.8)
opacity 0.5
50%
transform translate(calc(var(--x) * -0.1), calc(var(--y) * -0.1)) scale(1.2)
opacity 1

@keyframes particleTrailFade
0%, 100%
opacity 0.3
width 120%
50%
opacity 0.7
width 150%

@keyframes starCenterPulse
0%, 100%
opacity 0.5
transform translate(-50%, -50%) scale(0.9)
50%
opacity 0.8
transform translate(-50%, -50%) scale(1.1)

@keyframes starCenterExpand
0%
opacity 0.5
transform translate(-50%, -50%) scale(1)
100%
opacity 0
transform translate(-50%, -50%) scale(1.5)

@keyframes starLinePulse
0%, 100%
opacity 0.5
height 2px
50%
opacity 0.8
height 4px

实现效果如下:

image-20250429150047327

增加侧边栏闪刀动画

官方教程

个人实现:

你可以按照提供的指导创建一个自定义的 widget 来展示你喜欢的动图。以下是具体的步骤和代码示例。

  1. 创建 widget.yml 文件

需要在博客目录(不是butterfly主题目录)中的 source/_data 文件夹中创建一个 widget.yml 文件。如果该文件夹不存在,请先创建它。

  1. 编写 widget.yml 内容

需要在 widget.yml 中定义新的 widget,可以将其放在 bottom 中,这样这个 widget 就会显示在除文章页外的所有页面。你可以根据需要来定义各种参数,如 class_nameid_namenameiconhtml

以下是一个展示自己喜欢的动图的例子:

1
2
3
4
5
6
7
top:
- class_name: gif-widget
id_name: gif-display
name: SkyStriker
icon: fas fa-film
order: 1
html: '<img src="/images/zhenshandao.gif" alt="SkyStriker" style="max-width:100%; height:auto;" />'
  • class_name: 设置 widget 的父类名称,比如 favorite-gif,方便你添加自定义 CSS。
  • id_name: 设置 widget 的父类 id 名称,比如 favorite-gif-widget
  • name: widget 的标题,比如 “动图展示”。
  • icon: 图标的类名,这里我使用了 FontAwesome 的 fas fa-images 图标,你可以选择你喜欢的图标。
  • order: 排序,数字越小越靠前,数字越大越靠后。
  • html: 放置你的动图代码,使用 <img> 标签来插入你喜欢的动图,URL 替换为你的动图链接。
  1. 添加自定义 CSS (潜在想法)

如果你想对这个 widget 的样式进行定制化设计,可以在 _config.butterfly.yml 中通过 inject 添加自定义 CSS。例如:

1
2
3
inject:
head:
- '<link rel="stylesheet" href="/css/custom.css">'

然后,你可以创建 source/css/custom.css 文件,添加自定义样式:

1
2
3
4
5
6
7
8
9
10
11
.favorite-gif {
background: #f5f5f5; /* 设置背景颜色 */
border-radius: 8px; /* 设置圆角 */
padding: 15px; /* 设置内边距 */
text-align: center; /* 文字和动图居中对齐 */
}

.favorite-gif-widget img {
max-width: 100%; /* 确保动图宽度不超过 widget 宽度 */
height: auto; /* 保持宽高比 */
}
  1. 运行 Hexo

配置完成后,可以在命令行中运行 Hexo 来生成和查看效果:

1
2
3
hexo clean
hexo g
hexo s

在本地服务器 (http://localhost:4000) 查看效果,确保动图正常显示在侧边栏中。

最终效果

添加完 widget.yml 并进行 Hexo 生成后,你会看到侧边栏新增了一个模块,标题为“SkyStriker”,并且可以展示喜欢的动图。

如果你想展示多个动图,可以修改 html 中的内容,添加多个 <img> 标签。例如:

1
html: '<img src="https://your-gif-url.com/your-favorite1.gif" alt="Gif 1" style="width:100%;"><br/><img src="https://your-gif-url.com/your-favorite2.gif" alt="Gif 2" style="width:100%;">'

这样你就能在侧边栏里一次性展示多张动图。