PageSourceSearch

https://learntechglobal.com/wp-content/themes/consultio/elementor/js/ct-elementor.js?ver=3.2.6

js learntechglobal.com collected 2026-10-09 17:33:29 UTC 9,533 bytes, 251 lines download raw bytes

1(function ($) {
2    /**
3     * @param $scope The Widget wrapper element as a jQuery element
4     * @param $ The jQuery alias
5     */
6    var WidgetCTIlineHandler = function ($scope, $) {
7        setTimeout(function () {
8            $(".elementor-top-section").each(function () {
9                var _el_particle = $(this).find(
10                        ".elementor-container .el-move-parents"
11                    ),
12                    _el_particle_remove = $(this).find(
13                        ".elementor-widget-wrap .el-move-parents"
14                    ),
15                    _row_particle = $(this).find("> .elementor-container");
16                _row_particle.before(_el_particle.clone());
17                _el_particle_remove.remove();
18            });
19        }, 200);
20    };
21
22    function consultio_split_text($scope) {
23        setTimeout(function () {
24            var st = $scope.find(".pxl-split-text");
25            if (st.length == 0) return;
26            gsap.registerPlugin(SplitText);
27            st.each(function (index, el) {
28                el.split = new SplitText(el, {
29                    type: "lines,words,chars",
30                    linesClass: "split-line",
31                });
32                gsap.set(el, { perspective: 400 });
33
34                if ($(el).hasClass("split-in-fade")) {
35                    gsap.set(el.split.chars, {
36                        opacity: 0,
37                        ease: "Back.easeOut",
38                    });
39                }
40                if ($(el).hasClass("split-in-right")) {
41                    gsap.set(el.split.chars, {
42                        opacity: 0,
43                        x: "50",
44                        ease: "Back.easeOut",
45                    });
46                }
47                if ($(el).hasClass("split-in-left")) {
48                    gsap.set(el.split.chars, {
49                        opacity: 0,
50                        x: "-50",
51                        ease: "circ.out",
52                    });
53                }
54                if ($(el).hasClass("split-in-up")) {
55                    gsap.set(el.split.chars, {
56                        opacity: 0,
57                        y: "80",
58                        ease: "circ.out",
59                    });
60                }
61                if ($(el).hasClass("split-in-down")) {
62                    gsap.set(el.split.chars, {
63                        opacity: 0,
64                        y: "-80",
65                        ease: "circ.out",
66                    });
67                }
68                if ($(el).hasClass("split-in-rotate")) {
69                    gsap.set(el.split.chars, {
70                        opacity: 0,
71                        rotateX: "50deg",
72                        ease: "circ.out",
73                    });
74                }
75                if ($(el).hasClass("split-in-scale")) {
76                    gsap.set(el.split.chars, {
77                        opacity: 0,
78                        scale: "0.5",
79                        ease: "circ.out",
80                    });
81                }
82                el.anim = gsap.to(el.split.chars, {
83                    scrollTrigger: {
84                        trigger: el,
85                        toggleActions: "restart pause resume reverse",
86                        start: "top 90%",
87                    },
88                    x: "0",
89                    y: "0",
90                    rotateX: "0",
91                    scale: 1,
92                    opacity: 1,
93                    duration: 0.8,
94                    stagger: 0.02,
95                });
96            });
97        }, 500);
98    }
99
100    function consultio_text_marquee($scope) {
101        const text_marquee = $scope.find(".pxl-text--marquee");
102
103        const boxes = gsap.utils.toArray(text_marquee);
104
105        const loop = text_horizontalLoop(boxes, { paused: false, repeat: -1 });
106
107        function text_horizontalLoop(items, config) {
108            items = gsap.utils.toArray(items);
109            config = config || {};
110            let tl = gsap.timeline({
111                    repeat: config.repeat,
112                    paused: config.paused,
113                    defaults: { ease: "none" },
114                    onReverseComplete: () =>
115                        tl.totalTime(tl.rawTime() + tl.duration() * 100),
116                }),
117                length = items.length,
118                startX = items[0].offsetLeft,
119                times = [],
120                widths = [],
121                xPercents = [],
122                curIndex = 0,
123                pixelsPerSecond = (config.speed || 1) * 100,
124                snap =
125                    config.snap === false
126                        ? (v) => v
127                        : gsap.utils.snap(config.snap || 1),
128                totalWidth,
129                curX,
130                distanceToStart,
131                distanceToLoop,
132                item,
133                i;
134            gsap.set(items, {
135                xPercent: (i, el) => {
136                    let w = (widths[i] = parseFloat(
137                        gsap.getProperty(el, "width", "px")
138                    ));
139                    xPercents[i] = snap(
140                        (parseFloat(gsap.getProperty(el, "x", "px")) / w) *
141                            100 +
142                            gsap.getProperty(el, "xPercent")
143                    );
144                    return xPercents[i];
145                },
146            });
147            gsap.set(items, { x: 0 });
148            totalWidth =
149                items[length - 1].offsetLeft +
150                (xPercents[length - 1] / 100) * widths[length - 1] -
151                startX +
152                items[length - 1].offsetWidth *
153                    gsap.getProperty(items[length - 1], "scaleX") +
154                (parseFloat(config.paddingRight) || 0);
155            for (i = 0; i < length; i++) {
156                item = items[i];
157                curX = (xPercents[i] / 100) * widths[i];
158                distanceToStart = item.offsetLeft + curX - startX;
159                distanceToLoop =
160                    distanceToStart +
161                    widths[i] * gsap.getProperty(item, "scaleX");
162                tl.to(
163                    item,
164                    {
165                        xPercent: snap(
166                            ((curX - distanceToLoop) / widths[i]) * 100
167                        ),
168                        duration: distanceToLoop / pixelsPerSecond,
169                    },
170                    0
171                )
172                    .fromTo(
173                        item,
174                        {
175                            xPercent: snap(
176                                ((curX - distanceToLoop + totalWidth) /
177                                    widths[i]) *
178                                    100
179                            ),
180                        },
181                        {
182                            xPercent: xPercents[i],
183                            duration:
184                                (curX - distanceToLoop + totalWidth - curX) /
185                                pixelsPerSecond,
186                            immediateRender: false,
187                        },
188                        distanceToLoop / pixelsPerSecond
189                    )
190                    .add("label" + i, distanceToStart / pixelsPerSecond);
191                times[i] = distanceToStart / pixelsPerSecond;
192            }
193            function toIndex(index, vars) {
194                vars = vars || {};
195                Math.abs(index - curIndex) > length / 2 &&
196                    (index += index > curIndex ? -length : length);
197                let newIndex = gsap.utils.wrap(0, length, index),
198                    time = times[newIndex];
199                if (time > tl.time() !== index > curIndex) {
200                    vars.modifiers = {
201                        time: gsap.utils.wrap(0, tl.duration()),
202                    };
203                    time += tl.duration() * (index > curIndex ? 1 : -1);
204                }
205                curIndex = newIndex;
206                vars.overwrite = true;
207                return tl.tweenTo(time, vars);
208            }
209            tl.next = (vars) => toIndex(curIndex + 1, vars);
210            tl.previous = (vars) => toIndex(curIndex - 1, vars);
211            tl.current = () => curIndex;
212            tl.toIndex = (index, vars) => toIndex(index, vars);
213            tl.times = times;
214            tl.progress(1, true).progress(0, true);
215            if (config.reversed) {
216                tl.vars.onReverseComplete();
217                tl.reverse();
218            }
219            return tl;
220        }
221    }
222
223    // Make sure you run this code under Elementor.
224    $(window).on("elementor/frontend/init", function () {
225        elementorFrontend.hooks.addAction(
226            "frontend/element_ready/ct_logo_animate.default",
227            WidgetCTIlineHandler
228        );
229        elementorFrontend.hooks.addAction(
230            "frontend/element_ready/ct_particle_animate.default",
231            WidgetCTIlineHandler
232        );
233        elementorFrontend.hooks.addAction(
234            "frontend/element_ready/ct_portfolio_external.default",
235            WidgetCTIlineHandler
236        );
237
238        elementorFrontend.hooks.addAction(
239            "frontend/element_ready/ct_heading.default",
240            function ($scope) {
241                consultio_split_text($scope);
242            }
243        );
244        elementorFrontend.hooks.addAction(
245            "frontend/element_ready/ct_text_marquee.default",
246            function ($scope) {
247                consultio_text_marquee($scope);
248            }
249        );
250    });
251})(jQuery);

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.