Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 8f5d015

Browse files
thesmiley1billyyyyy3320
authored andcommitted
feat: add several contact types
* chore: remove extraneous whitespace from Footer * chore: remove commented-out style in Footer * chore: add facebook contact to example * chore: sort footer icon components * feat: add gitlab, others to footer contact icons
1 parent 6b9ca81 commit 8f5d015

File tree

3 files changed

+80
-32
lines changed

3 files changed

+80
-32
lines changed

components/Footer.vue

+49-30
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</li>
1111
</ul>
1212
</div>
13-
13+
1414
<div class="footer-right-wrap">
1515
<ul class="copyright" v-if="copyright">
1616
<li class="copyright-item" v-for="item in copyright">
@@ -23,41 +23,61 @@
2323

2424
<script>
2525
import {
26-
GithubIcon,
2726
FacebookIcon,
28-
TwitterIcon,
27+
GithubIcon,
28+
GitlabIcon,
29+
GlobeIcon,
2930
InstagramIcon,
30-
LinkedinIcon
31+
LinkedinIcon,
32+
MailIcon,
33+
MessageSquareIcon,
34+
PhoneIcon,
35+
TwitterIcon
3136
} from 'vue-feather-icons'
32-
37+
3338
export default {
3439
components: {
35-
GithubIcon,
3640
FacebookIcon,
37-
TwitterIcon,
41+
GithubIcon,
42+
GitlabIcon,
43+
GlobeIcon,
3844
InstagramIcon,
39-
LinkedinIcon
45+
LinkedinIcon,
46+
MailIcon,
47+
MessageSquareIcon,
48+
PhoneIcon,
49+
TwitterIcon
4050
},
41-
51+
4252
methods: {
4353
getIconComponentName(contactType) {
4454
switch (contactType) {
45-
case 'github':
46-
return 'GithubIcon'
4755
case 'facebook':
4856
return 'FacebookIcon'
49-
case 'twitter':
50-
return 'TwitterIcon'
57+
case 'github':
58+
return 'GithubIcon'
59+
case 'gitlab':
60+
return 'GitlabIcon'
5161
case 'instagram':
5262
return 'InstagramIcon'
5363
case 'linkedin':
5464
return 'LinkedinIcon'
65+
case 'mail':
66+
return 'MailIcon'
67+
case 'messenger':
68+
return 'MessageSquareIcon'
69+
case 'phone':
70+
return 'PhoneIcon'
71+
case 'twitter':
72+
return 'TwitterIcon'
73+
case 'web':
74+
return 'GlobeIcon'
5575
default:
5676
return ''
5777
}
5878
},
5979
},
60-
80+
6181
computed: {
6282
contact() {
6383
return (
@@ -71,7 +91,7 @@
7191
})
7292
.filter(({ iconComponent }) => iconComponent)
7393
},
74-
94+
7595
copyright() {
7696
return (
7797
this.$themeConfig.footer && this.$themeConfig.footer.copyright || []
@@ -86,37 +106,36 @@
86106
list-style none
87107
margin 0
88108
padding 0
89-
109+
90110
.footer
91111
height 60px
92112
box-sizing border-box
93-
// background-color darken(#3eaf7c, 70%)
94113
background-color #000
95114
color #FFF
96115
display flex
97116
padding 15px 32px
98-
117+
99118
.footer-left-wrap
100119
line-height 30px
101120
flex 1
102121
display flex
103-
122+
104123
.contact
105124
display flex
106-
125+
107126
.contact-item
108127
flex 1
109128
margin-right 10px
110-
129+
111130
a
112131
font-size 12px
113132
color rgba(255, 255, 255, 0.45)
114133
text-decoration none
115134
transition color .3s
116-
135+
117136
&:hover
118137
color #FFF
119-
138+
120139
.footer-right-wrap
121140
flex 1
122141
display flex
@@ -125,35 +144,35 @@
125144
126145
@media(min-width: $MQNarrow)
127146
justify-content flex-end
128-
147+
129148
.copyright
130149
display flex
131150
justify-content flex-end
132-
151+
133152
.copyright-item
134153
flex 0 0 auto
135154
padding 0 10px
136155
position relative
137156
line-height 12px
138157
border-right 1px solid rgba(255, 255, 255, 0.6)
139-
158+
140159
&:last-child
141160
border-right none
142-
161+
143162
a
144163
font-size 12px
145164
color rgba(255, 255, 255, 0.6)
146165
text-decoration none
147166
transition color .3s
148-
167+
149168
&:hover
150169
color rgba(255, 255, 255, 0.9)
151-
170+
152171
@media (max-width: $MQMobile)
153172
.footer
154173
height 100px
155174
flex-direction column
156-
175+
157176
.footer-left-wrap
158177
align-items center
159178
justify-content center

docs/README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,16 @@ module.exports = {
8686

8787
For now `ContactType` supports following enums:
8888

89-
- github
9089
- facebook
91-
- twitter
90+
- github
91+
- gitlab
9292
- instagram
9393
- linkedin
94+
- mail
95+
- messenger
96+
- phone
97+
- twitter
98+
- web
9499

95100
::: tip
96101
Welcome contribution of adding more built-in contact type.

example/.vuepress/config.js

+24
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ module.exports = {
2525
*/
2626
footer: {
2727
contact: [
28+
{
29+
type: 'facebook',
30+
link: '#',
31+
},
2832
{
2933
type: 'github',
3034
link: 'https://github.com/ulivz',
3135
},
36+
{
37+
type: 'gitlab',
38+
link: '#',
39+
},
3240
{
3341
type: 'instagram',
3442
link: '#',
@@ -37,10 +45,26 @@ module.exports = {
3745
type: 'linkedin',
3846
link: '#',
3947
},
48+
{
49+
type: 'mail',
50+
link: '#',
51+
},
52+
{
53+
type: 'messenger',
54+
link: '#',
55+
},
56+
{
57+
type: 'phone',
58+
link: '#',
59+
},
4060
{
4161
type: 'twitter',
4262
link: 'https://twitter.com/_ulivz',
4363
},
64+
{
65+
type: 'web',
66+
link: '#',
67+
}
4468
],
4569
copyright: [
4670
{

0 commit comments

Comments
 (0)