diff --git a/frontend/public/images/diploma_bachelor_preview.png b/frontend/public/images/diploma_bachelor_preview.png new file mode 100644 index 0000000..a35f60b Binary files /dev/null and b/frontend/public/images/diploma_bachelor_preview.png differ diff --git a/frontend/public/images/diploma_retraining_preview.png b/frontend/public/images/diploma_retraining_preview.png new file mode 100644 index 0000000..3c0977d Binary files /dev/null and b/frontend/public/images/diploma_retraining_preview.png differ diff --git a/frontend/src/pages/home/components/AboutSection.tsx b/frontend/src/pages/home/components/AboutSection.tsx index 1bc30dd..7aa048f 100644 --- a/frontend/src/pages/home/components/AboutSection.tsx +++ b/frontend/src/pages/home/components/AboutSection.tsx @@ -2,8 +2,8 @@ import { useState } from "react"; import ScrollReveal from "@/components/feature/ScrollReveal"; const diplomas = [ - { label: "Диплом о высшем образовании", pdf: "/documents/diploma_bachelor.pdf" }, - { label: "Диплом о проф. переподготовке", pdf: "/documents/diploma_retraining.pdf" }, + { label: "Диплом о высшем образовании", pdf: "/documents/diploma_bachelor.pdf", preview: "/images/diploma_bachelor_preview.png" }, + { label: "Диплом о проф. переподготовке", pdf: "/documents/diploma_retraining.pdf", preview: "/images/diploma_retraining_preview.png" }, ]; export default function AboutSection() { @@ -77,6 +77,11 @@ export default function AboutSection() { onClick={() => setPreviewIdx(i)} className="group relative w-full aspect-[4/3] bg-greige rounded-xl flex items-center justify-center overflow-hidden cursor-pointer text-left" > + {d.label}
@@ -84,7 +89,7 @@ export default function AboutSection() { Просмотреть
- + {d.label} diff --git a/frontend/src/pages/home/components/FooterSection.tsx b/frontend/src/pages/home/components/FooterSection.tsx index c636f2c..7564afb 100644 --- a/frontend/src/pages/home/components/FooterSection.tsx +++ b/frontend/src/pages/home/components/FooterSection.tsx @@ -19,10 +19,10 @@ export default function FooterSection() { Если остались вопросы — всегда рада помочь. Пишите или звоните.

- +7 999 999-99-99 + +7 918 836-79-09 diff --git a/frontend/src/pages/home/components/PricingSection.tsx b/frontend/src/pages/home/components/PricingSection.tsx index 5850dde..a6b38f5 100644 --- a/frontend/src/pages/home/components/PricingSection.tsx +++ b/frontend/src/pages/home/components/PricingSection.tsx @@ -4,10 +4,28 @@ import ScrollReveal from "@/components/feature/ScrollReveal"; const API_URL = import.meta.env.VITE_API_URL || "http://localhost:3001"; +function formatPhone(value: string) { + const digits = value.replace(/\D/g, ""); + let cleaned = digits; + if (cleaned.startsWith("8") || cleaned.startsWith("7") || cleaned.startsWith("9")) { + cleaned = cleaned.slice(1); + } + cleaned = cleaned.slice(0, 10); + + let formatted = "+7"; + if (cleaned.length > 0) formatted += " (" + cleaned.slice(0, 3); + if (cleaned.length >= 3) formatted += ")"; + if (cleaned.length > 3) formatted += " " + cleaned.slice(3, 6); + if (cleaned.length > 6) formatted += "-" + cleaned.slice(6, 8); + if (cleaned.length > 8) formatted += "-" + cleaned.slice(8, 10); + return formatted; +} + export default function PricingSection() { const navigate = useNavigate(); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); + const [phone, setPhone] = useState(""); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); @@ -112,6 +130,8 @@ export default function PricingSection() { placeholder="Номер телефона" required disabled={loading} + value={phone} + onChange={(e) => setPhone(formatPhone(e.target.value))} className="px-5 py-3.5 bg-cream border border-greigeDark/50 rounded-full text-sm font-sans text-warmBrown placeholder:text-mutedBrown/50 focus:outline-none focus:border-taupe transition-colors w-64 disabled:opacity-60" />