PageSourceSearch

https://emitdelarosa.netlify.app/js/init.js

js emitdelarosa.netlify.app collected 2026-10-03 10:41:57 UTC 4,774 bytes, 188 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2/*
3/* Init JS
4/*
5-----------------------------------------------------------------------------------*/
6
7 jQuery(document).ready(function($) {
8
9/*----------------------------------------------------*/
10/* FitText Settings
11------------------------------------------------------ */
12
13    setTimeout(function() {
14	   $('h1.responsive-headline').fitText(1, { minFontSize: '40px', maxFontSize: '90px' });
15	 }, 100);
16
17
18/*----------------------------------------------------*/
19/* Smooth Scrolling
20------------------------------------------------------ */
21
22   $('.smoothscroll').on('click',function (e) {
23	    e.preventDefault();
24
25	    var target = this.hash,
26	    $target = $(target);
27
28	    $('html, body').stop().animate({
29	        'scrollTop': $target.offset().top
30	    }, 800, 'swing', function () {
31	        window.location.hash = target;
32	    });
33	});
34
35
36/*----------------------------------------------------*/
37/* Highlight the current section in the navigation bar
38------------------------------------------------------*/
39
40	var sections = $("section");
41	var navigation_links = $("#nav-wrap a");
42
43	sections.waypoint({
44
45      handler: function(event, direction) {
46
47		   var active_section;
48
49			active_section = $(this);
50			if (direction === "up") active_section = active_section.prev();
51
52			var active_link = $('#nav-wrap a[href="#' + active_section.attr("id") + '"]');
53
54         navigation_links.parent().removeClass("current");
55			active_link.parent().addClass("current");
56
57		},
58		offset: '35%'
59
60	});
61
62
63/*----------------------------------------------------*/
64/*	Make sure that #header-background-image height is
65/* equal to the browser height.
66------------------------------------------------------ */
67
68   $('header').css({ 'height': $(window).height() });
69   $(window).on('resize', function() {
70
71        $('header').css({ 'height': $(window).height() });
72        $('body').css({ 'width': $(window).width() })
73   });
74
75
76/*----------------------------------------------------*/
77/*	Fade In/Out Primary Navigation
78------------------------------------------------------*/
79
80   $(window).on('scroll', function() {
81
82		var h = $('header').height();
83		var y = $(window).scrollTop();
84      var nav = $('#nav-wrap');
85
86	   if ( (y > h*.20) && (y < h) && ($(window).outerWidth() > 768 ) ) {
87	      nav.fadeOut('fast');
88	   }
89      else {
90         if (y < h*.20) {
91            nav.removeClass('opaque').fadeIn('fast');
92         }
93         else {
94            nav.addClass('opaque').fadeIn('fast');
95         }
96      }
97
98	});
99
100
101/*----------------------------------------------------*/
102/*	Modal Popup
103------------------------------------------------------*/
104
105    $('.item-wrap a').magnificPopup({
106
107       type:'inline',
108       fixedContentPos: false,
109       removalDelay: 200,
110       showCloseBtn: false,
111       mainClass: 'mfp-fade'
112
113    });
114
115    $(document).on('click', '.popup-modal-dismiss', function (e) {
116    		e.preventDefault();
117    		$.magnificPopup.close();
118    });
119
120
121/*----------------------------------------------------*/
122/*	Flexslider
123/*----------------------------------------------------*/
124   $('.flexslider').flexslider({
125      namespace: "flex-",
126      controlsContainer: ".flex-container",
127      animation: 'slide',
128      controlNav: true,
129      directionNav: false,
130      smoothHeight: true,
131      slideshowSpeed: 7000,
132      animationSpeed: 600,
133      randomize: false,
134   });
135
136/*----------------------------------------------------*/
137/*	contact form
138------------------------------------------------------*/
139
140   $('form#contactForm button.submit').click(function() {
141
142      $('#image-loader').fadeIn();
143
144      var contactName = $('#contactForm #contactName').val();
145      var contactEmail = $('#contactForm #contactEmail').val();
146      var contactSubject = $('#contactForm #contactSubject').val();
147      var contactMessage = $('#contactForm #contactMessage').val();
148
149      var data = 'contactName=' + contactName + '&contactEmail=' + contactEmail +
150               '&contactSubject=' + contactSubject + '&contactMessage=' + contactMessage;
151
152      $.ajax({
153
154	      type: "POST",
155	      url: "inc/sendEmail.php",
156	      data: data,
157	      success: function(msg) {
158
159            // Message was sent
160            if (msg == 'OK') {
161               $('#image-loader').fadeOut();
162               $('#message-warning').hide();
163               $('#contactForm').fadeOut();
164               $('#message-success').fadeIn();   
165            }
166            // There was an error
167            else {
168               $('#image-loader').fadeOut();
169               $('#message-warning').html(msg);
170	            $('#message-warning').fadeIn();
171            }
172
173	      }
174
175      });
176      return false;
177   });
178
179
180});
181
182
183
184
185
186
187
188

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.