SpectroGuard / Web /password-checker.html
KapilWaghumbare123's picture
Update Web/password-checker.html
a514eef verified
Raw History Blame Contribute Delete
7.57 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password-checker | SpectroGuard</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
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;
}
.strength-wrapper {
margin-top: 25px;
width: 90%;
margin-left: auto;
margin-right: auto;
}
.strength-bar-bg {
width: 100%;
height: 14px;
background: #ddd;
border-radius: 10px;
overflow: hidden;
}
.strength-bar {
height: 100%;
width: 0%;
transition: width 0.3s ease;
background: red;
}
.strength-label {
margin-top: 8px;
font-weight: 600;
text-align: left;
}
header nav a:hover {
color: #000;
}
.container {
max-width: 750px;
margin: 40px auto;
text-align: center;
padding: 40px;
flex: 1;
}
h1 {
font-size: 42px;
font-weight: 700;
margin-bottom: 18px;
}
p.desc {
font-size: 16px;
color: #555;
margin-bottom: 35px;
}
input {
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: white;
border: none;
border-radius: 10px;
cursor: pointer;
transition: 0.25s;
}
button:hover {
background: #000;
}
.result {
margin-top: 28px;
font-size: 20px;
font-weight: 600;
}
.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: 40%;
object-fit: cover;
}
.contact {
font-weight: 500;
text-align: center;
}
</style>
</head>
<body>
<header>
<h2>SPECTROGUARD</h2>
</header>
<div class="container">
<h1>Password Strength Checker</h1>
<p class="desc">Enter your password below. Our backend AI evaluates structure, entropy and patterns, then returns a strength score from 0 to 100.</p><br>
<input id="PassInput" type="text" placeholder="Enter Password" />
<button onclick="checkPassword()">Check Password Strength</button>
<div class="strength-wrapper">
<div id="frozenNote" style="margin-top: 6px; font-size: 13px; color: #888; display: none;">
Bar is frozen β€” click "Check Password Strength" to update.
</div>
<div class="strength-bar-bg">
<div class="strength-bar" id="strengthBar"></div>
</div>
<div class="strength-label" id="strengthLabel">Strength: –</div>
</div>
<div class="result" id="resultText">Result: –</div>
<div class="extra-info">
Evaluates password resilience using a trained higher-order Markov model, computing bits-per-character entropy from real-world patterns and normalizing it into a precise 0–100 strength score reflecting resistance to modern cracking. </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 bar = document.getElementById("strengthBar");
const label = document.getElementById("strengthLabel");
const result = document.getElementById("resultText");
const input = document.getElementById("PassInput");
input.addEventListener("keydown", (e) => {
if (e.key === "Enter") checkPassword();
});
let frozen = false;
let lastCheckedValue = "";
input.addEventListener("input", () => {
const frozenNote = document.getElementById("frozenNote");
if (frozen && input.value !== lastCheckedValue) {
frozenNote.style.display = "block";
} else {
frozenNote.style.display = "none";
}
});
async function checkPassword() {
const password = input.value;
if (!password) { resetUI(); return; }
frozen = false;
document.getElementById("frozenNote").style.display = "none";
label.textContent = "Checking...";
label.style.color = "#888";
try {
// πŸ”— FIXED: Pointing relative endpoint path to the server container domain root
const res = await fetch("/check_password", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ password })
});
if (!res.ok) throw new Error();
const data = await res.json();
updateUI(data.score, data.label);
lastCheckedValue = password;
frozen = true;
} catch {
label.textContent = "⚠ Server Error β€” Connection could not be established";
label.style.color = "#cc0000";
bar.style.width = "0%";
result.textContent = "Result: –";
}
}
function updateUI(score, strengthLabel) {
bar.style.width = score + "%";
const r = Math.round(255 * (1 - score / 100));
const g = Math.round(200 * (score / 100));
bar.style.background = `rgb(${r}, ${g}, 50)`;
label.style.color = "#1a1a1a";
label.textContent = "Strength: " + strengthLabel;
result.textContent = "Score: " + parseFloat(score).toFixed(2) + " / 100";
}
function resetUI() {
frozen = false;
bar.style.width = "0%";
bar.style.background = "#e55";
label.textContent = "Strength: –";
label.style.color = "#1a1a1a";
result.textContent = "Result: –";
document.getElementById("frozenNote").style.display = "none";
}
</script>
</body>
</html>