Skip to content

Commit

Permalink
feat: add a GitHub button on the demo and scroll back to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorainville committed Mar 16, 2018
1 parent 8cd3883 commit 94adbdd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions demo/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>
8 changes: 7 additions & 1 deletion demo/src/components/MyTour.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export default {
],
callbacks: {
onPreviousStep: this.myCustomPreviousStepCallback,
onNextStep: this.myCustomNextStepCallback
onNextStep: this.myCustomNextStepCallback,
onStop: () => {
window.scroll({
top: 0,
behavior: 'smooth'
})
}
}
}
},
Expand Down
15 changes: 13 additions & 2 deletions demo/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
<h2>VUE TOUR</h2>
</a>
</div>

<h1>vue-tour</h1>
<h2>a <u>Lightweight</u>, <u>Simple</u> and <u>Customizable</u> tour plugin for use with Vue.js</h2>

<p>
<a href="https://pulsar.gitbooks.io/vue-tour/" class="btn btn-primary btn-lg">Docs</a>
<a href="https://github.com/pulsardev/vue-tour" target="_blank" class="btn btn-primary btn-lg">GitHub</a>
</p>
<p class="text-gray">Latest version: <span class="version">1.0.0</span></p>

<p>
<a class="github-button" href="https://github.com/pulsardev/vue-tour" data-size="large" data-show-count="true" aria-label="Star pulsardev/vue-tour on GitHub">Star</a>
</p>

<p class="text-gray">Latest version: <span class="version">{{ version }}</span></p>
<div class="columns">
<div class="column col-4 col-xs-12">
<div class="card text-center">
Expand Down Expand Up @@ -106,7 +112,7 @@

<footer class="section section-footer">
<div id="copyright" class="grid-footer container grid-lg">
<p><a href="https://pulsar.gitbooks.io/vue-tour/" target="_blank">Documents</a> | <a href="https://github.com/pulsardev/vue-tour" target="_blank">GitHub</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CLK49A83DXCQ8" target="_blank">PayPal Donate</a> | Version <span class="version">1.0.0</span></p>
<p><a href="https://pulsar.gitbooks.io/vue-tour/" target="_blank">Documents</a> | <a href="https://github.com/pulsardev/vue-tour" target="_blank">GitHub</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CLK49A83DXCQ8" target="_blank">PayPal Donate</a> | Version <span class="version">{{ version }}</span></p>
<p>Built with <span class="text-error">♥</span> by <a href="https://pulsar.surge.sh" target="_blank">Pulsar</a>. Licensed under the <a href="https://github.com/pulsardev/vue-tour/blob/master/LICENSE" target="_blank">MIT License</a>.</p>
</div>
</footer>
Expand All @@ -120,6 +126,11 @@ export default {
name: 'home',
components: {
MyTour
},
data () {
return {
version: '1.0.0'
}
}
}
</script>
2 changes: 1 addition & 1 deletion demo/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
baseUrl: './'
}
}

0 comments on commit 94adbdd

Please sign in to comment.