PageSourceSearch

https://www.balbiino.ee/wp-content/themes/green-farm-elementor/assets/js/script.js?ver=1790117778

js balbiino.ee collected 2026-10-02 13:01:16 UTC 10,276 bytes, 310 lines download raw bytes

1/* ===============================================
2  OPEN CLOSE Menu
3============================================= */
4
5function green_farm_elementor_open_menu() {
6  jQuery('button.menu-toggle').addClass('close-panal');
7  setTimeout(function(){
8    jQuery('nav#main-menu').show();
9  }, 100);
10
11  return false;
12}
13
14jQuery( "button.menu-toggle").on("click", green_farm_elementor_open_menu);
15
16function green_farm_elementor_close_menu() {
17  jQuery('button.close-menu').removeClass('close-panal');
18  jQuery('nav#main-menu').hide();
19}
20
21jQuery( "button.close-menu").on("click", green_farm_elementor_close_menu);
22
23function green_farm_elementor_search_show() {
24	jQuery(".outer-search").addClass('show');
25	jQuery(".outer-search").fadeIn();
26}
27jQuery( ".search-cont-button").on("click", green_farm_elementor_search_show);
28
29function green_farm_elementor_search_hide() {
30	jQuery(".outer-search").removeClass('show');
31	jQuery(".outer-search").fadeOut();
32}
33jQuery( ".search-cont-button-close").on("click", green_farm_elementor_search_hide);
34
35/* ===============================================
36  TRAP TAB FOCUS ON MODAL MENU
37============================================= */
38
39jQuery('button.close-menu').on('keydown', function (e) {
40
41  if (jQuery("this:focus") && !!e.shiftKey && e.keyCode === 9) {
42  } else if (jQuery("this:focus") && (e.which === 9)) {
43    e.preventDefault();
44    jQuery(this).blur();
45    jQuery('.nav-menu li a:first').focus()
46  }
47});
48
49jQuery('.nav-menu li a:first').on('keydown', function (event) {
50  if (jQuery("this:focus") && !!event.shiftKey && event.keyCode === 9) {
51    event.preventDefault();
52    jQuery(this).blur();
53    jQuery('button.close-menu').focus()
54  }
55});
56
57jQuery(document).ready(function() {
58window.addEventListener('load', (event) => {
59    jQuery(".loader").delay(2000).fadeOut("slow");
60  });
61})
62
63/* ===============================================
64  Scroll Top //
65============================================= */
66
67jQuery(window).scroll(function () {
68  if (jQuery(this).scrollTop() > 100) {
69      jQuery('.scroll-up').fadeIn();
70  } else {
71      jQuery('.scroll-up').fadeOut();
72  }
73});
74
75jQuery('a[href="#tobottom"]').click(function () {
76  jQuery('html, body').animate({scrollTop: 0}, 'slow');
77  return false;
78});
79
80/* ===============================================
81  Sticky Header
82============================================= */
83
84(function( $ ) {
85
86  $(window).scroll(function(){
87      var sticky = $('.sticky-header'),
88      scroll = $(window).scrollTop();
89
90      if (scroll >= 100) sticky.addClass('fixed-header');
91      else sticky.removeClass('fixed-header');
92    });
93  })( jQuery );
94(function( $ ) {
95
96$(window).scroll(function(){
97    var sticky = $('.sticky-header'),
98    scroll = $(window).scrollTop();
99
100    if (scroll >= 100) sticky.addClass('fixed-header');
101    else sticky.removeClass('fixed-header');
102  });
103})( jQuery );
104
105/* ===============================================
106  Search pop up
107============================================= */
108
109jQuery('.search-cont-button-close').on('keydown', function (es) {
110  if (jQuery("this:focus") && (es.which === 9)) {
111    es.preventDefault();
112    jQuery(this).blur();
113    jQuery('.inner-search form input').focus();
114  }
115});
116
117jQuery('.inner-search form input').on('keydown', function (eventser) {
118  if (eventser.shiftKey && eventser.keyCode == 9) {
119    eventser.preventDefault();
120    jQuery(this).blur();
121    jQuery('.search-cont-button-close').focus()
122  }
123});
124
125 /* ===============================================
126  Custom Cursor
127============================================= */
128
129const green_farm_elementor_customCursor = {
130  init: function () {
131    this.green_farm_elementor_customCursor();
132  },
133  isVariableDefined: function (el) {
134    return typeof el !== "undefined" && el !== null;
135  },
136  select: function (selectors) {
137    return document.querySelector(selectors);
138  },
139  selectAll: function (selectors) {
140    return document.querySelectorAll(selectors);
141  },
142  green_farm_elementor_customCursor: function () {
143    const green_farm_elementor_cursorDot = this.select(".cursor-point");
144    const green_farm_elementor_cursorOutline = this.select(".cursor-point-outline");
145    if (this.isVariableDefined(green_farm_elementor_cursorDot) && this.isVariableDefined(green_farm_elementor_cursorOutline)) {
146      const cursor = {
147        delay: 8,
148        _x: 0,
149        _y: 0,
150        endX: window.innerWidth / 2,
151        endY: window.innerHeight / 2,
152        cursorVisible: true,
153        cursorEnlarged: false,
154        $dot: green_farm_elementor_cursorDot,
155        $outline: green_farm_elementor_cursorOutline,
156
157        init: function () {
158          this.dotSize = this.$dot.offsetWidth;
159          this.outlineSize = this.$outline.offsetWidth;
160          this.setupEventListeners();
161          this.animateDotOutline();
162        },
163
164        updateCursor: function (e) {
165          this.cursorVisible = true;
166          this.toggleCursorVisibility();
167          this.endX = e.clientX;
168          this.endY = e.clientY;
169          this.$dot.style.top = `${this.endY}px`;
170          this.$dot.style.left = `${this.endX}px`;
171        },
172
173        setupEventListeners: function () {
174          window.addEventListener("load", () => {
175            this.cursorEnlarged = false;
176            this.toggleCursorSize();
177          });
178
179          green_farm_elementor_customCursor.selectAll("a, button").forEach((el) => {
180            el.addEventListener("mouseover", () => {
181              this.cursorEnlarged = true;
182              this.toggleCursorSize();
183            });
184            el.addEventListener("mouseout", () => {
185              this.cursorEnlarged = false;
186              this.toggleCursorSize();
187            });
188          });
189
190          document.addEventListener("mousedown", () => {
191            this.cursorEnlarged = true;
192            this.toggleCursorSize();
193          });
194          document.addEventListener("mouseup", () => {
195            this.cursorEnlarged = false;
196            this.toggleCursorSize();
197          });
198
199          document.addEventListener("mousemove", (e) => {
200            this.updateCursor(e);
201          });
202
203          document.addEventListener("mouseenter", () => {
204            this.cursorVisible = true;
205            this.toggleCursorVisibility();
206            this.$dot.style.opacity = 1;
207            this.$outline.style.opacity = 1;
208          });
209
210          document.addEventListener("mouseleave", () => {
211            this.cursorVisible = false;
212            this.toggleCursorVisibility();
213            this.$dot.style.opacity = 0;
214            this.$outline.style.opacity = 0;
215          });
216        },
217
218        animateDotOutline: function () {
219          this._x += (this.endX - this._x) / this.delay;
220          this._y += (this.endY - this._y) / this.delay;
221          this.$outline.style.top = `${this._y}px`;
222          this.$outline.style.left = `${this._x}px`;
223
224          requestAnimationFrame(this.animateDotOutline.bind(this));
225        },
226
227        toggleCursorSize: function () {
228          if (this.cursorEnlarged) {
229            this.$dot.style.transform = "translate(-50%, -50%) scale(0.75)";
230            this.$outline.style.transform = "translate(-50%, -50%) scale(1.6)";
231          } else {
232            this.$dot.style.transform = "translate(-50%, -50%) scale(1)";
233            this.$outline.style.transform = "translate(-50%, -50%) scale(1)";
234          }
235        },
236
237        toggleCursorVisibility: function () {
238          if (this.cursorVisible) {
239            this.$dot.style.opacity = 1;
240            this.$outline.style.opacity = 1;
241          } else {
242            this.$dot.style.opacity = 0;
243            this.$outline.style.opacity = 0;
244          }
245        },
246      };
247      cursor.init();
248    }
249  },
250};
251green_farm_elementor_customCursor.init(); 
252
253/* ===============================================
254  Progress Bar
255============================================= */
256const green_farm_elementor_progressBar = {
257  init: function () {
258      let green_farm_elementor_progressBarDiv = document.getElementById("elemento-progress-bar");
259
260      if (green_farm_elementor_progressBarDiv) {
261          let green_farm_elementor_body = document.body;
262          let green_farm_elementor_rootElement = document.documentElement;
263
264          window.addEventListener("scroll", function (event) {
265              let green_farm_elementor_winScroll = green_farm_elementor_body.scrollTop || green_farm_elementor_rootElement.scrollTop;
266              let green_farm_elementor_height =
267              green_farm_elementor_rootElement.scrollHeight - green_farm_elementor_rootElement.clientHeight;
268              let green_farm_elementor_scrolled = (green_farm_elementor_winScroll / green_farm_elementor_height) * 100;
269              green_farm_elementor_progressBarDiv.style.width = green_farm_elementor_scrolled + "%";
270          });
271      }
272  },
273};
274green_farm_elementor_progressBar.init();
275
276/* ===============================================
277   sticky copyright
278============================================= */
279
280window.addEventListener('scroll', function() {
281  var green_farm_elementor_footer = document.querySelector('.sticky-copyright');
282  if (!green_farm_elementor_footer) return; 
283
284  var green_farm_elementor_scrollTop = window.scrollY || document.documentElement.green_farm_elementor_scrollTop;
285
286  if (green_farm_elementor_scrollTop >= 100) {
287    green_farm_elementor_footer.classList.add('active-sticky');
288  }
289});
290
291/* ===============================================
292   sticky sidebar
293============================================= */
294
295window.addEventListener('scroll', function () {
296  var green_farm_elementor_sidebar = document.querySelector('.sidebar-sticky');
297  if (!green_farm_elementor_sidebar) return;
298
299  var green_farm_elementor_scrollTop = window.scrollY || document.documentElement.scrollTop;
300  var green_farm_elementor_windowHeight = window.innerHeight;
301  var green_farm_elementor_documentHeight = document.documentElement.scrollHeight;
302
303  var green_farm_elementor_isBottom = green_farm_elementor_scrollTop + green_farm_elementor_windowHeight >= green_farm_elementor_documentHeight - 100;
304
305  if (green_farm_elementor_scrollTop >= 100 && !green_farm_elementor_isBottom) {
306    green_farm_elementor_sidebar.classList.add('sidebar-fixed');
307  } else {
308    green_farm_elementor_sidebar.classList.remove('sidebar-fixed');
309  }
310});

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.