Skip to content

Commit

Permalink
Added js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhcet-07 authored Oct 9, 2024
1 parent 2cbba9f commit 494a048
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
20 changes: 20 additions & 0 deletions public/Contact Us/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
document.getElementById('contact-form').addEventListener('submit', function(event) {
event.preventDefault();

// Basic form validation
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const subject = document.getElementById('subject').value;
const message = document.getElementById('message').value;

if (name && email && subject && message) {
// Show the popup
document.getElementById('popup').style.display = 'flex';
} else {
alert("Please fill out all fields.");
}
});

document.getElementById('close-popup').addEventListener('click', function() {
document.getElementById('popup').style.display = 'none';
});
134 changes: 134 additions & 0 deletions public/Contact Us/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.contact-container {
background-color: white;
padding: 20px;
max-width: 500px;
width: 100%;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}

.form-group {
margin-bottom: 15px;
}

.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}

.form-group input,
.form-group textarea {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: #007bff;
}

button {
width: 100%;
padding: 10px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
.contact-container {
padding: 15px;
}

h2 {
font-size: 1.5em;
}

.form-group input,
.form-group textarea {
font-size: 14px;
}

button {
font-size: 14px;
}
}

/* Custom Popup Styles */
.popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
justify-content: center;
align-items: center;
}

.popup-content {
background-color: white;
padding: 20px;
border-radius: 8px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.popup-content h2 {
margin-bottom: 15px;
color: #333;
}

.popup-content p {
margin-bottom: 20px;
color: #555;
}

#close-popup {
background-color: #007bff;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}

#close-popup:hover {
background-color: #0056b3;
}

0 comments on commit 494a048

Please sign in to comment.