Switch to version 41: modified src/app/page.tsx
This commit is contained in:
106
src/app/page.tsx
106
src/app/page.tsx
@@ -37,9 +37,8 @@ import {
|
||||
Star,
|
||||
Users,
|
||||
Award,
|
||||
MapPin,
|
||||
} from "lucide-react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function LandingPage() {
|
||||
const [squareMeters, setSquareMeters] = useState(10);
|
||||
@@ -48,7 +47,6 @@ export default function LandingPage() {
|
||||
const [sliderPosition, setSliderPosition] = useState(50);
|
||||
const [currentBeforeAfterIndex, setCurrentBeforeAfterIndex] = useState(0);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [mapLoaded, setMapLoaded] = useState(false);
|
||||
|
||||
const cleaningTypePrices: Record<string, number> = {
|
||||
Standard: 2500,
|
||||
@@ -127,52 +125,6 @@ export default function LandingPage() {
|
||||
setSliderPosition(percentage);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Load Yandex Maps script
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://api-maps.yandex.ru/2.1/?apikey=d96acdc0-91a9-4c63-8c23-cfd97e90ca59&lang=ru_RU';
|
||||
script.async = true;
|
||||
script.onload = () => {
|
||||
if ((window as any).ymaps) {
|
||||
(window as any).ymaps.ready(initMap);
|
||||
}
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
|
||||
return () => {
|
||||
if (document.body.contains(script)) {
|
||||
document.body.removeChild(script);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const initMap = () => {
|
||||
const ymaps = (window as any).ymaps;
|
||||
const mapContainer = document.getElementById('yandex-map');
|
||||
if (mapContainer) {
|
||||
const map = new ymaps.Map('yandex-map', {
|
||||
center: [69.5948, 69.2242], // Shymkent coordinates
|
||||
zoom: 14,
|
||||
controls: ['zoomControl', 'fullscreenControl'],
|
||||
});
|
||||
|
||||
const placemark = new ymaps.Placemark(
|
||||
[69.5948, 69.2242],
|
||||
{
|
||||
balloonContent: '<div style="padding: 10px;"><strong>Центр чистки ковров «Нурсат»</strong><br/>Шымкент, Казахстан<br/>Тел: +7 776 341 30 30</div>',
|
||||
hintContent: 'Центр чистки ковров «Нурсат»',
|
||||
},
|
||||
{
|
||||
preset: 'islands#redDotIcon',
|
||||
iconColor: '#15479c',
|
||||
}
|
||||
);
|
||||
|
||||
map.geoObjects.add(placemark);
|
||||
setMapLoaded(true);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="hover-bubble"
|
||||
@@ -667,60 +619,6 @@ export default function LandingPage() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div id="map" data-section="map">
|
||||
<div className="relative w-full overflow-hidden py-16 md:py-20 lg:py-24">
|
||||
<div className="mx-auto flex w-full max-w-[var(--width-content-width)] flex-col gap-12 px-[var(--vw-1_5)]">
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-4">
|
||||
<h2 className="text-4xl font-bold md:text-5xl">Найдите нас на карте</h2>
|
||||
<p className="text-base text-gray-600 md:text-lg">Центр чистки ковров «Нурсат» расположен в Шымкенте. Приезжайте к нам или заказывайте услугу с доставкой</p>
|
||||
</div>
|
||||
|
||||
{/* Map Container with Lazy Loading */}
|
||||
<div className="relative rounded-2xl overflow-hidden shadow-lg border border-gray-200">
|
||||
{!mapLoaded && (
|
||||
<div className="absolute inset-0 bg-gray-200 flex items-center justify-center z-10">
|
||||
<div className="text-center">
|
||||
<div className="inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mb-4"></div>
|
||||
<p className="text-gray-600">Загрузка карты...</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
id="yandex-map"
|
||||
className="w-full h-96 md:h-[500px] bg-gray-100"
|
||||
style={{ minHeight: '400px' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Contact Information */}
|
||||
<div className="grid md:grid-cols-3 gap-6">
|
||||
<div className="flex gap-4 items-start p-4 rounded-lg bg-gray-50">
|
||||
<MapPin className="text-blue-600 flex-shrink-0 mt-1" size={24} />
|
||||
<div>
|
||||
<h3 className="font-semibold text-lg mb-1">Адрес</h3>
|
||||
<p className="text-gray-600">Шымкент, Казахстан</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-4 items-start p-4 rounded-lg bg-gray-50">
|
||||
<Phone className="text-blue-600 flex-shrink-0 mt-1" size={24} />
|
||||
<div>
|
||||
<h3 className="font-semibold text-lg mb-1">Телефон</h3>
|
||||
<p className="text-gray-600"><a href="tel:+77763413030" className="hover:text-blue-600 transition-colors">+7 776 341 30 30</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-4 items-start p-4 rounded-lg bg-gray-50">
|
||||
<MessageSquare className="text-blue-600 flex-shrink-0 mt-1" size={24} />
|
||||
<div>
|
||||
<h3 className="font-semibold text-lg mb-1">WhatsApp</h3>
|
||||
<p className="text-gray-600"><a href="https://wa.me/77763413030" target="_blank" rel="noopener noreferrer" className="hover:text-blue-600 transition-colors">Написать сообщение</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="contact" data-section="contact">
|
||||
<ContactCenter
|
||||
tag="Свяжитесь с нами"
|
||||
@@ -758,7 +656,7 @@ export default function LandingPage() {
|
||||
{
|
||||
title: "Контакты", items: [
|
||||
{ label: "Телефон: +7 776 341 30 30", href: "tel:+77763413030" },
|
||||
{ label: "Адрес: Шымкент", href: "#map" },
|
||||
{ label: "Адрес: Шымкент", href: "#" },
|
||||
{ label: "WhatsApp", href: "https://wa.me/77763413030" },
|
||||
{ label: "Email: info@nursat.kz", href: "mailto:info@nursat.kz" },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user