xdesign-vue-next
Version:
XDesign Component for vue-next
29 lines (25 loc) • 842 B
JavaScript
/**
* xdesign v1.0.6
* (c) 2023 xdesign
* @license MIT
*/
import { elementInViewport, getWindowSize, scrollTo } from '../../utils/dom.mjs';
import '../../_chunks/dep-10a947a6.mjs';
import '../../_chunks/dep-11fa9c2c.mjs';
import '../../_chunks/dep-b75d8d74.mjs';
import '../../_chunks/dep-82805301.mjs';
import '../../_chunks/dep-a95026f2.mjs';
import '../../_chunks/dep-068e912d.mjs';
import '../../_chunks/dep-addc2a84.mjs';
import '../../_chunks/dep-1cc1c24f.mjs';
import '../../_chunks/dep-6ad18815.mjs';
import '../../utils/easing.mjs';
function scrollToElm(elm) {
var rect = elm.getBoundingClientRect();
if (!elementInViewport(elm)) {
var winHeight = getWindowSize().height;
scrollTo(rect.top - (winHeight / 2 - rect.height / 2), {});
}
}
export { scrollToElm as default };
//# sourceMappingURL=scrollToElm.mjs.map