-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
21 lines (18 loc) · 894 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('form');
const loaderContainer = document.querySelector('.loader-container');
const inputField = document.getElementById('link');
inputField.addEventListener('keydown', function (event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent form submission
const input = inputField.value.trim();
if (input !== '') {
loaderContainer.classList.add('show-animation'); // Show animation
// Simulate loading for demonstration purposes
setTimeout(function () {
loaderContainer.classList.remove('show-animation'); // Hide animation
}, 3000); // Adjust the time according to your actual loading time
}
}
});
});