diff --git a/src/components/BufferLandingPage.js b/src/components/BufferLandingPage.js index 80c1870..f1fcecc 100644 --- a/src/components/BufferLandingPage.js +++ b/src/components/BufferLandingPage.js @@ -53,6 +53,46 @@ // export default CustomLayout; +// import React from 'react'; +// import { Layout } from 'antd'; +// import MainSection from './MainSection'; +// import FourstepSection from './FourSteps'; +// import MakeEasier from './MakeEasier'; +// import Questions from './Questions'; +// import WorkInTeam from './WorkInTeam'; +// import PriceList from './PriceList'; +// import Udobno from './Udobno'; +// import Header from './Header'; +// import ContactBlock from './ContactBlock'; +// import Footer from './Footer'; + +// const { Content } = Layout; + +// const CustomLayout = () => ( +// +// +// +// + +// {/* Убрали ограничение высоты */} +// +// +// +// +// +// +// +// {/* Изменили mb-4 на w-full */} +// +// +// + +// +// +// ); + +// export default CustomLayout; + import React from 'react'; import { Layout } from 'antd'; import MainSection from './MainSection'; @@ -69,12 +109,12 @@ import Footer from './Footer'; const { Content } = Layout; const CustomLayout = () => ( - + - + - {/* Убрали ограничение высоты */} + @@ -82,7 +122,9 @@ const CustomLayout = () => ( - {/* Изменили mb-4 на w-full */} + + + diff --git a/src/components/ContactBlock.js b/src/components/ContactBlock.js index 3e4267c..6cf8e10 100644 --- a/src/components/ContactBlock.js +++ b/src/components/ContactBlock.js @@ -125,6 +125,180 @@ // } +// import { useState } from "react"; +// import videoback from '../vids/backvideo2.webm'; +// import translations from '../translations.json'; +// import { useLanguage } from '../contexts/LanguageContext'; + +// export default function ContactBlock() { +// const { language } = useLanguage(); +// const t = translations.contacts[language]; + +// function sendMessage(text) +// { +// const botToken = process.env.REACT_APP_TELEGRAM_BOT_TOKEN; +// const chatId = process.env.REACT_APP_TELEGRAM_CHAT_ID; + +// const url = `https://api.telegram.org/bot${botToken}/sendMessage`; + +// const obj = { +// chat_id: chatId, // Telegram chat id +// text: text // The text to send +// }; + +// const xht = new XMLHttpRequest(); +// xht.open("POST", url, true); +// xht.setRequestHeader("Content-type", "application/json; charset=UTF-8"); +// xht.send(JSON.stringify(obj)); +// } + +// const [formData, setFormData] = useState({ +// name: '', +// email: '', +// message: '' +// }); + +// // const handleSubmit = (e) => { +// // e.preventDefault(); +// // console.log('Form submitted:', formData); +// // }; + +// const handleSubmit = (e) => { +// e.preventDefault(); + +// // Формируем текст сообщения для Telegram +// const messageText = ` +// Новое сообщение с сайта: +// 👤 Имя: ${formData.name} +// 📧 Email: ${formData.email} +// 💬 Сообщение: ${formData.message} +// `.trim(); + +// // Отправляем сообщение в Telegram +// sendMessage(messageText); + +// // Очищаем форму после отправки +// setFormData({ +// name: '', +// email: '', +// message: '' +// }); + +// // Показываем уведомление об успешной отправке +// // alert(language === 'ru' ? 'Сообщение успешно отправлено!' : 'Message sent successfully!'); +// }; + +// const handleChange = (e) => { +// setFormData({ +// ...formData, +// [e.target.name]: e.target.value +// }); +// }; + +// return ( +// +// +// {/* Main container with video background */} +// +// {/* Video background */} +// +// +// +// Your browser does not support the video tag. +// +// {/* Optional overlay for better text visibility */} +// +// + +// {/* Content */} +// +// {/* Text content */} +// +// +// {t.title} +// +// +// {t.subtitle} +// +// + +// {/* Form */} +// +// {t.formTitle} + +// +// +// +// {t.form.name.label} +// +// +// +// +// +// {t.form.email.label} +// +// +// +// +// +// {t.form.message.label} +// +// +// +// +// {t.form.submitButton} +// +// +// +// +// +// +// +// ); +// } + import { useState } from "react"; import videoback from '../vids/backvideo2.webm'; import translations from '../translations.json'; @@ -134,16 +308,14 @@ export default function ContactBlock() { const { language } = useLanguage(); const t = translations.contacts[language]; - function sendMessage(text) - { + function sendMessage(text) { const botToken = process.env.REACT_APP_TELEGRAM_BOT_TOKEN; const chatId = process.env.REACT_APP_TELEGRAM_CHAT_ID; - const url = `https://api.telegram.org/bot${botToken}/sendMessage`; const obj = { - chat_id: chatId, // Telegram chat id - text: text // The text to send + chat_id: chatId, + text: text }; const xht = new XMLHttpRequest(); @@ -158,34 +330,21 @@ export default function ContactBlock() { message: '' }); - // const handleSubmit = (e) => { - // e.preventDefault(); - // console.log('Form submitted:', formData); - // }; - const handleSubmit = (e) => { e.preventDefault(); - - // Формируем текст сообщения для Telegram const messageText = ` Новое сообщение с сайта: 👤 Имя: ${formData.name} 📧 Email: ${formData.email} 💬 Сообщение: ${formData.message} - `.trim(); + `.trim(); - // Отправляем сообщение в Telegram sendMessage(messageText); - - // Очищаем форму после отправки setFormData({ name: '', email: '', message: '' }); - - // Показываем уведомление об успешной отправке - // alert(language === 'ru' ? 'Сообщение успешно отправлено!' : 'Message sent successfully!'); }; const handleChange = (e) => { @@ -196,10 +355,10 @@ export default function ContactBlock() { }; return ( - - - {/* Main container with video background */} - + + + {/* Main container */} + {/* Video background */} Your browser does not support the video tag. - {/* Optional overlay for better text visibility */} + {/* Overlay */} {/* Content */} - + {/* Text content */} - - + + {t.title} - + {t.subtitle} {/* Form */} - - {t.formTitle} + + + {t.formTitle} + - + {t.form.name.label} @@ -284,7 +445,7 @@ export default function ContactBlock() { required /> - diff --git a/src/components/Header.js b/src/components/Header.js index 7ae4162..cdf4515 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -143,7 +143,81 @@ // } +// import { useState, useEffect } from 'react'; +// import logo from '../assets/images/logo200x50.png'; +// import translations from '../translations.json'; +// import { useLanguage } from '../contexts/LanguageContext'; +// import { CustomLink } from './CustomLink'; +// import LanguageSwitcher from './LanguageSwitcher'; +// import { ScrollLink } from './ScrollLink'; + +// export default function Header() { +// const [isScrolled, setIsScrolled] = useState(false); +// const { language } = useLanguage(); +// const t = translations.header[language]; + +// useEffect(() => { +// const handleScroll = () => { +// const isFullScreenPassed = window.scrollY > window.innerHeight; +// setIsScrolled(isFullScreenPassed); +// }; + +// window.addEventListener('scroll', handleScroll); +// return () => window.removeEventListener('scroll', handleScroll); +// }, []); + +// return ( +// +// +// +// +// +// +// +// + +// +// +// {t.pricing} +// +// +// {t.feedback} +// +// +// +// +// +// +// ); +// } + + import { useState, useEffect } from 'react'; +import { useLocation } from 'react-router-dom'; +import { Menu, X } from 'lucide-react'; import logo from '../assets/images/logo200x50.png'; import translations from '../translations.json'; import { useLanguage } from '../contexts/LanguageContext'; @@ -153,62 +227,96 @@ import { ScrollLink } from './ScrollLink'; export default function Header() { const [isScrolled, setIsScrolled] = useState(false); + const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const { language } = useLanguage(); const t = translations.header[language]; + const location = useLocation(); useEffect(() => { const handleScroll = () => { const isFullScreenPassed = window.scrollY > window.innerHeight; setIsScrolled(isFullScreenPassed); }; - window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []); + // Закрываем мобильное меню при смене маршрута + useEffect(() => { + setIsMobileMenuOpen(false); + }, [location]); + + const headerBg = isScrolled + ? 'bg-white bg-opacity-90 backdrop-blur-md' + : 'bg-transparent backdrop-blur-md bg-opacity-30'; + + const textColor = isScrolled + ? 'text-gray-800 hover:text-gray-600' + : 'text-white hover:text-gray-200'; + return ( - + + {/* Логотип */} - + - + + {/* Десктопная навигация */} {t.pricing} - {t.feedback} + + {/* Кнопка мобильного меню */} + setIsMobileMenuOpen(!isMobileMenuOpen)} + > + {isMobileMenuOpen ? ( + + ) : ( + + )} + + + {/* Мобильное меню */} + {isMobileMenuOpen && ( + + + + {t.pricing} + + + {t.feedback} + + + + + + + )} ); diff --git a/src/components/MainSection.js b/src/components/MainSection.js index c0c5316..db92c4c 100644 --- a/src/components/MainSection.js +++ b/src/components/MainSection.js @@ -74,6 +74,99 @@ // export default MainSection; +// import React from 'react'; +// import { Typography, Button } from 'antd'; +// import { ArrowRightOutlined } from '@ant-design/icons'; +// import VideoBackground from './VideoBackground'; +// import styled from 'styled-components'; +// import translations from '../translations.json'; +// import { useLanguage } from '../contexts/LanguageContext'; + +// const { Title, Paragraph } = Typography; + + +// const CustomFont = styled.div` +// @font-face { +// font-family: 'CustomFont'; +// src: url('../assets/fonts/ProtestStrike-Regular.ttf') format('truetype'); +// } +// font-family: 'CustomFont', sans-serif; +// `; + +// const MainSection = () => { +// const { language } = useLanguage(); +// const t = translations.mainSection[language]; + +// return ( +// +// +// +// + +// + +// +// +// +// {t.title} +// +// +// + +// +// {t.subtitle} +// +// +// {t.description} +// +// +// {t.descriptionn} +// +// +// {t.tryButton} +// +// +// +// +// ); +// }; + +// export default MainSection; + import React from 'react'; import { Typography, Button } from 'antd'; import { ArrowRightOutlined } from '@ant-design/icons'; @@ -84,7 +177,6 @@ import { useLanguage } from '../contexts/LanguageContext'; const { Title, Paragraph } = Typography; - const CustomFont = styled.div` @font-face { font-family: 'CustomFont'; @@ -99,10 +191,14 @@ const MainSection = () => { return ( + {/* Фон с видео */} { + {/* Контент */} - - + {t.title} - + {t.subtitle} - + + {t.description} - + + {t.descriptionn} - - {t.tryButton} + {t.tryButton}
+// {t.subtitle} +//
+
{t.subtitle}
{t.title}
{t.tryButton}