Новые обновления компоентов

This commit is contained in:
Web-serfer 2026-04-19 22:57:29 +05:00
parent 4b9735118b
commit 1a1871f5f3
18 changed files with 429 additions and 142 deletions

View file

@ -7,6 +7,7 @@ interface CTAProps {
description: string;
btnText?: string;
btnHref?: string;
modalTarget?: string;
variant?: 'default' | 'consultation';
}
@ -16,6 +17,7 @@ const {
description,
btnText,
btnHref = "#contact",
modalTarget,
variant = 'default'
} = Astro.props as CTAProps;
@ -37,7 +39,7 @@ const iconPaths: Record<string, string> = {
<h3 class="cta-section__title">{title}</h3>
<p class="cta-section__desc">{description}</p>
{btnText && (
<Button variant="gold" size="lg" href={btnHref} class="cta-section__btn">
<Button variant="gold" size="lg" href={btnHref} data-modal-target={modalTarget} class="cta-section__btn">
{btnText}
</Button>
)}

View file

@ -69,14 +69,18 @@ const title = 'Бесплатная консультация';
modal.classList.add('active');
modal.setAttribute('aria-hidden', 'false');
document.body.style.overflow = 'hidden';
modal.removeAttribute('inert');
startAutoCloseTimer();
}
function closeModal() {
if (!modal) return;
document.activeElement?.blur();
modal.classList.remove('active');
modal.setAttribute('aria-hidden', 'true');
document.body.style.overflow = '';
document.body.setAttribute('inert', '');
setTimeout(() => document.body.removeAttribute('inert'), 100);
resetAutoCloseTimer();
}
@ -175,22 +179,20 @@ const title = 'Бесплатная консультация';
})();
</script>
<style>
<style is:global>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
inset: 0;
background: rgba(10, 25, 41, 0.85);
backdrop-filter: blur(8px);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
z-index: 9999;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
padding: 2rem 1rem;
}
.modal-overlay.active {
@ -200,114 +202,119 @@ const title = 'Бесплатная консультация';
.modal-container {
background: #ffffff;
border-radius: 16px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 440px;
width: 90%;
border-radius: 24px;
box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.4);
max-width: 480px;
width: 100%;
max-height: 90vh;
overflow-y: auto;
position: relative;
transform: translateY(-20px) scale(0.95);
transition: transform 0.3s ease;
transform: translateY(-20px);
transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.modal-overlay.active .modal-container {
transform: translateY(0) scale(1);
transform: translateY(0);
}
.modal-close {
position: absolute;
top: 16px;
right: 16px;
background: transparent;
top: 1.25rem;
right: 1.25rem;
background: #f1f5f9;
border: none;
cursor: pointer;
padding: 8px;
border-radius: 8px;
color: #535e6c;
transition: background 0.2s ease, color 0.2s ease;
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #64748b;
z-index: 10;
transition: all 0.2s ease;
}
.modal-close:hover {
background: #f0f2f5;
color: #1e3050;
background: #e2e8f0;
color: #0f172a;
transform: rotate(90deg);
}
.modal-content {
padding: 40px 32px 32px;
padding: 3rem 2.5rem 2rem;
}
.modal-title {
font-size: 1.5rem;
font-weight: 700;
color: #1e3050;
margin: 0 0 12px;
text-align: center;
font-size: 1.85rem;
font-weight: 800;
color: #0f172a;
margin: 0 0 0.5rem;
letter-spacing: -0.02em;
}
.modal-description {
color: #535e6c;
font-size: 0.95rem;
color: #64748b;
font-size: 1.05rem;
text-align: center;
margin: 0 0 28px;
margin: 0 0 2rem;
line-height: 1.5;
}
.modal-form {
display: flex;
flex-direction: column;
gap: 20px;
gap: 1.25rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 8px;
gap: 0.5rem;
}
.form-label {
font-size: 0.9rem;
font-weight: 600;
color: #1e3050;
color: #0f172a;
}
.form-input {
padding: 12px 16px;
border: 2px solid #e0e4e8;
border-radius: 8px;
font-size: 1rem;
padding: 1.1rem 1.1rem;
border: 2px solid #e2e8f0;
border-radius: 16px;
font-size: 1.1rem;
font-family: inherit;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
transition: all 0.3s ease;
outline: none;
background: #f8fafc;
}
.form-input:focus {
border-color: #1e3050;
box-shadow: 0 0 0 3px rgba(30, 48, 80, 0.1);
border-color: #d4af37;
background: #fff;
box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}
.form-input::placeholder {
color: #9ca3af;
color: #94a3b8;
}
.modal-submit {
background: linear-gradient(180deg, #eac26e 0%, #ce9f40 100%);
color: #ffffff;
background: linear-gradient(135deg, #d4af37 0%, #eac26e 100%);
color: #1e293b;
border: none;
padding: 14px 24px;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
padding: 1rem 1.5rem;
border-radius: 16px;
font-size: 1.1rem;
font-weight: 700;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(234, 194, 110, 0.3);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.modal-submit:hover {
box-shadow: 0 6px 20px rgba(234, 194, 110, 0.5);
box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
transform: translateY(-2px);
}
@ -317,19 +324,21 @@ const title = 'Бесплатная консультация';
.form-privacy {
font-size: 0.8rem;
color: #9ca3af;
color: #94a3b8;
text-align: center;
margin: 0;
line-height: 1.4;
}
.privacy-link {
color: #1e3050;
color: #d4af37;
text-decoration: underline;
text-underline-offset: 2px;
transition: color 0.2s ease;
}
.privacy-link:hover {
color: #b8962e;
text-decoration: none;
}
@ -342,11 +351,11 @@ const title = 'Бесплатная консультация';
@media (max-width: 480px) {
.modal-content {
padding: 32px 24px 24px;
padding: 2.5rem 1.5rem 1.5rem;
}
.modal-title {
font-size: 1.25rem;
font-size: 1.5rem;
}
}
</style>

View file

@ -48,7 +48,6 @@ const finalSectionDesc = sectionDesc || "Прозрачные цены без с
<ul class="pricing-features">
{plan.features.map(feature => <li>{feature}</li>)}
</ul>
<a href="#contact" class={`pricing-btn ${plan.btnClass}`}>{plan.btnText}</a>
</div>
))}
</div>