-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy path1618-7b4a00f39bd6ebb745b3.js.map
1 lines (1 loc) · 2.04 KB
/
1618-7b4a00f39bd6ebb745b3.js.map
1
{"version":3,"file":"1618-7b4a00f39bd6ebb745b3.js","mappings":"uIAAA,mvD","sources":["webpack://embla-carousel-docs/./src/components/Sandbox/Vanilla/SandboxFilesDist/InfiniteScroll/EmblaCarousel.ts"],"sourcesContent":["export default \"import EmblaCarousel, { EmblaOptionsType } from 'embla-carousel'\\nimport {\\n setupInfiniteScroll,\\n mockApiCall,\\n SLIDE_TEMPLATE,\\n createHTMLFromString\\n} from './EmblaCarouselInfiniteScroll'\\nimport { addPrevNextBtnsClickHandlers } from '../EmblaCarouselArrowButtons'\\nimport '../css/base.css'\\nimport '../css/sandbox.css'\\nimport '../css/embla.css'\\n\\nconst OPTIONS: EmblaOptionsType = {}\\n\\nconst emblaNode = <HTMLElement>document.querySelector('.embla')\\nconst viewportNode = <HTMLElement>emblaNode.querySelector('.embla__viewport')\\nconst prevBtn = <HTMLElement>emblaNode.querySelector('.embla__button--prev')\\nconst nextBtn = <HTMLElement>emblaNode.querySelector('.embla__button--next')\\n\\nconst emblaApi = EmblaCarousel(viewportNode, OPTIONS)\\n\\nconst removePrevNextBtnsClickHandlers = addPrevNextBtnsClickHandlers(\\n emblaApi,\\n prevBtn,\\n nextBtn\\n)\\n\\nconst onResize = () => emblaApi.reInit()\\nconst startInfiniteScroll = setupInfiniteScroll(\\n emblaApi,\\n (loadMore, endInfiniteScroll, slideCount) => {\\n mockApiCall(1000, 2000, () => {\\n if (slideCount === 20) return endInfiniteScroll()\\n\\n const fiveNewSlideNodes = Array.from(Array(5).keys())\\n const slideNodesToAdd = fiveNewSlideNodes\\n .map(() => SLIDE_TEMPLATE)\\n .map((template, index) => {\\n const slideNumber = slideCount + index + 1\\n return template.replace('__SLIDE_NUMBER__', slideNumber.toString())\\n })\\n .map(createHTMLFromString)\\n\\n loadMore(slideNodesToAdd)\\n })\\n }\\n)\\n\\nemblaApi\\n .on('init', startInfiniteScroll)\\n .on('destroy', () => {\\n window.removeEventListener('resize', onResize)\\n })\\n .on('destroy', removePrevNextBtnsClickHandlers)\\n\\nwindow.addEventListener('resize', onResize)\\n\";"],"names":[],"sourceRoot":""}