为butterfly主题添加一个蓝天白云特效

  • 动态效果
  • 低占用
  • 优雅美观
  1. /themes/butterfly/layout/includes下,新建skycloud.pug
1
2
3
4
.sky
.clouds_one
.clouds_two
.clouds_three
  1. /themes/butterfly/layout/includes/layout.pug中引入
1
2
3
4
5
    if page.type !== '404'
#body-wrap(class=pageType)
include ./header/index.pug
+ if (is_home())
+ include ./skyclouds.pug
  1. 引入css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
.sky {
height: 480px;
background-image: linear-gradient(180deg, #3387de, #6fa1e3, #a4c0e2, rgb(247,249,254));
position: fixed;
overflow: hidden;
width: 100%;
z-index: -10;
}

.clouds_one {
background: url("https://uu.sssu.us/css/img/cloud_one.png");
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 300%;
-webkit-animation: cloud_one 50s linear infinite;
-moz-animation: cloud_one 50s linear infinite;
-o-animation: cloud_one 50s linear infinite;
animation: cloud_one 50s linear infinite;
}

.clouds_two {
background: url("https://uu.sssu.us/css/img/cloud_two.png");
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 300%;
-webkit-animation: cloud_two 75s linear infinite;
-moz-animation: cloud_two 75s linear infinite;
-o-animation: cloud_two 75s linear infinite;
animation: cloud_two 75s linear infinite;
}

.clouds_three {
background: url("https://uu.sssu.us/css/img/cloud_three.png");
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 300%;
-webkit-animation: cloud_three 100s linear infinite;
-moz-animation: cloud_three 100s linear infinite;
-o-animation: cloud_three 100s linear infinite;
animation: cloud_three 100s linear infinite;
}

@-webkit-keyframes cloud_one {
0% {
left: 0
}
100% {
left: -200%
}
}
@-moz-keyframes cloud_one {
0% {
left: 0
}
100% {
left: -200%
}
}
@keyframes cloud_one {
0% {
left: 0
}
100% {
left: -200%
}
}

@-webkit-keyframes cloud_two {
0% {
left: 0
}
100% {
left: -200%
}
}
@-moz-keyframes cloud_two {
0% {
left: 0
}
100% {
left: -200%
}
}
@keyframes cloud_two {
0% {
left: 0
}
100% {
left: -200%
}
}

@-webkit-keyframes cloud_three {
0% {
left: 0
}
100% {
left: -200%
}
}
@-moz-keyframes cloud_three {
0% {
left: 0
}
100% {
left: -200%
}
}
@keyframes cloud_three {
0% {
left: 0
}
100% {
left: -200%
}
}