Ai That Keeps You Cyber Safe
/* Query AI Box Styling */
#query-ai-box {
max-width: 600px;
margin: auto;
text-align: center;
}
/* Textarea */
#query-ai-box textarea {
width: 100%;
padding: 12px;
border-radius: 8px;
border: 1px solid #ccc;
resize: none;
font-size: 14px;
}
/* ✅ NEW GREEN BUTTON STYLE */
#query-ai-box button {
width: 100%;
background: #2ea44f; /* green color similar to your image */
color: #fff;
border: none;
padding: 14px;
border-radius: 30px; /* rounded pill shape */
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.25s ease;
}
/* Hover effect */
#query-ai-box button:hover {
background: #249944;
}
/* Active click effect */
#query-ai-box button:active {
transform: scale(0.98);
}
function scanContent() {
const input = document.getElementById("queryInput").value.trim();
const result = document.getElementById("result");
if (!input) {
result.innerHTML = "Please enter a link.";
result.style.color = "orange";
return;
}
result.innerHTML = "🔍 Scanning...";
result.style.color = "#ccc";
fetch("/wp-admin/admin-ajax.php", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "action=query_ai_scan&input=" + encodeURIComponent(input)
})
.then(res => {
if (!res.ok) throw new Error("HTTP error " + res.status);
return res.json();
})
.then(data => {
let ctaText = "🔐 Sign-In to find out more about this result";
if (data.success && data.data.status === "unsafe") {
ctaText = "⚠️ View full threat breakdown (Sign-In)";
} else if (data.success && data.data.status === "clean") {
ctaText = "🔍 View detailed safety report (Sign-In)";
}
const loginCTA = `
${ctaText} `; if (!data.success) { result.innerHTML = "⚠️ Error: " + data.data + loginCTA; result.style.color = "orange"; return; } if (data.data.status === "unsafe") { result.innerHTML = "❌ Unsafe (" + data.data.sources.join(" & ") + ")" + loginCTA; result.style.color = "red"; } else { result.innerHTML = "✅ Safe" + loginCTA; result.style.color = "green"; } }) .catch(err => { console.error(err); result.innerHTML = "❌ Error scanning content.
Please try again later."; result.style.color = "red"; }); }
${ctaText} `; if (!data.success) { result.innerHTML = "⚠️ Error: " + data.data + loginCTA; result.style.color = "orange"; return; } if (data.data.status === "unsafe") { result.innerHTML = "❌ Unsafe (" + data.data.sources.join(" & ") + ")" + loginCTA; result.style.color = "red"; } else { result.innerHTML = "✅ Safe" + loginCTA; result.style.color = "green"; } }) .catch(err => { console.error(err); result.innerHTML = "❌ Error scanning content.
Please try again later."; result.style.color = "red"; }); }
