PageSourceSearch

https://tapestrycapital.ca/wp-content/themes/bb-theme-child/components/statistics/statistics.js?ver=2138442221

js tapestrycapital.ca collected 2026-09-25 04:53:49 UTC 3,992 bytes, 94 lines download raw bytes

1jQuery(document).ready(function ($) {
2    console.log('statistics.js ready');
3
4
5    /////////////////////////////////
6    // Statistics + Image Parallax //
7    /////////////////////////////////
8    function radius_set() {
9        setTimeout(function(){
10            $('.floating-img').each(function(){
11                radius = $(this).find(".fl-photo-img").css("border-radius")
12                $(this).find(".fl-photo-img").parent().css("border-radius",radius);
13            })
14        },500)
15    }
16    
17    if ( $('.floating-img').length > 0 ) {
18
19        radius_set()
20
21        if ( $(window).width() > 768 ) {
22            let windowHeight;
23            let windowOffsetTop;
24            let windowOffsetBottom;
25            let imgHeight;
26            let imgOffsetTop;
27            let imgOffsetBottom;
28            let imgPos;
29            let parentHeight;
30            let parentOffsetTop;
31            let parentOffsetBottom;
32            let textOffsetBottom;
33
34            $( document ).scroll( function () {
35                windowHeight = $(window).height();
36                windowOffsetTop = $(window).scrollTop();
37                windowOffsetBottom = windowHeight + windowOffsetTop;
38
39                // for XL view only, 
40                if ( $(window).width() > 1351 ) {
41                    // bottom of floating-txt is 45px below bottom of floating-img
42                    textOffsetBottom = 45;
43                }
44                // for L, tablet & mobile, 
45                else {
46                    // bottom of floating-txt is 120px below bottom of floating-img
47                    textOffsetBottom = 120;
48                }
49
50                $('.floating-img').each( function () {
51                    imgHeight = $(this).height();
52                    imgOffsetTop = $(this).offset().top;
53                    imgOffsetBottom = imgHeight + imgOffsetTop;
54
55                    parentHeight = $(this).parents('.fl-col-content').height();
56                    parentOffsetTop = $(this).parents('.fl-col-content').offset().top;
57                    parentOffsetBottom = parentHeight + parentOffsetTop;
58
59
60
61                    // Calculate image position relative to window,
62                    // if top of img is above bottom of window
63                    // & bottom of img is bellow top of window
64                    if (imgOffsetTop < windowOffsetBottom && imgOffsetBottom > windowOffsetTop) {
65                        if ((windowOffsetBottom - imgOffsetTop) / (imgOffsetBottom - windowOffsetTop) < 1) {
66                            imgPos = ((windowOffsetBottom - imgOffsetTop) / (imgOffsetBottom - windowOffsetTop)) * 50;
67                        } else if ((imgOffsetBottom - windowOffsetTop) / (windowOffsetBottom - imgOffsetTop) < 1) {
68                            imgPos = 100 - ((imgOffsetBottom - windowOffsetTop) / (windowOffsetBottom - imgOffsetTop)) * 50;
69                        }
70                        // Parallax effect
71                        $(this).find('img').css({'object-position': `0 ${imgPos}%`});
72                        // Slide container
73                        if ($(this).hasClass('slide-up')) {
74                            $(this).parents('.fl-col-content').find('.floating-txt').css({'bottom': `calc(-${textOffsetBottom}px + ${parentOffsetBottom - imgOffsetBottom}px)`});
75                            $(this).css({'transform': `translateY(-${imgPos / 6}%)`});
76                        } else if ($(this).hasClass('slide-down')) {
77                            $(this).parents('.fl-col-content').find('.floating-txt').css({'bottom': `calc(-${textOffsetBottom}px + ${parentOffsetBottom - imgOffsetBottom}px)`});
78                            $(this).css({'transform': `translateY(${imgPos / 6}%)`});
79                        }
80                    }
81                });
82            });
83        };
84    };
85
86
87    $(window).on( "resize", function() {
88
89        radius_set()
90
91    });
92
93    
94})

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.