36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
// Smooth scroll for CTA button
|
|
const ctaButton = document.querySelector('.btn-primary');
|
|
const projectSection = document.getElementById('create-project');
|
|
|
|
if (ctaButton && projectSection) {
|
|
ctaButton.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
projectSection.scrollIntoView({ behavior: 'smooth' });
|
|
});
|
|
}
|
|
|
|
// Form validation
|
|
const projectForm = document.getElementById('projectForm');
|
|
if (projectForm) {
|
|
projectForm.addEventListener('submit', function (e) {
|
|
if (!projectForm.checkValidity()) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
projectForm.classList.add('was-validated');
|
|
}, false);
|
|
}
|
|
|
|
// Show success toast
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
if (urlParams.get('status') === 'success') {
|
|
const successToast = document.getElementById('successToast');
|
|
if (successToast) {
|
|
const toast = new bootstrap.Toast(successToast);
|
|
toast.show();
|
|
}
|
|
}
|
|
});
|