Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toast functionality and contact section UI done #456

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 46 additions & 36 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ <h3>Call Us</h3>
</div>
</div>
<div class="text-center">
<button type="submit">Send Message</button>
<button type="submit" onclick=SendMail()>Send Message</button>
</div>
</form>
</div>
Expand Down Expand Up @@ -1478,42 +1478,52 @@ <h3 class="chatbox__title">Eduhub Community 24/7</h3>
}
</script>

<!-- Toastify library for successfull sending of email message -->
<script>
function SendMail() {
var name = document.getElementById('name').value;
var email = document.getElementById('email').value;
var subject = document.getElementById('subject').value;
var message = document.getElementById('message').value;

if (name === '' || email === '' || subject === '' || message === '') {
showToast('Please fill in all fields.', 'error');
return false;
}

var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!email.match(emailRegex)) {
showToast('Please enter a valid email address.', 'error');
return false;
}

showToast('Your message has been sent successfully!', 'success');

document.getElementById('name').value = '';
document.getElementById('email').value = '';
document.getElementById('subject').value = '';
document.getElementById('message').value = '';

return true;
}

function showToast(message, type) {
var toast = document.createElement('div');
toast.className = 'toast ' + type;
toast.textContent = message;

document.body.appendChild(toast);

setTimeout(function () {
toast.classList.add('show');
setTimeout(function () {
toast.classList.remove('show');
document.body.removeChild(toast);
}, 3000); // Adjust the duration (in milliseconds) as needed
}, 100);
}
</script>

<!-- SEO SETTINGS -->
<script type="application/ld+json">
{
"@context": "https://eduhubcommunity.tech/",
"@type": "WebSite",
"name": "EduHub Community",
"description": "EduHub Community, community for learners by learners",
"url": "https://eduhubcommunity.tech/",
"image": "https://eduhubcommunity.tech/assets/img/Eduhub%20Logo%20(2).png",
"author": {
"@type": "Person",
"name": "SurajPratap10"
},
"publisher": {
"@type": "Organization",
"name": "IMAGINE-AI",
"logo": {
"@type": "ImageObject",
"url": "https://eduhubcommunity.tech/assets/img/Eduhub%20Logo%20(2).png"
}
},
"datePublished": "2023-06-08"
}
</script>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(function () {

$('#seo').load('/assets/html/main_seo.html');

});
</script>


</body>

</html>
43 changes: 40 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,9 @@ section {
text-align: center;
box-shadow: 0 0 30px rgba(214, 215, 216, 0.6);
padding: 20px 0 30px 0;
background: #fff;
border-radius: 8px;
background: #e2e5fe;

}

.contact .info-box i {
Expand All @@ -1449,7 +1451,8 @@ section {
.contact .javascript-email-form {
box-shadow: 0 0 30px rgba(214, 215, 216, 0.6);
padding: 30px;
background: #fff;
border-radius: 8px;
background: #e2e5fe;
}

.contact .javascript-email-form .error-message {
Expand Down Expand Up @@ -1503,15 +1506,19 @@ section {

.contact .javascript-email-form input:focus,
.contact .javascript-email-form textarea:focus {
border-color: #8ea5ca;
border-color: #3b4ef8;
}

.contact .javascript-email-form input {
padding: 10px 15px;
background-color: #e2e5fe;
border-color: #8ea5ca;
}

.contact .javascript-email-form textarea {
padding: 12px 15px;
background-color: #e2e5fe;
border-color: #8ea5ca;
}

.contact .javascript-email-form button[type="submit"] {
Expand All @@ -1526,6 +1533,36 @@ section {
.contact .javascript-email-form button[type="submit"]:hover {
background: #0a22f6;
}
.toast {
visibility: hidden;
min-width: 250px;
margin-left: -125px;
color: #fff;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
left: 50%;
bottom: 30px;
transform: translateX(-20%);
font-size: 17px;
z-index: 9999;
opacity: 0;
transition: opacity 0.3s;
}

.toast.success {
background-color: #38c172;
}

.toast.error {
background-color: #ff4b5a;
}

.toast.show {
visibility: visible;
opacity: 1;
}

@-webkit-keyframes animate-loading {
0% {
Expand Down