This repository has been archived by the owner on Sep 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ccf25d
commit 8826e6f
Showing
6 changed files
with
155 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<div v-show="visible"> | ||
<ob-share-page></ob-share-page> | ||
<ob-scroll-to-top></ob-scroll-to-top> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss"> | ||
</style> | ||
|
||
<script> | ||
import debounce from 'lodash.debounce'; | ||
import ObSharePage from "./share-page.vue"; | ||
import ObScrollToTop from "./scroll-to-top.vue"; | ||
export default { | ||
components: { | ||
ObScrollToTop, | ||
ObSharePage | ||
}, | ||
name: 'ob-scrolled-hud', | ||
data() { | ||
return { | ||
visible: false, | ||
visibleOffset: 600, | ||
scrollDebounce: 10 | ||
} | ||
}, | ||
mounted() { | ||
this.debouncedOnScroll = debounce(this.onScroll, this.scrollDebounce); | ||
window.addEventListener('scroll', this.debouncedOnScroll); | ||
// Bootstrap | ||
this.onScroll(); | ||
}, | ||
destroyed() { | ||
window.removeEventListener('scroll', this.debouncedOnScroll); | ||
}, | ||
methods: { | ||
onScroll() { | ||
this.visible = (window.pageYOffset > this.visibleOffset); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<button class="button is-primary share-page animated fadeInUp" @click="onUserWantsToShare()"> | ||
<span class="icon"> | ||
<i class="fas fa-share-alt"></i> | ||
</span> | ||
<span>Share</span> | ||
<!-- <b-modal :active.sync="isShareModalOpen" has-modal-card> | ||
<div class="box"> | ||
Content | ||
</div> | ||
</b-modal>--> | ||
</button> | ||
</template> | ||
|
||
<style lang="scss"> | ||
$button-size: 45px; | ||
.share-page { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
height: $button-size; | ||
margin: 1rem; | ||
} | ||
</style> | ||
|
||
<script> | ||
import obSocialShareButtons from './social-share-buttons.vue'; | ||
export default { | ||
name: 'ob-share-page', | ||
data() { | ||
return { | ||
isShareModalOpen: false | ||
} | ||
}, | ||
methods: { | ||
onUserWantsToShare() { | ||
this.openShareModal(); | ||
}, | ||
openShareModal() { | ||
this.$modal.open({ | ||
component: obSocialShareButtons | ||
}) | ||
} | ||
}, | ||
mounted() { | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<div class="ssk-block ssk-md"> | ||
<a href="" class="ssk ssk-facebook"> | ||
Share in Facebook | ||
</a> | ||
<a href="" class="ssk ssk-twitter"> | ||
Share in Twitter | ||
</a> | ||
<a href="" class="ssk ssk-google-plus"> | ||
Share in Google Plus | ||
</a> | ||
<a href="" class="ssk ssk-pinterest"> | ||
Share in Pinterest | ||
</a> | ||
<a href="" class="ssk ssk-tumblr"> | ||
Share in Tumblr | ||
</a> | ||
<a href="" class="ssk ssk-linkedin"> | ||
Share in LinkedIn | ||
</a> | ||
</div> | ||
</template> | ||
|
||
|
||
<style lang="scss"> | ||
.ssk{ | ||
margin: 0.5rem; | ||
width: 100%; | ||
font-size: 1rem; | ||
} | ||
.ssk:before, .ssk .glyphicon, .ssk .fa{ | ||
left: -8px; | ||
} | ||
</style> | ||
|
||
<script> | ||
export default { | ||
name: 'ob-social-share-buttons', | ||
mounted() { | ||
this.initSocialShare(); | ||
}, | ||
methods: { | ||
initSocialShare() { | ||
console.log(this.$refs); | ||
const SocialShareKit = window['SocialShareKit']; | ||
SocialShareKit.init({}); | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters