PageSourceSearch

https://www.tomsteer.net/wp-content/themes/illdy/layout/js/scripts.js?ver=1.0.16

js tomsteer.net collected 2026-09-25 22:36:58 UTC 4,901 bytes, 158 lines download raw bytes

1jQuery( document ).ready( function( $ ) {
2  var windowWidth = $( window ).width();
3  var windowHeight = $( window ).height();
4  var documentWidth = $( document ).width();
5  var documentHeight = $( document ).height();
6
7  // If is IOS
8  function isIsIOS() {
9    if ( iOS_check()) {
10      $( '#counter' ).css( 'background-attachment', 'scroll' );
11      $( '#testimonials' ).css( 'background-attachment', 'scroll' );
12    }
13  }
14
15  // Smooth Scroll Anchors
16  function smoothScrollAnchors() {
17    $( 'body:not(.single-product) a[href*="#"]:not([href="#"])' ).on( 'click', function() {
18      var target;
19      if ( location.pathname.replace( /^\//, '' ) === this.pathname.replace( /^\//, '' ) && location.hostname === this.hostname ) {
20        target = $( this.hash );
21        target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' );
22        if ( target.length ) {
23          $( 'html,body' ).animate( {
24            scrollTop: target.offset().top - $( '#sticky-wrapper' ).outerHeight( true )
25          }, 1000 );
26          return false;
27        }
28      }
29    } );
30  }
31
32  // Open Responsive Menu
33  function openResponsiveMenu() {
34    $( '.open-responsive-menu' ).on('click',function() {
35      var top = $( '.top-header' ).outerHeight(),
36          height = $( window ).height() - top;
37
38      if ( $( '#header' ).hasClass( 'header-has-sticky-menu' ) ) {
39        $( '.responsive-menu' ).css( { 'top': top, 'max-height': height } );
40      }
41
42      $( '.responsive-menu' ).toggle( 'slow', function() {
43        $( this ).toggleClass( 'active' );
44      } );
45    } );
46  }
47
48  // Add Height To Front Page
49  function addHeightToFrontPageProject() {
50    var project = $( '#projects .project' );
51    var projectWidth = $( project ).width();
52
53    $( project ).css( 'height', projectWidth );
54  }
55
56  // Set Color on Front Page Service
57  function setColorOnFrontPageService() {
58    if ( $( '#services .section-content .service' ).length ) {
59      $( '#services .section-content .service' ).each( function() {
60        var service = $( this );
61        var serviceIcon = $( service ).children( '.service-icon' );
62        var serviceTitle = $( service ).children( '.service-title' );
63        var dataServiceColor = $( service ).data( 'service-color' );
64
65        $( serviceIcon ).css( 'color', dataServiceColor );
66        $( serviceTitle ).css( 'color', dataServiceColor );
67      } );
68    }
69  }
70
71  // Set Color on Front Page Service
72  function setColorOnFrontPagePerson() {
73    if ( $( '#team .section-content .person' ).length ) {
74      $( '#team .section-content .person' ).each( function() {
75        var person = $( this );
76        var dataPersonColor = $( person ).data( 'person-color' );
77        var personPosition = $( person ).children( '.person-content' ).children( '.person-position' );
78        var personContentSocial = $( person ).children( '.person-content' ).children( '.person-content-social.clearfix' ).children( 'li' ).children( 'a' );
79
80        $( personPosition ).css( 'color', dataPersonColor );
81        $( personContentSocial ).css( { 'border-color': dataPersonColor, 'color': dataPersonColor } );
82      } );
83    }
84  }
85
86  // Align Sub Sub Menu
87  function alignSubSubMenu() {
88    var subSubMenu;
89    if ( $( '#header .top-header .header-navigation ul li.menu-item-has-children' ).length ) {
90      subSubMenu = $( '#header .top-header .header-navigation ul li.menu-item-has-children ul' );
91
92      $( subSubMenu ).each( function() {
93        if ( ( windowWidth - $( this ).offset().left ) < 200 ) {
94          $( this ).css( 'left', '-200px' );
95        }
96      } );
97    }
98  }
99
100  // Scroll To Top
101  function scrollToTop() {
102    var item = $( '.illdy-top' );
103    if ( item.length > 0 ) {
104      item.on('click', function( event ) {
105        event.preventDefault();
106        $( 'html,body' ).animate( {
107          scrollTop: 0
108        }, 1000 );
109      } );
110
111      $( document ).on('scroll', function() {
112        var y = window.scrollY;
113        if ( y >= 300 ) {
114          item.addClass( 'is-active' );
115        } else {
116          item.removeClass( 'is-active' );
117        }
118      } );
119
120    }
121  }
122
123  // Called Functions
124  $( function() {
125    isIsIOS();
126    smoothScrollAnchors();
127    openResponsiveMenu();
128    addHeightToFrontPageProject();
129    setColorOnFrontPageService();
130    setColorOnFrontPagePerson();
131    alignSubSubMenu();
132    scrollToTop();
133  } );
134
135  // Window Resize
136  $( window ).resize( function() {
137
138    // Called Functions
139    $( function() {
140      addHeightToFrontPageProject();
141    } );
142  } );
143
144  // check operating system
145  function iOS_check() {
146    return [
147             'iPad Simulator',
148             'iPhone Simulator',
149             'iPod Simulator',
150             'iPad',
151             'iPhone',
152             'iPod'
153           ].includes(navigator.platform)
154           // iPad on iOS 13 detection
155           || (navigator.userAgent.includes("Mac") && "ontouchend" in document)
156  }
157
158} );

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.