SpectroGuard / Web /url-checker.html
KapilWaghumbare123's picture
Update Web/url-checker.html
184b896 verified
Raw History Blame Contribute Delete
5.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URL Legitimacy Checker | SpectroGuard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
background: #f6f0f0;
color: #1a1a1a;
}
header {
background:#272727;
padding: 15px 30px;
display: flex;
justify-content: space-between;
align-items: center;
}
header h2 {
font-size: 28px;
font-weight: 600;
letter-spacing: 1px;
color: #ffffff;
}
.container {
max-width: 750px;
margin: 40px auto;
text-align: center;
padding: 40px;
flex: 1;
}
h1 {
font-size: 40px;
font-weight: 700;
margin-bottom: 18px;
}
p.desc {
font-size: 16px;
color: #555;
margin-bottom: 35px;
}
input[type="text"] {
width: 90%;
padding: 16px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 16px;
outline: none;
transition: 0.2s;
}
input:focus {
border-color: #888;
}
button {
margin-top: 20px;
padding: 14px 28px;
font-size: 16px;
background: #2d2d2d;
color: #fff;
border: none;
border-radius: 10px;
cursor: pointer;
transition: 0.25s;
}
button:hover {
background: #000;
}
.result {
margin-top: 28px;
font-size: 20px;
font-weight: 600;
word-wrap: break-word;
}
.extra-info {
margin-top: 40px;
font-size: 15px;
color: #555;
line-height: 1.6;
text-align: left;
}
footer {
background: #202020;
padding: 30px;
color: #ffffff;
}
.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 20px;
margin-bottom: 20px;
}
.footer-item {
display: flex;
gap: 12px;
align-items: center;
}
.footer-item img {
width: 85px;
height: 85px;
border-radius: 50%;
object-fit: cover;
}
.contact {
font-weight: 500;
text-align: center;
}
</style>
</head>
<body>
<header>
<h2>SPECTROGUARD</h2>
</header>
<div class="container">
<h1>URL Legitimacy Checker</h1>
<p class="desc">Enter any website URL. This tool checks whitelist and blacklist entries. If the URL is suspicious, heuristic analysis will be performed by the backend.</p>
<input id="urlInput" type="text" placeholder="Enter website URL..." />
<button onclick="checkURL()">Check URL</button>
<div class="result" id="resultText">Result: –</div>
<div class="extra-info">
This tool evaluates website safety by cross-referencing URLs with trusted and malicious databases, then analyzing structure, keywords, and content heuristically to generate an accurate backend risk score for informed, secure browsing decisions.
</div>
</div>
<footer>
<div class="footer-content">
<div class="footer-item">
<img src="/static/Sir.jpg" alt="Prof. Swapnil Chaudhari">
<span>Prof. Swapnil Chaudhari
<h5>Guide and Instructor</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Pratiksha.jpg" alt="Pratiksha Alhat">
<span>Miss. Pratiksha Alhat
<h5>Connectivity, Training & Testing</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Kapil.jpg" alt="Kapil Waghumbare">
<span>Mr. Kapil Waghumbare
<h5>UI/UX, Model Design & Tool Development</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Shraddha.jpg" alt="Shraddha Gadekar">
<span>Miss. Shraddha Gadekar
<h5>Model Design & Tool Development</h5>
</span>
</div>
</div>
<div class="contact">
Contact us: <a href="https://mail.google.com/mail/?view=cm&to=spectroguard.security@gmail.com&su=SpectroGuard%20Inquiry" target="_blank" style="color: #1877F2;">spectroguard.security@gmail.com</a>
</div>
</footer>
<script>
const resultEl = document.getElementById("resultText");
async function checkURL() {
const url = document.getElementById("urlInput").value.trim();
if (!url) { resultEl.textContent = "Result: Please enter a URL"; return; }
resultEl.textContent = "Analyzing...";
resultEl.style.color = "#888";
try {
// πŸ”— FIXED: Uses relative cloud routing endpoint instead of localhost
const res = await fetch("/check_url", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url })
});
if (!res.ok) throw new Error();
const data = await res.json();
// Pass both the model calculation score and backend-enforced status flags
updateUI(data.score, data.status);
} catch {
resultEl.textContent = "⚠ Backend error β€” Connection failed";
resultEl.style.color = "#cc0000";
}
}
function updateUI(score, status) {
// πŸ”— FIXED: Aligns dynamic interface logic perfectly with the app.py evaluation constraints
if (status === "Safe") {
resultEl.textContent = "βœ… Safe URL β€” This link appears legitimate. (Score: " + score + "%)";
resultEl.style.color = "#28a745"; // Green
} else {
resultEl.textContent = "🚨 Not Safe β€” Potential threat detected! (Score: " + score + "%)";
resultEl.style.color = "#cc0000"; // Red
}
}
</script>
</body>
</html>