📋 Form Modal
Модальные окна с формами
← Назад к Модальные окна
Login Form
HTML
<div class="modal-overlay">
<div class="modal-form">
<div class="modal-form-header">
<h3 class="modal-form-title">Sign In</h3>
<button class="modal-form-close">×</button>
</div>
<div class="modal-form-body">
<div class="form-group">
<label class="form-label">Email</label>
<input type="email" class="form-input" placeholder="Enter your email">
</div>
<div class="form-group">
<label class="form-label">Password</label>
<input type="password" class="form-input" placeholder="Enter your password">
</div>
<button class="form-submit">Sign In</button>
</div>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 450px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-form {
background: white;
border-radius: 16px;
width: 400px;
max-width: 100%;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalFadeIn 0.3s ease;
}
.modal-form-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem;
border-bottom: 1px solid #e0e0e0;
}
.modal-form-title {
margin: 0;
font-size: 1.3rem;
font-weight: 700;
color: #1a1a2e;
}
.modal-form-close {
background: none;
border: none;
font-size: 1.5rem;
color: #999;
cursor: pointer;
padding: 0;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
transition: all 0.2s;
}
.modal-form-close:hover {
background: #f5f5f5;
color: #1a1a2e;
}
.modal-form-body {
padding: 1.5rem;
}
.form-group {
margin-bottom: 1.25rem;
}
.form-label {
display: block;
margin-bottom: 0.5rem;
font-size: 0.9rem;
font-weight: 600;
color: #1a1a2e;
}
.form-input {
width: 100%;
padding: 0.75rem 1rem;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 0.95rem;
outline: none;
transition: all 0.3s;
font-family: inherit;
}
.form-input:focus {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-submit {
width: 100%;
padding: 0.85rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
font-size: 0.95rem;
}
.form-submit:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
Contact Form
HTML
<div class="modal-overlay">
<div class="modal-form">
<div class="modal-form-header">
<h3 class="modal-form-title">Contact Us</h3>
<button class="modal-form-close">×</button>
</div>
<div class="modal-form-body">
<div class="form-group">
<label class="form-label">Name</label>
<input type="text" class="form-input" placeholder="Your name">
</div>
<div class="form-group">
<label class="form-label">Message</label>
<textarea class="form-textarea" rows="4" placeholder="Your message"></textarea>
</div>
<button class="form-submit">Send Message</button>
</div>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 450px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-form {
background: white;
border-radius: 16px;
width: 400px;
max-width: 100%;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalFadeIn 0.3s ease;
}
.modal-form-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem;
border-bottom: 1px solid #e0e0e0;
}
.modal-form-title {
margin: 0;
font-size: 1.3rem;
font-weight: 700;
color: #1a1a2e;
}
.modal-form-close {
background: none;
border: none;
font-size: 1.5rem;
color: #999;
cursor: pointer;
padding: 0;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
transition: all 0.2s;
}
.modal-form-close:hover {
background: #f5f5f5;
color: #1a1a2e;
}
.modal-form-body {
padding: 1.5rem;
}
.form-group {
margin-bottom: 1.25rem;
}
.form-label {
display: block;
margin-bottom: 0.5rem;
font-size: 0.9rem;
font-weight: 600;
color: #1a1a2e;
}
.form-input, .form-textarea {
width: 100%;
padding: 0.75rem 1rem;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 0.95rem;
outline: none;
transition: all 0.3s;
font-family: inherit;
resize: vertical;
}
.form-input:focus, .form-textarea:focus {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-submit {
width: 100%;
padding: 0.85rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
font-size: 0.95rem;
}
.form-submit:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
Newsletter Signup
HTML
<div class="modal-overlay">
<div class="modal-newsletter">
<button class="modal-newsletter-close">×</button>
<div class="modal-newsletter-icon">📧</div>
<h3 class="modal-newsletter-title">Subscribe to Newsletter</h3>
<p class="modal-newsletter-text">Get the latest updates and exclusive offers delivered to your inbox.</p>
<div class="modal-newsletter-form">
<input type="email" class="modal-newsletter-input" placeholder="Enter your email">
<button class="modal-newsletter-btn">Subscribe</button>
</div>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 450px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-newsletter {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
width: 420px;
max-width: 100%;
padding: 2.5rem 2rem;
text-align: center;
box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
animation: modalFadeIn 0.3s ease;
position: relative;
color: white;
}
.modal-newsletter-close {
position: absolute;
top: 1rem;
right: 1rem;
background: rgba(255, 255, 255, 0.2);
border: none;
color: white;
width: 32px;
height: 32px;
border-radius: 50%;
cursor: pointer;
font-size: 1.25rem;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.modal-newsletter-close:hover {
background: rgba(255, 255, 255, 0.3);
}
.modal-newsletter-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.modal-newsletter-title {
margin: 0 0 0.75rem;
font-size: 1.5rem;
font-weight: 700;
}
.modal-newsletter-text {
margin: 0 0 1.5rem;
font-size: 0.95rem;
opacity: 0.9;
line-height: 1.5;
}
.modal-newsletter-form {
display: flex;
gap: 0.5rem;
}
.modal-newsletter-input {
flex: 1;
padding: 0.85rem 1rem;
border: none;
border-radius: 8px;
font-size: 0.95rem;
outline: none;
font-family: inherit;
}
.modal-newsletter-btn {
padding: 0.85rem 1.5rem;
background: white;
color: #667eea;
border: none;
border-radius: 8px;
font-weight: 700;
cursor: pointer;
transition: all 0.3s;
white-space: nowrap;
}
.modal-newsletter-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}