const mobileScreen = window.matchMedia("(max-width: 990px )");
var $ = jQuery.noConflict();
$(document).ready(function () {
// aosInit();
// mobileMenu();
stickyHeader();
// ourProductsGrid();
// swiperSliderInstance();
// swiperSliderInstance();
// additionalFeaturedImage();
cF7Elementor();
contactForm7Redirect();
disableCf7DoubleSubmit();
product_showcase();
// Responsive functions
if (mobileScreen.matches) {
} else {
}
});
function disableCf7DoubleSubmit() {
// $('.wpcf7-form.submitting .campaign-form.quote-form .wpcf7-submit').on('click', function () {
// $(this).attr("disabled", "disabled");
// });
// document.addEventListener('wpcf7submit', function (event) {
// if ('2463' == event.detail.contactFormId || '2874' == event.detail.contactFormId) {
// alert("The contact form ID is 123.");
// // do something productive
// }
// }, false);
$(".wpcf7 form").on("submit", function () {
const $submitButton = $(this).find('input[type="submit"]');
if ($submitButton.length) {
$submitButton.prop("disabled", true);
}
});
// Re-enable the button on specific Contact Form 7 events
const events = ["wpcf7invalid", "wpcf7spam", "wpcf7mailfailed"];
events.forEach((event) => {
document.addEventListener(event, function (e) {
const $submitButton = $(e.target).find('input[type="submit"]');
if ($submitButton.length) {
$submitButton.prop("disabled", false);
}
});
});
}
function contactForm7Redirect() {
document.addEventListener(
"wpcf7mailsent",
function (event) {
// if ( '2874' == event.detail.contactFormId ) { // Replace '123' with your form ID
// location = 'https://emetrio.com/thank-you/'; // Replace 'http://example.com/thank-you' with your desired redirect URL
// }
location = "https://emetrio.com/thank-you/";
},
false,
);
}
function aosInit() {
AOS.init();
}
function mobileMenu() {
$(".main_menu_container .menu-item-has-children").on("click", function () {
$(this).toggleClass("show-submenu");
});
}
function stickyHeader() {
$(window).scroll(function () {
var scroll = $(window).scrollTop();
if (scroll >= 300) {
$("header").addClass("sticky");
} else {
$("header").removeClass("sticky");
}
});
}
function ourProductsGrid() {
$(".our-products-grid").each(function (index) {
var value = $(this)
.find(".our-products-grid_ecllipse .elementor-heading-title")
.text();
var newValue =
"" +
(index + 1) +
'";
$(this)
.find(".our-products-grid_ecllipse .elementor-heading-title")
.html(newValue);
});
}
function swiperSliderInstance() {
$(window).on("load", function () {
setTimeout(function () {
const swiper_target = $(".product-slider .swiper");
const swiperInstance = swiper_target.data("swiper");
$(
".product-grid .elementor-loop-container.elementor-grid > .elementor.e-loop-item",
).click(function () {
var str = $(this).index();
// console.log(str);
swiperInstance.slideTo(str);
});
}, 500);
});
}
function additionalFeaturedImage() {
var custom_uploader;
$("#upload_image_button").on("click", function (e) {
// e.preventDefault();
if (custom_uploader) {
custom_uploader.open();
return;
}
custom_uploader = wp.media.frames.file_frame = wp.media({
title: "Choose Image",
button: {
text: "Choose Image",
},
multiple: false,
});
custom_uploader.on("select", function () {
var attachment = custom_uploader
.state()
.get("selection")
.first()
.toJSON();
$("#custom_image_id").val(attachment.id);
$("img").attr("src", attachment.url);
});
custom_uploader.open();
});
}
function cF7Elementor1() {
$(document).on("elementor/popup/show", (event, id, instance) => {
$(".elementor-popup-modal form.wpcf7-form:not(.elementor)").each(
(index, formElement) => {
setTimeout(function () {
const $forms = $(".wpcf7 > form");
$forms.each(function () {
wpcf7.init(this);
});
disableCf7DoubleSubmit();
}, 800); // END Timeout.
},
);
});
}
function cF7Elementor() {
$(document).on("elementor/popup/show", (event, id) => {
// console.log('Popup shown with ID:', id);
setTimeout(() => {
const forms = $(".elementor-popup-modal").find(
"form.wpcf7-form:not(.elementor)",
);
if (forms.length === 0) {
// console.warn('No Contact Form 7 forms found in the popup.');
} else {
forms.each((index, formElement) => {
// console.log('Initializing form:', formElement);
if (typeof wpcf7 !== "undefined") {
wpcf7.init(formElement);
$(formElement).addClass("elementor");
// formElement.addEventListener('wpcf7mailsent', function (event) {
// elementorProFrontend.modules.popup.closePopup({}, event);
// if (formElement) {
// wpcf7.reset(formElement);
// formElement = undefined;
// }
// }, false);
disableCf7DoubleSubmit();
} else {
console.error("Contact Form 7 object (wpcf7) not defined.");
}
});
}
}, 1000); // Adjust delay if necessary
});
}
function product_showcase() {
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll(".products-showcase").forEach(function (wrap) {
var tabs = wrap.querySelectorAll(".products-tab");
var cards = wrap.querySelectorAll(".product-card");
console.log('=========>');
tabs.forEach(function (tab) {
tab.addEventListener("click", function () {
var filter = tab.dataset.filter;
tabs.forEach(function (t) {
t.classList.toggle("is-active", t === tab);
});
cards.forEach(function (card) {
card.hidden =
filter !== "all" &&
!card.dataset.categories.split(" ").includes(filter);
});
});
});
});
});
}
<p>The post The Cyber-AI Arms Race: When Models Start Hacking Models first appeared on Emetrio.</p>
]]><p>The post The Cyber-AI Arms Race: When Models Start Hacking Models first appeared on Emetrio.</p>
]]><p>The post The Rise of Vibe Coding: From Syntax to Intent first appeared on Emetrio.</p>
]]><p>The post The Rise of Vibe Coding: From Syntax to Intent first appeared on Emetrio.</p>
]]><p>The post The Rise of the AI “Hive Mind”: Why Agent Orchestration is the Real Story of 2026 first appeared on Emetrio.</p>
]]><p>The post The Rise of the AI “Hive Mind”: Why Agent Orchestration is the Real Story of 2026 first appeared on Emetrio.</p>
]]><p>The post The Death of the Chatbot: Welcome to the Era of Agentic AI first appeared on Emetrio.</p>
]]><p>The post The Death of the Chatbot: Welcome to the Era of Agentic AI first appeared on Emetrio.</p>
]]><p>The post From Solo Acts to Digital Symphonies: The Rise of Agent Orchestration first appeared on Emetrio.</p>
]]><p>The post From Solo Acts to Digital Symphonies: The Rise of Agent Orchestration first appeared on Emetrio.</p>
]]><p>The post The Brain Meets the Body: Inside Google DeepMind’s Gemini Robotics-ER 1.6 first appeared on Emetrio.</p>
]]><p>The post The Brain Meets the Body: Inside Google DeepMind’s Gemini Robotics-ER 1.6 first appeared on Emetrio.</p>
]]><p>The post The Open-Source Revolution: Why Gemma 4 is a Game-Changer for AI first appeared on Emetrio.</p>
]]><p>The post The Open-Source Revolution: Why Gemma 4 is a Game-Changer for AI first appeared on Emetrio.</p>
]]><p>The post Is AI a Bubble? Davos Leaders Just Gave a Very Different Answer first appeared on Emetrio.</p>
]]><p>The post Is AI a Bubble? Davos Leaders Just Gave a Very Different Answer first appeared on Emetrio.</p>
]]><p>The post Ads Are Coming to ChatGPT. Here’s What That Really Means for Creators and Businesses first appeared on Emetrio.</p>
]]><p>The post Ads Are Coming to ChatGPT. Here’s What That Really Means for Creators and Businesses first appeared on Emetrio.</p>
]]><p>The post 🚨 OpenAI Just Launched ChatGPT Health. Should You Trust It With Your Body and Your Data? first appeared on Emetrio.</p>
]]><p>The post 🚨 OpenAI Just Launched ChatGPT Health. Should You Trust It With Your Body and Your Data? first appeared on Emetrio.</p>
]]>