MCPcopy Create free account
hub / github.com/codrops/ShapesSlideshow / init

Method init

src/js/demo2/slideshow.js:27–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 this.init();
26 }
27 init() {
28 this.DOM.slides[this.current].classList.add('slide--current');
29 gsap.set(this.slides[this.current].DOM.imgWrap, {clipPath: this.config.clipPath.initial});
30
31 for (const slide of this.slides) {
32 slide.DOM.link.addEventListener('mouseenter', () => {
33 gsap.killTweensOf(slide.DOM.imgWrap);
34 gsap.to(slide.DOM.imgWrap, {
35 duration: 0.7,
36 ease: 'expo',
37 clipPath: this.config.clipPath.hover
38 });
39 });
40 slide.DOM.link.addEventListener('mouseleave', () => {
41 gsap.killTweensOf(slide.DOM.imgWrap);
42 gsap.to(slide.DOM.imgWrap, {
43 duration: 0.7,
44 ease: 'expo',
45 clipPath: this.config.clipPath.initial
46 });
47 });
48 }
49 }
50 next() {
51 this.navigate('next');
52 }

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected