View smooth-scroll.js
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
<template> | |
<div class="page" :style="{height: `${pageHeight}px`" }> | |
<div ref="page" class="page-inner"> | |
</div> | |
</template> | |
<script> | |
import { TimelineMax, TweenMax, Linear } from 'gsap' |
View scroll-percentage.js
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
const { top, height } = this.$el.getBoundingClientRect() | |
const { pageYOffset, innerHeight } = window | |
const min = top + pageYOffset | |
const max = min + height - innerHeight | |
const percentage = ((pageYOffset - min) * 100) / (max - min) |
View paginator.js
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
import clamp from 'lodash/clamp' | |
export default { | |
props: { | |
/** | |
* The items inside the paginator | |
*/ | |
items: { | |
type: Array, |