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

Commit

Permalink
feat: add several contact types
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
thesmiley1 authored and billyyyyy3320 committed Nov 23, 2019
1 parent 6b9ca81 commit 8f5d015
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 32 deletions.
79 changes: 49 additions & 30 deletions components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</li>
</ul>
</div>

<div class="footer-right-wrap">
<ul class="copyright" v-if="copyright">
<li class="copyright-item" v-for="item in copyright">
Expand All @@ -23,41 +23,61 @@

<script>
import {
GithubIcon,
FacebookIcon,
TwitterIcon,
GithubIcon,
GitlabIcon,
GlobeIcon,
InstagramIcon,
LinkedinIcon
LinkedinIcon,
MailIcon,
MessageSquareIcon,
PhoneIcon,
TwitterIcon
} from 'vue-feather-icons'
export default {
components: {
GithubIcon,
FacebookIcon,
TwitterIcon,
GithubIcon,
GitlabIcon,
GlobeIcon,
InstagramIcon,
LinkedinIcon
LinkedinIcon,
MailIcon,
MessageSquareIcon,
PhoneIcon,
TwitterIcon
},
methods: {
getIconComponentName(contactType) {
switch (contactType) {
case 'github':
return 'GithubIcon'
case 'facebook':
return 'FacebookIcon'
case 'twitter':
return 'TwitterIcon'
case 'github':
return 'GithubIcon'
case 'gitlab':
return 'GitlabIcon'
case 'instagram':
return 'InstagramIcon'
case 'linkedin':
return 'LinkedinIcon'
case 'mail':
return 'MailIcon'
case 'messenger':
return 'MessageSquareIcon'
case 'phone':
return 'PhoneIcon'
case 'twitter':
return 'TwitterIcon'
case 'web':
return 'GlobeIcon'
default:
return ''
}
},
},
computed: {
contact() {
return (
Expand All @@ -71,7 +91,7 @@
})
.filter(({ iconComponent }) => iconComponent)
},
copyright() {
return (
this.$themeConfig.footer && this.$themeConfig.footer.copyright || []
Expand All @@ -86,37 +106,36 @@
list-style none
margin 0
padding 0
.footer
height 60px
box-sizing border-box
// background-color darken(#3eaf7c, 70%)
background-color #000
color #FFF
display flex
padding 15px 32px
.footer-left-wrap
line-height 30px
flex 1
display flex
.contact
display flex
.contact-item
flex 1
margin-right 10px
a
font-size 12px
color rgba(255, 255, 255, 0.45)
text-decoration none
transition color .3s
&:hover
color #FFF
.footer-right-wrap
flex 1
display flex
Expand All @@ -125,35 +144,35 @@
@media(min-width: $MQNarrow)
justify-content flex-end
.copyright
display flex
justify-content flex-end
.copyright-item
flex 0 0 auto
padding 0 10px
position relative
line-height 12px
border-right 1px solid rgba(255, 255, 255, 0.6)
&:last-child
border-right none
a
font-size 12px
color rgba(255, 255, 255, 0.6)
text-decoration none
transition color .3s
&:hover
color rgba(255, 255, 255, 0.9)
@media (max-width: $MQMobile)
.footer
height 100px
flex-direction column
.footer-left-wrap
align-items center
justify-content center
Expand Down
9 changes: 7 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@ module.exports = {

For now `ContactType` supports following enums:

- github
- facebook
- twitter
- github
- gitlab
- instagram
- linkedin
- mail
- messenger
- phone
- twitter
- web

::: tip
Welcome contribution of adding more built-in contact type.
Expand Down
24 changes: 24 additions & 0 deletions example/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ module.exports = {
*/
footer: {
contact: [
{
type: 'facebook',
link: '#',
},
{
type: 'github',
link: 'https://github.com/ulivz',
},
{
type: 'gitlab',
link: '#',
},
{
type: 'instagram',
link: '#',
Expand All @@ -37,10 +45,26 @@ module.exports = {
type: 'linkedin',
link: '#',
},
{
type: 'mail',
link: '#',
},
{
type: 'messenger',
link: '#',
},
{
type: 'phone',
link: '#',
},
{
type: 'twitter',
link: 'https://twitter.com/_ulivz',
},
{
type: 'web',
link: '#',
}
],
copyright: [
{
Expand Down

0 comments on commit 8f5d015

Please sign in to comment.