| import layoutHelpers from '@/layout/helpers.js' |
= |
import layoutHelpers from '@/layout/helpers.js' |
| |
|
|
| export default function () { |
|
export default function () { |
| return { |
|
return { |
| |
|
|
| publicUrl: '/', |
<> |
publicUrl: process.env.BASE_URL, |
| |
= |
|
| |
|
|
| layoutHelpers, |
|
layoutHelpers, |
| |
|
|
| |
|
|
| get isRTL () { |
|
get isRTL () { |
| return document.documentElement.getAttribute('dir') === 'rtl' || |
|
return document.documentElement.getAttribute('dir') === 'rtl' || |
| document.body.getAttribute('dir') === 'rtl' |
|
document.body.getAttribute('dir') === 'rtl' |
| }, |
|
}, |
| |
|
|
| |
|
|
| get isIEMode () { |
|
get isIEMode () { |
| return typeof document['documentMode'] === 'number' |
|
return typeof document['documentMode'] === 'number' |
| }, |
|
}, |
| |
|
|
| |
|
|
| get isIE10Mode () { |
|
get isIE10Mode () { |
| return this.isIEMode && document['documentMode'] === 10 |
|
return this.isIEMode && document['documentMode'] === 10 |
| }, |
|
}, |
| |
|
|
| |
|
|
| get layoutNavbarBg () { |
|
get layoutNavbarBg () { |
| return 'navbar-theme' |
|
return 'navbar-theme' |
| }, |
|
}, |
| |
|
|
| |
|
|
| get layoutSidenavBg () { |
|
get layoutSidenavBg () { |
| return 'sidenav-theme' |
|
return 'sidenav-theme' |
| }, |
|
}, |
| |
|
|
| |
|
|
| get layoutFooterBg () { |
|
get layoutFooterBg () { |
| return 'footer-theme' |
|
return 'footer-theme' |
| }, |
|
}, |
| |
|
|
| |
|
|
| scrollTop (to, duration, element = document.scrollingElement || document.documentElement) { |
|
scrollTop (to, duration, element = document.scrollingElement || document.documentElement) { |
| if (element.scrollTop === to) return |
|
if (element.scrollTop === to) return |
| const start = element.scrollTop |
|
const start = element.scrollTop |
| const change = to - start |
|
const change = to - start |
| const startDate = +new Date() |
|
const startDate = +new Date() |
| |
|
|
| |
|
|
| const easeInOutQuad = (t, b, c, d) => { |
|
const easeInOutQuad = (t, b, c, d) => { |
| t /= d / 2 |
|
t /= d / 2 |
| if (t < 1) return c / 2 * t * t + b |
|
if (t < 1) return c / 2 * t * t + b |
| t-- |
|
t-- |
| return -c / 2 * (t * (t - 2) - 1) + b |
|
return -c / 2 * (t * (t - 2) - 1) + b |
| } |
|
} |
| |
|
|
| const animateScroll = () => { |
|
const animateScroll = () => { |
| const currentDate = +new Date() |
|
const currentDate = +new Date() |
| const currentTime = currentDate - startDate |
|
const currentTime = currentDate - startDate |
| element.scrollTop = parseInt(easeInOutQuad(currentTime, start, change, duration)) |
|
element.scrollTop = parseInt(easeInOutQuad(currentTime, start, change, duration)) |
| if (currentTime < duration) { |
|
if (currentTime < duration) { |
| requestAnimationFrame(animateScroll) |
|
requestAnimationFrame(animateScroll) |
| } else { |
|
} else { |
| element.scrollTop = to |
|
element.scrollTop = to |
| } |
|
} |
| } |
|
} |
| |
|
|
| animateScroll() |
|
animateScroll() |
| } |
|
} |
| } |
|
} |
| } |
|
} |