header fixed

This commit is contained in:
2025-02-19 16:47:53 +05:45
parent e827dc6ccb
commit 799daccb2f
2 changed files with 41 additions and 59 deletions

View File

@ -1,41 +1,3 @@
<!-- Bootstrap CSS (Include if not already added) -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Toast Container (Fixed Position) -->
<div class="position-fixed top-0 end-0 p-3" style="z-index: 1050">
<?php if (isset($_GET['status'])): ?>
<div id="statusToast" class="toast align-items-center text-white bg-<?php echo ($_GET['status'] == 'success' ? 'success' : ($_GET['status'] == 'error' ? 'danger' : 'warning')); ?> border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">
<?php
if ($_GET['status'] == 'success') {
echo "✅ Message sent successfully!";
} elseif ($_GET['status'] == 'error') {
// echo "❌ There was an error sending your message. Please try again.";
echo "❌ There was an error: " . htmlspecialchars($_GET['message']);
} elseif ($_GET['status'] == 'missing_fields') {
echo "⚠️ Please fill in all required fields.";
}
?>
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
<?php $_GET['status'] = null; ?>
<?php endif; ?>
</div>
<!-- Bootstrap JS & Auto Hide Toast Script -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
let statusToast = document.getElementById("statusToast");
if (statusToast) {
let toast = new bootstrap.Toast(statusToast, { delay: 3000 }); // Auto-hide after 3s
toast.show();
}
});
</script>
<!DOCTYPE html>
<html lang="en">
@ -324,4 +286,44 @@
</div>
</div>
</div>
</header>
</header>
<!-- Bootstrap CSS (Include if not already added) -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Toast Container (Fixed Position) -->
<div class="position-fixed top-0 end-0 p-3" style="z-index: 1050">
<?php if (isset($_GET['status'])): ?>
<div id="statusToast" class="toast align-items-center text-white bg-<?php echo ($_GET['status'] == 'success' ? 'success' : ($_GET['status'] == 'error' ? 'danger' : 'warning')); ?> border-0 show" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body">
<?php
if ($_GET['status'] == 'success') {
echo "✅ Message sent successfully!";
} elseif ($_GET['status'] == 'error') {
// echo "❌ There was an error sending your message. Please try again.";
echo "❌ There was an error: " . htmlspecialchars($_GET['message']);
} elseif ($_GET['status'] == 'missing_fields') {
echo "⚠️ Please fill in all required fields.";
}
?>
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
<?php $_GET['status'] = null; ?>
<?php endif; ?>
</div>
<!-- Bootstrap JS & Auto Hide Toast Script -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
let statusToast = document.getElementById("statusToast");
if (statusToast) {
let toast = new bootstrap.Toast(statusToast, { delay: 3000 }); // Auto-hide after 3s
toast.show();
}
});
</script>