Skip to content

Commit 82687a4

Browse files
Alex LEEgeekrainy
authored andcommitted
Refactor footer icon with animation (theme-next#195)
* Replace footer icon with beating heart * Add enable option in footer icon animation * Refactor footer icon * Rename the Animate class * Update _config.yml * Change `Animate` to lowercase. * Change `Animate` to lowercase.
1 parent 4a2e38b commit 82687a4

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

_config.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ footer:
6363
#since: 2015
6464

6565
# Icon between year and copyright info.
66-
icon: user
66+
icon:
67+
# Icon name in fontawesome, see: https://fontawesome.com/v4.7.0/icons
68+
# `heart` is recommended with animation in red (#ff0000).
69+
name: user
70+
# If you want to animate the icon, set it to true.
71+
animated: false
72+
# Change the color of icon, using Hex Code.
73+
color: "#808080"
6774

6875
# If not defined, will be used `author` from Hexo main config.
6976
copyright:

layout/_partials/footer.swig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#}{% set current = date(Date.now(), "YYYY") %}{#
33
#}© {% if theme.footer.since and theme.footer.since != current %}{{ theme.footer.since }} — {% endif %}{#
44
#}<span itemprop="copyrightYear">{{ current }}</span>
5-
<span class="with-love">
6-
<i class="fa fa-{{ theme.footer.icon }}"></i>
5+
<span class="with-love" id="animate">
6+
<i class="fa fa-{{ theme.footer.icon.name }}"></i>
77
</span>
88
<span class="author" itemprop="copyrightHolder">{{ theme.footer.copyright || config.author }}</span>
99

source/css/_common/components/footer/footer.styl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@
77

88
.footer-inner { text-align: center; }
99

10+
@keyframes iconAnimate {
11+
0%,100%{transform:scale(1);}
12+
10%,30%{transform:scale(0.9);}
13+
20%,40%,60%,80%{transform:scale(1.1);}
14+
50%,70%{transform:scale(1.1);}
15+
}
16+
17+
if hexo-config('footer.icon.animated') {
18+
#animate {
19+
animation: iconAnimate 1.33s ease-in-out infinite;
20+
}
21+
}
22+
1023
.with-love {
1124
display: inline-block;
1225
margin: 0 5px;
26+
color: unquote(hexo-config('footer.icon.color'));
1327
}
1428

1529
.powered-by,

0 commit comments

Comments
 (0)