generated from render-examples/fastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2aab14
commit 35afb90
Showing
1 changed file
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,24 @@ | |
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} | ||
|
||
.notification { | ||
position: fixed; | ||
top: 20px; | ||
right: 20px; | ||
background-color: #007bff; | ||
color: white; | ||
padding: 10px 20px; | ||
border-radius: 5px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
z-index: 1000; | ||
opacity: 0; | ||
transition: opacity 0.5s ease-in-out; | ||
} | ||
|
||
.notification.show { | ||
opacity: 1; | ||
} | ||
</style> | ||
</head> | ||
|
||
|
@@ -25,7 +43,7 @@ | |
<div class="col-md-8"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h5 class="card-title text-center">Phishing Website(URL) detection</h5> | ||
<h5 class="card-title text-center">Phishing Website (URL) Detection</h5> | ||
<form id="urlForm"> | ||
<div class="form-group"> | ||
<label for="urlInput">Paste your URL(s) here (comma-separated for multiple URLs)</label> | ||
|
@@ -41,11 +59,29 @@ <h5 class="card-title text-center">Phishing Website(URL) detection</h5> | |
</div> | ||
</div> | ||
|
||
<!-- Notification --> | ||
<div id="notification" class="notification">The page has reloaded.</div> | ||
|
||
<!-- Bootstrap JS and dependencies --> | ||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> | ||
<script> | ||
// Function to show notification | ||
function showNotification(message) { | ||
const notification = document.getElementById('notification'); | ||
notification.innerText = message; | ||
notification.classList.add('show'); | ||
setTimeout(() => { | ||
notification.classList.remove('show'); | ||
}, 3000); | ||
} | ||
|
||
// Show notification on page load | ||
window.onload = function() { | ||
showNotification('The page has reloaded.'); | ||
}; | ||
|
||
document.getElementById('urlForm').addEventListener('submit', async function (event) { | ||
event.preventDefault(); | ||
|
||
|