1if (window.visualViewport.width > 768) { 2 gsap.registerPlugin(ScrollTrigger); 3 4 let smoother = ScrollSmoother.create({ 5 smooth: 0.5, // seconds it takes to "catch up" to native scroll position 6 effects: true // look for data-speed and data-lag attributes on elements and animate accordingly 7 }); 8 9 var createScrollGsap = (sectionSelected, triggerClass) => { 10 const sections = gsap.utils.toArray(sectionSelected); 11 12 let maxWidth = 0; 13 const getMaxWidth = () => { 14 maxWidth = 0; 15 sections.forEach((section) => { 16 maxWidth += section.offsetWidth; 17 }); 18 }; 19 20 getMaxWidth(); 21 22 gsap.set(sections, { x: 0 }); 23 24 ScrollTrigger.addEventListener("refreshInit", getMaxWidth); 25 26 var sc = gsap.to(sections, { 27 x: (maxWidth - (window.innerWidth) + 20), 28 ease: "none", 29 scrollTrigger: { 30 trigger: triggerClass, 31 pin: true, 32 scrub: true, 33 // snap: 1 / (sections.length - 1), 34 end: () => `+=${maxWidth * (2 / 3)}`, 35 invalidateOnRefresh: true 36 } 37 }); 38 39 sections.forEach((sct, i) => { 40 ScrollTrigger.create({ 41 trigger: sct, 42 start: () => 'top top-=' + (sct.offsetLeft - window.innerWidth / 2) * (maxWidth / (maxWidth - window.innerWidth)), 43 end: () => '+=' + sct.offsetWidth * (maxWidth / (maxWidth - window.innerWidth)), 44 toggleClass: { targets: sct, className: "active" } 45 }); 46 }); 47 48 return sc; 49 } 50 51 var eventScroll = createScrollGsap("eventsection", ".wrapper-event-slider"); 52 53 //$("#event-more-btn").click(function () { 54 // $(".event-more-section").hide(); 55 // $(".more-event").show(); 56 // eventScroll.kill(); 57 // /*ScrollTrigger.refresh();*/ 58 // createScrollGsap("eventsection", ".wrapper-event-slider"); 59 //}); 60 61 62 createScrollGsap("speakersection", ".wrapper-speaker-slider"); 63 64 const createScrollSponsorsGsap = (sectionSelected, triggerClass) => { 65 66 const sections = gsap.utils.toArray(sectionSelected); 67 68 let maxWidth = 0; 69 const getMaxWidth = () => { 70 maxWidth = 0; 71 sections.forEach((section) => { 72 maxWidth += section.offsetWidth; 73 }); 74 }; 75 76 getMaxWidth(); 77 78 gsap.set(sections, { x: (-(window.innerWidth * 2)) }); 79 80 ScrollTrigger.addEventListener("refreshInit", getMaxWidth); 81 82 gsap.to(sections, { 83 x: (maxWidth + 700), 84 ease: "none", 85 scrollTrigger: { 86 trigger: triggerClass, 87 pin: false, 88 scrub: true, 89 // snap: 1 / (sections.length - 1), 90 end: () => `+=${window.innerHeight + (window.innerHeight / 2)}`, 91 invalidateOnRefresh: true 92 } 93 }); 94 95 sections.forEach((sct, i) => { 96 ScrollTrigger.create({ 97 trigger: sct, 98 start: () => 'top top-=' + (sct.offsetLeft - window.innerWidth / 2) * (maxWidth / (maxWidth - window.innerWidth)), 99 end: () => '+=' + sct.offsetWidth * (maxWidth / (maxWidth - window.innerWidth)), 100 toggleClass: { targets: sct, className: "active" } 101 }); 102 }); 103 } 104 105 const createScrollPartnersGsap = (sectionSelected, triggerClass) => { 106 107 const sections = gsap.utils.toArray(sectionSelected); 108 109 let maxWidth = 0; 110 const getMaxWidth = () => { 111 maxWidth = 0; 112 sections.forEach((section) => { 113 maxWidth += section.offsetWidth; 114 }); 115 }; 116 117 getMaxWidth(); 118 119 gsap.set(sections, { x: maxWidth + (window.innerWidth / 1.5) }); 120 121 ScrollTrigger.addEventListener("refreshInit", getMaxWidth); 122 123 gsap.to(sections, { 124 x: - (window.innerWidth) - (window.innerWidth / 2), 125 ease: "none", 126 scrollTrigger: { 127 trigger: triggerClass,
128 pin: false, 129 scrub: true, 130 // snap: 1 / (sections.length - 1), 131 end: () => `+=${window.innerHeight * 2}`, 132 invalidateOnRefresh: true 133 } 134 }); 135 136 sections.forEach((sct, i) => { 137 ScrollTrigger.create({ 138 trigger: sct, 139 start: () => 'top top-=' + (sct.offsetLeft - window.innerWidth / 2) * (maxWidth / (maxWidth - window.innerWidth)), 140 end: () => '+=' + sct.offsetWidth * (maxWidth / (maxWidth - window.innerWidth)), 141 toggleClass: { targets: sct, className: "active" } 142 }); 143 }); 144 } 145 146 const createScrollMediaPartnersGsap = (sectionSelected, triggerClass) => { 147 148 149 const sections = gsap.utils.toArray(sectionSelected); 150 151 let maxWidth = 0; 152 const getMaxWidth = () => { 153 maxWidth = 0; 154 sections.forEach((section) => { 155 maxWidth += section.offsetWidth; 156 }); 157 }; 158 159 getMaxWidth(); 160 161 gsap.set(sections, { x: (-(window.innerWidth * 4)) }); 162 163 ScrollTrigger.addEventListener("refreshInit", getMaxWidth); 164 165 gsap.to(sections, { 166 x: (maxWidth ), 167 ease: "none", 168 scrollTrigger: { 169 trigger: triggerClass, 170 pin: false, 171 scrub: true, 172 // snap: 1 / (sections.length - 1), 173 end: () => `+=${window.innerHeight + (window.innerHeight )}`, 174 invalidateOnRefresh: true 175 } 176 }); 177 178 sections.forEach((sct, i) => { 179 ScrollTrigger.create({ 180 trigger: sct, 181 start: () => 'top top-=' + (sct.offsetLeft - window.innerWidth / 2) * (maxWidth / (maxWidth - window.innerWidth)), 182 end: () => '+=' + sct.offsetWidth * (maxWidth / (maxWidth - window.innerWidth)), 183 toggleClass: { targets: sct, className: "active" } 184 }); 185 }); 186 } 187 188 189 // $(".sponsors-logos").css("width", ($(".sponsors-logos .slide").length * 160) + "px"); 190 // $(".partners-logos").css("width", ($(".partners-logos .slide").length * 160) + "px"); 191 // $(".mediapartners-logos").css("width", ($(".mediapartners-logos .slide").length * 160) + "px"); 192 193 //createScrollSponsorsGsap(".sponsors-logos", "#partners"); 194 //createScrollPartnersGsap(".partners-logos", "#partners"); 195 //createScrollMediaPartnersGsap(".mediapartners-logos", "#partners"); 196 197 gsap.to('.video-content', { 198 x: (window.innerWidth * (0.075)), 199 ease: "none", 200 scale: 1.4, 201 top: (window.innerHeight * (0.05)), 202 marginTop: 0, 203 transformOrigin: "top left", 204 scrollTrigger: { 205 trigger: ".parent-video-inotex", 206 pin: true, 207 scrub: true, 208 // snap: 1, 209 end: () => `+=${window.innerHeight}`, 210 invalidateOnRefresh: true 211 } 212 }); 213 214 gsap.to('.inotex-des', { 215 opacity: 0, 216 y: -300, 217 ease: "none", 218 scrollTrigger: { 219 trigger: ".parent-inotex-des", 220 scrub: true, 221 // snap: 1, 222 pin: true, 223 end: () => `+=${window.innerHeight / 2}`, 224 invalidateOnRefresh: true 225 } 226 }); 227 228 //$("#event-more-btn").click(function () { 229 230 // $(".event-more-section").hide(); 231 // $(".more-event").show(); 232 // /*ScrollTrigger.refresh();*/ 233 // createScrollGsap("eventsection", ".wrapper-event-slider"); 234 //}); 235 236 237 //gsap.to('#last-inotex-video-section .container', { 238 // y: 350, 239 // opacity: 0, 240 // ease: "none", 241 // scrollTrigger: { 242 // start: () => 'top top+=' + (150), 243 // trigger: "#last-inotex-video-section", 244 // scrub: true, 245 // // snap: 1, 246 // pin: false, 247 // end: () => `+=${window.innerHeight}`, 248 // invalidateOnRefresh: true 249 // } 250 //}); 251 252}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.