Neumorphism Get in touch contact page Html Template

Features Implemented:


Neumorphism Design:

  • Soft shadows and rounded corners throughout
  • Light gray background (#e0e5ec)
  • Both inset and outset shadows for the 3D effect

Contact Form:

  • Name field (text input)
  • Email field (email input)
  • Subject field (text input)
  • Message field (textarea)
  • Submit button with neumorphic styling

Contact Information Section:

  • Phone number
  • Email address
  • Physical address
  • Map placeholder
  • Neumorphic icons for each contact method

Responsive Layout:

  • Works on both mobile and desktop
  • Flexbox layout that stacks on smaller screens

Form Validation:

  • Checks if all fields are filled
  • Validates email format
  • Shows error messages with visual feedback
  • Success message when form is valid

Visual Effects:

  • Hover and active states for buttons
  • Focus states for form inputs
  • Error states with red shadows

The design follows neumorphism principles with soft shadows that create the illusion of elements being extruded from or inset into the background.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Get in Touch</title> </head> <body> <div class="container"> <h1>Get in Touch</h1> <div class="contact-container"> <div class="contact-form"> <form id="contactForm"> <div class="form-group"> <label for="name">Name</label> <input type="text" id="name" placeholder="Enter your name"> <div class="error" id="nameError">Please enter your name</div> </div> <div class="form-group"> <label for="email">Email</label> <input type="email" id="email" placeholder="Enter your email"> <div class="error" id="emailError">Please enter a valid email</div> </div> <div class="form-group"> <label for="subject">Subject</label> <input type="text" id="subject" placeholder="Enter subject"> <div class="error" id="subjectError">Please enter a subject</div> </div> <div class="form-group"> <label for="message">Message</label> <textarea id="message" placeholder="Enter your message"></textarea> <div class="error" id="messageError">Please enter your message</div> </div> <button type="submit">Send Message</button> </form> </div> <div class="contact-info"> <div class="info-card"> <h2>Contact Information</h2> <div class="info-item"> <div class="info-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4a5568" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path> </svg> </div> <div class="info-text"> <h3>Phone</h3> <p>+1 (555) 123-4567</p> </div> </div> <div class="info-item"> <div class="info-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4a5568" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path> <polyline points="22,6 12,13 2,6"></polyline> </svg> </div> <div class="info-text"> <h3>Email</h3> <p>contact@example.com</p> </div> </div> <div class="info-item"> <div class="info-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4a5568" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path> <circle cx="12" cy="10" r="3"></circle> </svg> </div> <div class="info-text"> <h3>Address</h3> <p>123 Main Street, Suite 100<br>San Francisco, CA 94107</p> </div> </div> <div class="map-container"> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3022.2153735104797!2d-73.9878449241647!3d40.74844097138971!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zNDDCsDQ0JzU0LjQiTiA3M8KwNTknMDkuNyJX!5e0!3m2!1sen!2sus!4v1620000000000!5m2!1sen!2sus" width="100%" height="100%" style="border:0;" allowfullscreen="" loading="lazy" class="neumorphic-map"> </iframe> </div> </div> </div> </div> </div> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css extension.


 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #e0e5ec;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            width: 100%;
            max-width: 900px;
        }

        h1 {
            text-align: center;
            color: #4a5568;
            margin-bottom: 40px;
            font-size: 2.5rem;
            text-shadow: 3px 3px 6px #b8b9be, -3px -3px 6px #ffffff;
        }

        .contact-container {
            display: flex;
            flex-wrap: wrap;
            gap: 30px;
        }

        .contact-form {
            flex: 1;
            min-width: 300px;
        }

        .contact-info {
            flex: 1;
            min-width: 300px;
        }

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

        label {
            display: block;
            margin-bottom: 8px;
            color: #4a5568;
            font-weight: 500;
        }

        input, textarea {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 15px;
            background: #e0e5ec;
            box-shadow: inset 5px 5px 10px #b8b9be, 
                        inset -5px -5px 10px #ffffff;
            font-size: 16px;
            color: #4a5568;
            outline: none;
            transition: all 0.3s ease;
        }

        input:focus, textarea:focus {
            box-shadow: inset 2px 2px 5px #b8b9be, 
                        inset -2px -2px 5px #ffffff;
        }

        textarea {
            resize: vertical;
            min-height: 150px;
        }

        button {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 15px;
            background: #e0e5ec;
            box-shadow: 8px 8px 15px #b8b9be, 
                       -8px -8px 15px #ffffff;
            font-size: 16px;
            font-weight: 600;
            color: #4a5568;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        button:hover {
            box-shadow: 4px 4px 8px #b8b9be, 
                       -4px -4px 8px #ffffff;
        }

        button:active {
            box-shadow: inset 5px 5px 10px #b8b9be, 
                        inset -5px -5px 10px #ffffff;
        }

        .info-card {
            padding: 30px;
            border-radius: 20px;
            background: #e0e5ec;
            box-shadow: 10px 10px 20px #b8b9be, 
                        -10px -10px 20px #ffffff;
            height: 100%;
        }

        .info-card h2 {
            color: #4a5568;
            margin-bottom: 20px;
            font-size: 1.8rem;
        }

        .info-item {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .info-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: #e0e5ec;
            box-shadow: 5px 5px 10px #b8b9be, 
                       -5px -5px 10px #ffffff;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-right: 15px;
            flex-shrink: 0;
        }

        .info-text h3 {
            color: #4a5568;
            margin-bottom: 5px;
        }

        .info-text p {
            color: #718096;
        }

      .map-container {
    width: 100%;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 30px;
    box-shadow: 10px 10px 20px #b8b9be, 
                -10px -10px 20px #ffffff;
}

.neumorphic-map {
    border-radius: 15px;
}

        .error {
            color: #e53e3e;
            font-size: 14px;
            margin-top: 5px;
            display: none;
        }

        input.error-field, textarea.error-field {
            box-shadow: inset 5px 5px 10px #feb2b2, 
                       inset -5px -5px 10px #ffffff;
        }

        @media (max-width: 768px) {
            .contact-container {
                flex-direction: column;
            }
            
            h1 {
                font-size: 2rem;
                margin-bottom: 30px;
            }
        }
JavaScript makes the page work functionally. At last, create a JavaScript file with the name of script.js, and remember that you've got to make a file with a .js extension.


 document.getElementById('contactForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // Reset errors
            document.querySelectorAll('.error').forEach(el => {
                el.style.display = 'none';
            });
            document.querySelectorAll('input, textarea').forEach(el => {
                el.classList.remove('error-field');
            });
            
            // Get form values
            const name = document.getElementById('name').value.trim();
            const email = document.getElementById('email').value.trim();
            const subject = document.getElementById('subject').value.trim();
            const message = document.getElementById('message').value.trim();
            
            let isValid = true;
            
            // Validate name
            if (name === '') {
                document.getElementById('nameError').style.display = 'block';
                document.getElementById('name').classList.add('error-field');
                isValid = false;
            }
            
            // Validate email
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (email === '' || !emailRegex.test(email)) {
                document.getElementById('emailError').style.display = 'block';
                document.getElementById('email').classList.add('error-field');
                isValid = false;
            }
            
            // Validate subject
            if (subject === '') {
                document.getElementById('subjectError').style.display = 'block';
                document.getElementById('subject').classList.add('error-field');
                isValid = false;
            }
            
            // Validate message
            if (message === '') {
                document.getElementById('messageError').style.display = 'block';
                document.getElementById('message').classList.add('error-field');
                isValid = false;
            }
            
            // If form is valid, submit it (in a real app, you would send to server)
            if (isValid) {
                alert('Thank you for your message! We will get back to you soon.');
                this.reset();
            }
        });
We hope you Like this Post Thanks for coming Here

Thank you
Learning robo team

Post a Comment

Thank you
Learning robo team

Post a Comment (0)

Previous Post Next Post
Learning Robo says...
code copied