all most ready to go

This commit is contained in:
Justin Frasier committed 2026-04-24 19:52:40 -05:00
1 parent a0243b86a5
commit 033b788e93
13 files changed
+210 -99

No files matched your search

Regular → Executable
+80
View File
@@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<title>Admin — Bossier City Phone Directory</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/svg+xml" href="favicon.svg">
<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css?family=PT+Serif');
@@ -135,10 +136,57 @@
@media (max-width: 480px) {
.dept-btn { font-size: 0.8rem; padding: 0.25rem 0.7rem; }
}
/* Login overlay */
#loginOverlay {
position: fixed; inset: 0; z-index: 9999;
background: #1a1a2e;
display: flex; align-items: center; justify-content: center;
}
#loginOverlay.hidden { display: none; }
.login-box {
background: #fff; border-radius: 0.75rem;
padding: 2.5rem 2rem; width: 100%; max-width: 360px;
box-shadow: 0 8px 32px rgba(0,0,0,0.35);
text-align: center;
}
.login-box h2 {
font-size: 1.35rem; font-weight: 700; color: #1a1a2e; margin-bottom: 0.25rem;
}
.login-box p { font-size: 0.88rem; color: #666; margin-bottom: 1.5rem; }
.login-box .form-control {
font-family: 'PT Serif', serif; font-size: 1rem;
border: 1.5px solid #aaccfa; border-radius: 0.4rem;
padding: 0.55rem 0.75rem; text-align: center; letter-spacing: 0.1em;
}
.login-box .form-control:focus {
border-color: #5599e8; box-shadow: 0 0 0 3px rgba(85,153,232,0.2);
}
.login-box .btn-login {
width: 100%; padding: 0.6rem; font-size: 1rem;
background: #aaccfa; border: none; border-radius: 0.4rem;
font-family: 'PT Serif', serif; font-weight: 700; color: #1a1a2e;
margin-top: 0.75rem; cursor: pointer; transition: background 0.15s;
}
.login-box .btn-login:hover { background: #7aacf0; }
#loginError {
color: #c0392b; font-size: 0.85rem; margin-top: 0.6rem; min-height: 1.2em;
}
</style>
</head>
<body>
<!-- ── Login overlay ── -->
<div id="loginOverlay">
<div class="login-box">
<h2>Bossier City Phone Directory</h2>
<p>Admin access required</p>
<input type="password" id="loginPassword" class="form-control" placeholder="Password" autocomplete="current-password">
<button class="btn-login" onclick="submitLogin()">Sign In</button>
<div id="loginError"></div>
</div>
</div>
<!-- ── Folder access modal (shown only when permission is needed) ── -->
<div class="modal fade" id="accessModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
@@ -218,6 +266,38 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script>
// ── Login gate ────────────────────────────────────────────────────────────
const ADMIN_HASH = '7a9c4e2b1f8d3e6a0c5b9d2f4e7a1c3b8d0f2e5a9c6b4d1f7e0a3c8b5d2f9e4a';
async function hashPassword(pw) {
const buf = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(pw));
return Array.from(new Uint8Array(buf)).map(b => b.toString(16).padStart(2,'0')).join('');
}
async function submitLogin() {
const pw = document.getElementById('loginPassword').value;
const hash = await hashPassword(pw);
// Compare against stored hash of P@rr0tvi11e
const target = await hashPassword('P@rr0tvi11e');
if (hash === target) {
sessionStorage.setItem('admin-auth', '1');
document.getElementById('loginOverlay').classList.add('hidden');
} else {
document.getElementById('loginError').textContent = 'Incorrect password. Please try again.';
document.getElementById('loginPassword').value = '';
document.getElementById('loginPassword').focus();
}
}
document.addEventListener('DOMContentLoaded', () => {
if (sessionStorage.getItem('admin-auth') === '1') {
document.getElementById('loginOverlay').classList.add('hidden');
}
document.getElementById('loginPassword').addEventListener('keydown', e => {
if (e.key === 'Enter') submitLogin();
});
});
// ── Department manifest ───────────────────────────────────────────────────
const DEPARTMENTS = {
btbc: [