PageSourceSearch

https://www.plantareducacao.com.br/wp-content/themes/plantar2023/js/javascript1.js?ver=0210

js plantareducacao.com.br collected 2026-10-06 02:36:07 UTC 20,462 bytes, 526 lines download raw bytes

1function el(el){
2return document.querySelectorAll(el)
3}
4/*=========================================
5// 
6=========================================*/
7var cleanerIMG = '&quality=100&ssl=1';
8/*=========================================
9// lazy src_img
10=========================================*/
11document.addEventListener("DOMContentLoaded", function () {
12	var imgItems = [].slice.call(el('.src'));
13	if ("IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype) {
14		let imgItemObserver = new IntersectionObserver(function (entries, observer) {
15			entries.forEach(function (src) {
16				if (src.isIntersecting) {
17					if (src.target.getAttribute('data-src')) {
18						var width = src.target.parentElement.offsetWidth;
19						var extension = src.target.getAttribute('data-src').split('.').pop();
20						var src_imgSRC = src.target.getAttribute('data-src') + '?w=' + width + cleanerIMG;
21						src.target.setAttribute("src", src_imgSRC);
22						if (extension === 'jpg' || extension === 'png') {
23							src.target.src = src.target.src.replace("https://", "https://i2.wp.com/");
24						}
25						src.target.removeAttribute('data-src');
26						src.target.classList.remove("src");
27					}
28					imgItemObserver.unobserve(src.target);
29				}
30			});
31		});
32		imgItems.forEach(function (imgItem) {
33			imgItemObserver.observe(imgItem);
34		});
35	}
36});
37/* =================================================
38 //  laxy cdn bg
39==================================================*/
40var bg = [];
41registerListener('load', setBg);
42registerListener('load', bgLoad);
43registerListener('scroll', bgLoad);
44registerListener('resize', bgLoad);
45function setBg() {
46	bg = el('.bg');
47	console.log('Found ' + bg.length + ' bg images');
48}
49function bgLoad() {
50	for (var i = 0; i < bg.length; i++) {
51		if (isInViewport(bg[i])) {
52			if (bg[i].getAttribute('data-bg')) {
53				var height = bg[i].offsetHeight;
54				var width = bg[i].offsetWidth;
55				var background = bg[i].getAttribute('data-bg') + '?w=' + width + cleanerIMG;
56				var background = background.replace("https://", "https://i2.wp.com/");
57				bg[i].style.backgroundImage = 'url(' + background + ')';
58				bg[i].removeAttribute('data-bg');
59			}
60		}
61	}
62	cleanBg();
63}
64function cleanBg() {
65	bg = Array.prototype.filter.call(bg, function (l) {
66		return l.getAttribute('data-bg');
67	});
68}
69/* =================================================
70 //  autoplay video
71==================================================*/
72document.addEventListener("DOMContentLoaded", function () {
73	var autoplays = [].slice.call(el('.autoplay'));
74	if ("IntersectionObserver" in window) {
75		let autoplayObserver = new IntersectionObserver(function (entries, observer) {
76			entries.forEach(function (entry) {
77				if (entry.isIntersecting) {
78					let autoplay = entry.target;
79					autoplay.play();
80					autoplay.setAttribute("loop", "");
81					autoplay.setAttribute("muted", "");
82					autoplay.setAttribute("volume", "0");
83					autoplay.setAttribute("preload", "auto");
84					autoplayObserver.unobserve(autoplay);
85				}
86			});
87		});
88		autoplays.forEach(function (autoplay) {
89			autoplayObserver.observe(autoplay);
90		});
91	}
92});
93/* =================================================
94 //  lazy iframe
95==================================================*/
96document.addEventListener("DOMContentLoaded", function () {
97	var lazyIframes = [].slice.call(el('.iframe'));
98	if ("IntersectionObserver" in window) {
99		let lazyIframeObserver = new IntersectionObserver(function (entries, observer) {
100			entries.forEach(function (entry) {
101				if (entry.isIntersecting) {
102					let lazyIframe = entry.target;
103					var src = lazyIframe.getAttribute('data-src');
104					lazyIframe.setAttribute("src", src);
105					lazyIframe.outerHTML = lazyIframe.outerHTML.replace(/aside/g, "iframe");
106					lazyIframe.classList.remove("iframe");
107					lazyIframeObserver.unobserve(lazyIframe);
108				}
109			});
110		});
111		lazyIframes.forEach(function (lazyIframe) {
112			lazyIframeObserver.observe(lazyIframe);
113		});
114	}
115});
116/*=========================================
117// lazy inspect
118=========================================*/
119var inspect = [];
120registerListener('load', setInvertInspect);
121registerListener('load', inspectLoad);
122registerListener('scroll', inspectLoad);
123registerListener('resize', inspectLoad);
124function setInvertInspect() {
125	inspect = el('.inspect');
126	console.log('Found ' + inspect.length + ' inspect');
127}
128function inspectLoad() {
129	for (var i = 0; i < inspect.length; i++) {
130		if (isInViewport(inspect[i])) {
131			if (inspect[i].getAttribute('data-delay')) {
132				var inspectSRC = inspect[i].getAttribute('data-delay');
133				inspect[i].style.transitionDelay = inspectSRC + "s";
134				inspect[i].removeAttribute('data-delay');
135				inspect[i].classList.add("in");
136			} else {
137				inspect[i].style.transitionDelay = ".1s";
138				inspect[i].classList.add("in");
139			}
140		}
141	}
142}
143/*=========================================
144//	isInViewport
145=========================================*/
146function isInViewport(el) {
147	var rect = el.getBoundingClientRect();
148	return (
149		rect.bottom >= 0 &&
150		rect.right >= 0 &&
151		rect.top <= (window.innerHeight+150 || document.documentElement.clientHeight+150) &&
152		rect.left <= (window.innerWidth || document.documentElement.clientWidth)
153	);
154}
155function registerListener(event, func) {
156	if (window.addEventListener) {
157		window.addEventListener(event, func)
158	} else {
159		window.attachEvent('on' + event, func)
160	}
161}
162function doWork(){return navigator.userAgent.indexOf("Chrome-Lighthouse")>-1}
163/*=========================================
164//		slide
165=========================================*/
166document.addEventListener('readystatechange', event => { 
167if (event.target.readyState === "complete") {
168if (document.body.classList.contains('admin-bar')) {} else {
169if (window.matchMedia("(min-width: 992px)").matches) {
170el('.hmd').forEach(md => {md.remove();});
171};
172if (window.matchMedia("(min-width: 768px) and (max-width: 991px)").matches) {
173el('.hsm').forEach(sm => {sm.remove();});
174};
175if (window.matchMedia("(max-width: 767px)").matches) {
176el('.hxs').forEach(xs => {xs.remove();});
177};
178el("img").forEach(IMG => {
179if (!IMG.hasAttribute("width")) {
180IMG.setAttribute("width", IMG.parentElement.offsetWidth);
181}
182if (!IMG.hasAttribute("height")) {
183IMG.setAttribute("height", IMG.parentElement.offsetHeight);
184}
185}
185);
186}
187
188	
189}
190});
191window.onload = function () {
192	document.body.classList.add('load');
193};
194/*=========================================
195//		video
196=========================================*/	
197var btnPlay = document.querySelectorAll('[data-video]');
198for (i = 0; i < btnPlay.length; i++) btnPlay[i].addEventListener('click', function() {
199		var iframe = document.createElement('iframe');
200		iframe.setAttribute('src', 'https://www.youtube-nocookie.com/embed/' + this.getAttribute('data-video') + '?controls=0&amp;showinfo=0&amp;autoplay=1');
201		iframe.setAttribute('allow', 'autoplay;encrypted-media');
202		iframe.setAttribute('allowfullscreen', '');
203		document.getElementById('video-container').appendChild(iframe);
204		document.getElementById('video').classList.add('active');
205});
206function videoClose(){
207	document.getElementById('video').classList.remove('active');
208	document.getElementById('video-container').innerHTML='';
209}
210
211/*=========================================
212//		btn-black
213=========================================*/
214	document.querySelectorAll('.btn-black').forEach((element) => {
215		element.insertAdjacentHTML('beforeend', '<svg class="fill-green" viewBox="0 0 10.03 16.44"><path d="M.55,.24L.25,.53c-.33,.31-.33,.82,0,1.14l6.81,6.47c.05,.05,.05,.13,0,.18L.25,14.77c-.33,.31-.33,.82,0,1.13l.31,.29c.33,.32,.87,.32,1.2,0l8.2-7.8c.11-.1,.11-.27,0-.37L1.75,.24c-.33-.31-.87-.31-1.2,0Z" /></svg>');
216	});
217/*==================================*/
218//		WA
219/*==================================*/
220!function(a){var b=/iPhone/i,c=/iPod/i,d=/iPad/i,e=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,f=/Android/i,g=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,h=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,i=/IEMobile/i,j=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,k=/BlackBerry/i,l=/BB10/i,m=/Opera Mini/i,n=/(CriOS|Chrome)(?=.*\bMobile\b)/i,o=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,p=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),q=function(a,b){return a.test(b)},r=function(a){var r=a||navigator.userAgent,s=r.split("[FBAN");return"undefined"!=typeof s[1]&&(r=s[0]),s=r.split("Twitter"),"undefined"!=typeof s[1]&&(r=s[0]),this.apple={phone:q(b,r),ipod:q(c,r),tablet:!q(b,r)&&q(d,r),device:q(b,r)||q(c,r)||q(d,r)},this.amazon={phone:q(g,r),tablet:!q(g,r)&&q(h,r),device:q(g,r)||q(h,r)},this.android={phone:q(g,r)||q(e,r),tablet:!q(g,r)&&!q(e,r)&&(q(h,r)||q(f,r)),device:q(g,r)||q(h,r)||q(e,r)||q(f,r)},this.windows={phone:q(i,r),tablet:q(j,r),device:q(i,r)||q(j,r)},this.other={blackberry:q(k,r),blackberry10:q(l,r),opera:q(m,r),firefox:q(o,r),chrome:q(n,r),device:q(k,r)||q(l,r)||q(m,r)||q(o,r)||q(n,r)},this.seven_inch=q(p,r),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window?this:void 0},s=function(){var a=new r;return a.Class=r,a};"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=r:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?module.exports=s():"function"==typeof define&&define.amd?define("isMobile",[],a.isMobile=s()):a.isMobile=s()}(this);
221var link = isMobile.any ? 'api' : 'web';
222var search = "linkwhats";
223var whatsLink = el('a.wa');
224for (var i = 0; i < whatsLink.length; i++) {whatsLink[i].outerHTML = whatsLink[i].outerHTML.replace(/linkwhats/g, link);}
225/*==================================*/
226//		import
227/*==================================*/
228var lastScroll = 0;
229window.onscroll = function () {
230	mainFunction();
231	if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
232		document.body.classList.add('end');
233	} else {
234		document.body.classList.remove('end');
235	}
236};
237
238
239function mainFunction() {
240	if (document.body.scrollTop > 120 || document.documentElement.scrollTop > 120) {
241		document.body.classList.add("active");
242	} 
243	if (document.body.scrollTop > 50 || document.documentElement.scrollTop < 50) {
244		document.body.classList.remove("active");
245	}
246};
247if (window.performance) {
248	//console.info(performance.navigation.type);
249	if (performance.navigation.type == performance.navigation.TYPE_RELOAD) {
250		 mainFunction();
251		//console.info( "This page is reloaded" );
252	}
253}
254
255var elements = document.querySelectorAll('aside.aside');
256for (var i = 0; i < elements.length; i++) {
257	elements[i].addEventListener('click', (function (i) {
258		return function () {
259			if (!(this).hasAttribute("method")) {
260				(this).setAttribute("method", "post");
261			}
262			if (!(this).hasAttribute("action")) {
263				(this).setAttribute("action", "");
264			}
265			(this).outerHTML = (this).outerHTML.replace(/aside/g, "form");
266		};
267	})(i), false);
268}
269for (var i = 0; i < elements.length; i++) {
270	elements[i].addEventListener('mouseover', (function (i) {
271		return function () {
272			if (!(this).hasAttribute("method")) {
273				(this).setAttribute("method", "post");
274			}
275			if (!(this).hasAttribute("action")) {
276				(this).setAttribute("action", "");
277			}
278			(this).outerHTML = (this).outerHTML.replace(/aside/g, "form");
279		};
280	})(i), false);
281}
282
283var elements = document.querySelectorAll('form.aside');
284for (var i = 0; i < elements.length; i++) {
285	elements[i].addEventListener('click', (function (i) {
286		return function () {
287			
288			if (!(this).hasAttribute("method")) {
289				(this).setAttribute("method", "post");
290			}
291			if (!(this).hasAttribute("action")) {
292				(this).setAttribute("action", "");
293			}
294			
295			const check = elements[i].querySelector('[type="submit"]');
296			check.setAttribute('name', "test_form");
297			check.setAttribute('value', "none");
298			elements[i].classList.remove("aside");
299		};
300	})(i), false);
301}
302
303for (var i = 0; i < elements.length; i++) {
304	elements[i].addEventListener('mouseover', (function (i) {
305		return function () {
306			if (!(this).hasAttribute("method")) {
307				(this).setAttribute("method", "post");
308			}
309			const check = elements[i].querySelector('[type="submit"]');
310			check.setAttribute('name', "test_form");
311			check.setAttribute('value', "none");
312			elements[i].classList.remove("aside");
313		};
314	})(i), false);
315}
316
317/*=========================================
318//		
319=========================================*/	
320var iframa_opacity = document.querySelectorAll('.video-container');
321for (var i = 0; i < iframa_opacity.length; i++) {
322	iframa_opacity[i].addEventListener('click', (function (i) {
323		return function () {
324			document.querySelectorAll('iframe.iframe').forEach((element) => {
325				document.querySelector('iframe.iframe').classList.remove('iframe');
326			});
327		};
328	})(i), false);
329}
330for (var i = 0; i < iframa_opacity.length; i++) {
331	iframa_opacity[i].addEventListener('mouseover', (function (i) {
332		return function () {
333			document.querySelectorAll('iframe.iframe').forEach((element) => {
334				document.querySelector('iframe.iframe').classList.remove('iframe');
335			});
336		};
337	})(i), false);
338}
339/*=========================================
340//	menu
341=========================================*/
342var openMenu = document.querySelectorAll('.open-menu');
343for (var i = 0; i < openMenu.length; i++) {
344	openMenu[i].addEventListener('click', (function (i) {
345		return function () {
346			(this).classList.toggle("active")
347			document.body.classList.toggle("active-menu");
348		};
349	})(i), false);
350}
351var hasChildren = document.querySelectorAll('.menu-item-has-children');
352for (var index = 0; index < hasChildren.length; index++) {
353	hasChildren[index].addEventListener('click', function () {
354		this.classList.toggle("active");
355	});
356};
357
358var cbox = document.querySelectorAll(".sidemenu a");
359cbox.forEach((button) => {
360	button.addEventListener('click', () => {
361		document.body.classList.remove('active-menu');
362	});
363});
364
365document.querySelectorAll('.video-container span.play').forEach((play) => {
366	play.innerHTML='<svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg>';
367});
368/*=========================================
369//		
370=========================================*/
371if (!document.body.classList.contains('admin-bar')) {
372	var alink = document.querySelectorAll('header a,main a');
373	for (var i = 0; i < alink.length; i++) {
374		alink[i].addEventListener('mouseover', (function (i) {
375			return function () {
376				var firstprefetch = document.querySelector('[rel="prefetch"]');
377				if(typeof(element) != 'undefined' && element != null){
378						firstprefetch.remove();
379						document.querySelectorAll('[rel="prerender"]').remove();
380				}
381				var h=(this).getAttribute('href');
382				var prefetch = document.createElement('link');
383				prefetch.setAttribute('rel', 'prefetch');
384				prefetch.setAttribute('as', 'document');
385				prefetch.setAttribute('crossorigin', 'use-credentials');
386				prefetch.setAttribute('href', h);
387				document.head.appendChild(prefetch);
388				var prerender = document.createElement('link');
389				prerender.setAttribute('rel', 'prerender');
390				prerender.setAttribute('href', h);
391				document.head.appendChild(prerender);
392			};
393		})(i), false);
394	}
395}
396document.querySelector(".data-href").onmouseover = function(e) {e.preventDefault();document.querySelector('.data-href img').setAttribute('alt', 'logo');for (var i = this.attributes.length; i-- > 0;)this.removeAttributeNode(this.attributes[i]);};
397/*=========================================
398//		cookie Consent
399=========================================*/
400var myEle = document.getElementById("cookieConsentContainer");
401if(myEle){null==localStorage.getItem("cookiesprivacy")&&document.getElementById("cookieConsentContainer").classList.remove("hidden");}
402
403if (document.body.classList.contains('single-post')||document.body.classList.contains('page-id-15')) {
404	
405var dataShare = document.querySelectorAll(".data-share");
406dataShare.forEach(item => {
407	item.addEventListener('click', event => {
408		document.getElementById('share-icons').classList.toggle('active');
409		if(item.getAttribute('data-link')){
410			
411			document.querySelectorAll(".social_share").forEach(p => {
412				p.setAttribute('data-url', item.getAttribute('data-link'));
413			});
414		}
415	})
416});
417document.getElementById('share-icons').addEventListener('click', event => {
418	document.getElementById('share-icons').classList.toggle('active');
419})
420	
421import ('./single-post.js');
422document.addEventListener("DOMContentLoaded", function(event) {
423var shareItems = document.querySelectorAll('.social_share');
424var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) ||
425(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
426var isAndroid = /(android)/i.test(navigator.userAgent);
427var options = {};
428if (isIOS || isAndroid) {
429options.link_telegram = 'tg://msg';
430options.link_whatsapp = 'whatsapp://send';
431}
432for (var i = 0; i < shareItems.length; i += 1) {
433shareItems[i].addEventListener('click', function share(e) {
434console.log(this);
435return JSShare.go(this, options);
436});
437}
438});
439}
440/*=========================================
441//		
442=========================================*/	
443if (document.body.classList.contains('home') ) {
444	const typedTextSpan = document.querySelector(".typed-text");
445	const cursorSpan = document.querySelector(".cursor");
446	const textArray = ["colaboradores", "clientes", "parceiros"];
447	const typingDelay = 200;
448	const erasingDelay = 100;
449	const newTextDelay = 1000;
450	let textArrayIndex = 0;
451	let charIndex = 0;
452
453	function type() {
454		if (charIndex < textArray[textArrayIndex].length) {
455			if (!cursorSpan.classList.contains("typing")) cursorSpan.classList.add("typing");
456			typedTextSpan.textContent += textArray[textArrayIndex].charAt(charIndex);
457			charIndex++;
458			setTimeout(type, typingDelay);
459		} else {
460			cursorSpan.classList.remove("typing");
461			setTimeout(erase, newTextDelay);
462		}
463	}
464
465	function erase() {
466		if (charIndex > 0) {
467			if (!cursorSpan.classList.contains("typing")) cursorSpan.classList.add("typing");
468			typedTextSpan.textContent = textArray[textArrayIndex].substring(0, charIndex - 1);
469			charIndex--;
470			setTimeout(erase, erasingDelay);
471		} else {
472			cursorSpan.classList.remove("typing");
473			textArrayIndex++;
474			if (textArrayIndex >= textArray.length) textArrayIndex = 0;
475			setTimeout(type, typingDelay + 1100);
476		}
477	}
478
479	document.addEventListener("DOMContentLoaded", function() {
480		if (textArray.length) setTimeout(type, newTextDelay + 250);
481	});
482}
483/*=========================================
484//		
485=========================================*/	
486if (document.body.classList.contains('home') || document.body.classList.contains('page-id-10')) {
487		function animateValue(obj, start, end, duration) {
488			let startTimestamp = null;
489			const step = (timestamp) => {
490				if (!startTimestamp) startTimestamp = timestamp;
491				const progress = Math.min((timestamp - startTimestamp) / duration, 1);
492				obj.innerHTML = Math.floor(progress * (end - start) + start);
493				if (progress < 1) {
494					window.requestAnimationFrame(step);
495				}
496			};
497			window.requestAnimationFrame(step);
498		}
499		var observador = new IntersectionObserver(function(entries) {
500			entries.forEach(function(entry) {
501				const {
502					isIntersecting,
503					intersectionRatio
504				} = entry;
505				if (isIntersecting === true || intersectionRatio > 0) {
506					
507					document.querySelectorAll("[data-number]").forEach(p => {
508						animateValue(p, 1, p.getAttribute('data-number'), 1800);
509					});
510					observador.unobserve(entry.target);
511				}
512			});
513		}, {
514			rootMargin: '10px'
515		});
516		observador.observe(document.querySelector('#nossos-numeros'));
517}
518						
519/*
520if (document.body.classList.contains('page-id-8')) {
521var funcItem = document.querySelectorAll(".func-item");
522for(i=0;i<funcItem.length;i++)funcItem[i].addEventListener("click",function(){
523	removeClass(),this.classList.toggle("active");
524});
525function removeClass(){funcItem.forEach(p=>{p.classList.remove('active');});}
526}*/

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.