Download index.html from DISSASTER/vr1: direct link, hf CLI and curl.
- Browser
- Download file 168 kB
-
https://huggingface.co/spaces/DISSASTER/vr1/resolve/main/index.html
- Command line
-
hf download hf://spaces/DISSASTER/vr1/index.html
-
curl -L -o index.html https://huggingface.co/spaces/DISSASTER/vr1/resolve/main/index.html
168 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Venera Rielt | Premium Real Estate Moldova</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script src="https://cdn.jsdelivr.net/npm/emailjs-com@2/dist/email.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--gold: #FFD700;
--black: #000000;
--white: #FFFFFF;
--glass: rgba(255, 255, 255, 0.05);
--glass-border: rgba(255, 255, 255, 0.1);
--glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
body {
font-family: 'Montserrat', sans-serif;
background-color: var(--black);
color: var(--white);
overflow-x: hidden;
}
.glass-effect {
background: var(--glass);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid var(--glass-border);
box-shadow: var(--glass-shadow);
}
.gold-text {
color: var(--gold);
}
.logo-container {
position: relative;
}
.logo-image {
position: relative;
z-index: 2;
}
.logo-glow {
position: absolute;
width: 128px;
height: 128px;
background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(255,215,0,0) 70%);
filter: blur(15px);
z-index: 1;
animation: pulseGlow 3s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
0% {
opacity: 0.5;
transform: scale(0.95);
}
100% {
opacity: 1;
transform: scale(1.05);
}
}
.gold-border {
border-color: var(--gold);
}
.gold-bg {
background-color: var(--gold);
}
.neon-glow {
box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
.hero-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
opacity: 0.7;
}
.property-card,
#agents .glass-effect.hidden {
display: none;
}
.property-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(255, 215, 0, 0.3);
}
.property-card h3 {
white-space: normal;
overflow: visible;
text-overflow: clip;
}
.property-card .flex.items-center span {
white-space: normal;
overflow: visible;
text-overflow: clip;
display: inline;
max-width: none;
}
.property-card.visible {
display: block;
}
.agent-photo {
transition: all 0.3s ease;
}
.agent-photo:hover {
transform: scale(1.05);
box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}
.search-box {
transition: all 0.3s ease;
}
.search-box:hover {
box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}
.btn-gold {
transition: all 0.3s ease;
}
.btn-gold:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}
.fade-in {
animation: fadeIn 1s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.slide-up {
animation: slideUp 0.8s ease-out;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(50px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.overlay.active {
opacity: 1;
visibility: visible;
}
.property-details {
max-width: 90%;
max-height: 90%;
overflow-y: auto;
}
.carousel-item {
display: none;
}
.carousel-item.active {
display: block;
}
.map-container {
height: 500px;
width: 100%;
position: relative;
}
.map-expand-btn {
position: absolute;
left: 10px;
bottom: 10px;
z-index: 1000;
background: rgba(0,0,0,0.7);
color: white;
border: none;
border-radius: 4px;
padding: 8px 12px;
cursor: pointer;
transition: all 0.3s ease;
}
.map-expand-btn:hover {
background: rgba(0,0,0,0.9);
}
.map-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.9);
z-index: 2000;
display: none;
}
.overlay.active {
z-index: 2001;
}
.map-overlay.active {
display: block;
}
.map-overlay-container {
width: 100%;
height: 100%;
position: relative;
}
.map-overlay-close {
position: absolute;
top: 20px;
right: 20px;
z-index: 2001;
background: rgba(0,0,0,0.7);
color: white;
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 20px;
}
.map-overlay-close:hover {
background: rgba(0,0,0,0.9);
}
.map-popup-container .leaflet-popup-content {
margin: 12px;
}
/* Hide Leaflet attribution and Ukraine flag */
.leaflet-control-attribution {
display: none !important;
}
.map-popup {
font-family: 'Montserrat', sans-serif;
}
.map-popup-mini {
font-family: 'Montserrat', sans-serif;
background: white;
border-radius: 0.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.map-popup-mini h4 {
margin-bottom: 4px;
font-size: 14px;
}
.leaflet-popup-content {
margin: 0 !important;
}
.leaflet-popup-content-wrapper {
padding: 0 !important;
border-radius: 0.5rem !important;
}
@media (max-width: 768px) {
.map-popup-mini {
width: 200px !important;
}
}
.map-placeholder {
background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.social-icon {
transition: all 0.3s ease;
}
.social-icon:hover {
transform: scale(1.2);
color: var(--gold);
}
.price-tag {
position: absolute;
top: 15px;
right: 15px;
z-index: 2;
}
/* Custom map markers */
.custom-icon {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
color: white;
font-size: 14px;
box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.premium-icon {
background-color: #FFD700;
color: #000;
}
.secondary-icon {
background-color: #4CAF50;
}
.newbuilding-icon {
background-color: #2196F3;
}
.commercial-icon {
background-color: #9C27B0;
}
.rental-icon {
background-color: #FF5722;
}
.garage-icon {
background-color: #795548;
}
.parking-icon {
background-color: #607D8B;
}
.storage-icon {
background-color: #8D6E63;
}
.house-icon {
background-color: #4CAF50;
}
.land-icon {
background-color: #8BC34A;
}
.type-tag {
position: absolute;
top: 15px;
left: 15px;
z-index: 2;
font-weight: bold;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
}
.premium-tag {
background-color: #FFD700;
color: #000;
}
.secondary-tag {
background-color: #4CAF50;
color: #fff;
}
.newbuilding-tag {
background-color: #2196F3;
color: #fff;
}
.commercial-tag {
background-color: #9C27B0;
color: #fff;
}
.rental-tag {
background-color: #FF5722;
color: #fff;
}
.garage-tag {
background-color: #795548;
color: #fff;
}
.parking-tag {
background-color: #607D8B;
color: #fff;
}
.storage-tag {
background-color: #8D6E63;
color: #fff;
}
.house-tag {
background-color: #4CAF50;
color: #fff;
}
.land-tag {
background-color: #8BC34A;
color: #fff;
}
.agent-badge {
position: absolute;
bottom: 15px;
right: 15px;
z-index: 2;
}
.testimonial-carousel {
position: relative;
}
.testimonial-item {
display: none;
}
.testimonial-item.active {
display: block;
animation: fadeIn 1s;
}
.nav-link {
position: relative;
}
.nav-link::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: -5px;
left: 0;
background-color: var(--gold);
transition: width 0.3s ease;
}
.nav-link:hover::after {
width: 100%;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.hero-content {
padding-top: 100px;
}
.search-box {
margin-top: 80px;
}
.search-box .grid-cols-2 > .grid {
grid-template-columns: 1fr !important;
}
.map-container {
height: 300px;
}
}
</style>
</head>
<body class="antialiased">
<!-- Header -->
<header class="fixed w-full z-50 glass-effect">
<div class="container mx-auto px-4 py-4">
<div class="flex justify-between items-center">
<div class="flex items-center">
<a href="#" id="logo-link" class="text-2xl font-bold gold-text hover:text-yellow-300 transition">Venera Rielt</a>
</div>
<nav class="hidden md:flex space-x-8">
<a href="#" id="home-link" class="nav-link text-white hover:text-gold-500 transition">Главная</a>
<a href="#properties" class="nav-link text-white hover:text-gold-500 transition">Объекты</a>
<a href="#agents" class="nav-link text-white hover:text-gold-500 transition">Специалисты</a>
<a href="#about" class="nav-link text-white hover:text-gold-500 transition">О компании</a>
<a href="#contact" class="nav-link text-white hover:text-gold-500 transition">Контакты</a>
</nav>
<div class="md:hidden">
<button id="mobile-menu-button" class="text-white focus:outline-none">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
</div>
<!-- Mobile menu -->
<div id="mobile-menu" class="hidden md:hidden glass-effect w-full">
<div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<a href="#" id="mobile-home-link" class="block px-3 py-2 text-white hover:bg-gray-800 rounded-md">Главная</a>
<a href="#properties" class="block px-3 py-2 text-white hover:bg-gray-800 rounded-md">Объекты</a>
<a href="#agents" class="block px-3 py-2 text-white hover:bg-gray-800 rounded-md">Специалисты</a>
<a href="#about" class="block px-3 py-2 text-white hover:bg-gray-800 rounded-md">О компании</a>
<a href="#contact" class="block px-3 py-2 text-white hover:bg-gray-800 rounded-md">Контакты</a>
</div>
</div>
</header>
<!-- Hero Section with Video Background -->
<section class="relative min-h-screen flex items-center justify-center overflow-hidden">
<video autoplay muted loop class="hero-video">
<source src="https://assets.mixkit.co/videos/preview/mixkit-modern-residential-district-with-tall-buildings-15800-large.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="absolute inset-0 bg-black opacity-50"></div>
<div class="hero-content container mx-auto px-4 text-center relative z-10 fade-in pt-32">
<h1 class="text-4xl md:text-6xl font-bold mb-6 text-white">
<span class="block">PREMIUM</span>
<span class="block my-2">REAL ESTATE</span>
<span class="block gold-text">MOLDOVA</span>
</h1>
<p class="text-xl md:text-2xl mb-10 text-gray-300">Найдите свой идеальный дом среди наших предложений</p>
<!-- Search Box -->
<div class="glass-effect rounded-xl p-4 md:p-6 max-w-4xl mx-auto search-box mt-20 md:mt-0">
<form id="search-form">
<div class="grid grid-cols-1 md:grid-cols-3 gap-3 mb-3">
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Город</label>
<select id="city" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
<option value="Все">Все города</option>
<option>Кишинёв</option>
<option>Бельцы</option>
<option>Тирасполь</option>
<option>Бендеры</option>
<option>Рыбница</option>
<option>Кагул</option>
<option>Унгень</option>
<option>Сороки</option>
<option>Оргеев</option>
<option>Комрат</option>
<option>Чадыр-Лунга</option>
<option>Страшены</option>
<option>Дрокия</option>
<option>Единцы</option>
<option>Флорешты</option>
<option>Резина</option>
<option>Глодяны</option>
<option>Кантемир</option>
<option>Леова</option>
<option>Ниспорены</option>
<option>Окница</option>
<option>Вадул-луй-Водэ</option>
</select>
</div>
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Район</label>
<select id="district" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
<option value="Все">Все районы</option>
</select>
</div>
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Тип предложения</label>
<select id="property-type" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
<option value="Все">Все типы</option>
<option>Премиум</option>
<option>Вторичка</option>
<option>Новострой</option>
<option>Аренда</option>
<option>Коммерческая</option>
<option>Гараж</option>
<option>Парковка</option>
<option>Кладовка</option>
<option>Дом</option>
<option>Участок</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3 mb-3">
<div class="grid grid-cols-2 gap-3">
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Цена от (€)</label>
<input id="min-price" type="number" placeholder="Минимум" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
</div>
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Цена до (€)</label>
<input id="max-price" type="number" placeholder="Максимум" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
</div>
</div>
<div class="grid grid-cols-2 gap-3">
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Площадь от (м²)</label>
<input id="min-area" type="number" placeholder="Минимум" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
</div>
<div>
<label class="block text-left text-white mb-1 text-sm md:text-base">Площадь до (м²)</label>
<input id="max-area" type="number" placeholder="Максимум" class="w-full bg-gray-800 text-white p-2 md:p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none text-sm md:text-base">
</div>
</div>
</div>
<button type="submit" class="mt-6 w-full bg-[#FFD700] text-black font-bold py-3 md:py-4 px-8 rounded-xl hover:shadow-lg hover:shadow-yellow-500/30 transition-all duration-300 text-base md:text-lg">
Поиск <i class="fas fa-search ml-2"></i>
</button>
</form>
</div>
<div class="mt-5 flex justify-center">
<a href="#properties" class="text-white animate-bounce">
<svg class="w-10 h-10" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
</svg>
</a>
</div>
</div>
</section>
<!-- Properties Section -->
<section id="properties" class="py-20 bg-gradient-to-b from-black to-gray-900 slide-up">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-3xl md:text-4xl font-bold mb-4 gold-text">Наши объекты</h2>
<div class="w-20 h-1 gold-bg mx-auto mb-6"></div>
<p class="text-gray-400 max-w-2xl mx-auto">Откройте для себя подборку лучших предложений по всей Молдове
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Property 1 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O1" data-city="Кишинёв" data-district="Буюканы" data-type="premium" data-coords="47.038673, 28.770806" data-rieltor-id="1"
data-price="450000" data-area="250" data-rooms="5" data-floors="2"
data-year="2018" data-land="10" data-parking="2" data-address="ул. Мирча чел Бэтрын 15"
data-full-address="Кишинёв, Буюканы, ул. Алба Юлия 194/2"
data-description="Элитная вилла в престижном районе Буюканы. Просторные светлые помещения, высокие потолки, панорамные окна. Современная отделка премиальными материалами. Кухня-гостиная с выходом на террасу и в сад. Мастер-спальня с гардеробной и собственной ванной комнатой. Дополнительно: камин, система 'умный дом', видеонаблюдение, автономное отопление. Ухоженный сад с зоной отдыха и летней кухней.">
<div class="relative">
<img src="https://images.unsplash.com/photo-1564013799919-ab600027ffc6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury House" class="w-full h-64 object-cover">
<div class="type-tag premium-tag">ПРЕМИУМ</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€450,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="1">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2 truncate">Вилла в Буюканах</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span class="truncate">Кишинёв, Буюканы, ул. Алба Юлия 194/2</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">250 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Комнат</div>
<div class="font-semibold">5</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Этаж</div>
<div class="font-semibold">2</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="1" data-price="450000">
Подробнее
</button>
</div>
</div>
<!-- Property 2 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O2" data-city="Кишинёв" data-district="Центр" data-type="Вторичка" data-coords="47.038673, 28.770806" data-rieltor-id="2"
data-price="220000" data-area="120" data-rooms="3" data-floors="7"
data-year="2015" data-parking="1" data-address="ул.Михай Еминеску 39"
data-full-address="Кишинёв, Центр, ул.Михай Еминеску 39"
data-description="Просторные апартаменты в историческом центре Кишинёва. Высокие потолки, панорамные окна с видом на город. Современный ремонт с использованием качественных материалов. Большая гостиная, отдельная кухня, 2 санузла. В шаговой доступности все инфраструктурные объекты: рестораны, театры, парки.">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Modern Apartment" class="w-full h-64 object-cover">
<div class="type-tag secondary-tag">ВТОРИЧКА</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€220,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="2">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">Апартаменты в Центре</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span>Кишинёв, Центр, ул.Михай Еминеску 39</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">120 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Комнат</div>
<div class="font-semibold">3</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Этаж</div>
<div class="font-semibold">7/12</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="2" data-price="220000">
Подробнее
</button>
</div>
</div>
<!-- Property 3 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O3" data-city="Кишинёв" data-district="Рышкановка"
data-type="premium" data-rieltor-id="3"
data-price="380000" data-coords="47.038673, 28.770806"
data-address="ул. Албишоара 42"
data-area="180" data-rooms="4"
data-full-address="Кишинёв, Рышкановка, Мирона Костин 8">
<div class="relative">
<img src="https://images.unsplash.com/photo-1605276374104-dee2a0ed3cd6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Penthouse" class="w-full h-64 object-cover">
<div class="type-tag premium-tag">ПРЕМИУМ</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€380,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="3">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">Пентхаус на Рышкановке</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span>Кишинёв, Рышкановка, ул. Мирона Костин 8</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">180 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Комнат</div>
<div class="font-semibold">4</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Этаж</div>
<div class="font-semibold">12</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="3" data-price="380000">
Подробнее
</button>
</div>
</div>
<!-- Property 4 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O4" data-city="Вадул-луй-Водэ" data-district="Центр"
data-type="premium" data-rieltor-id="4"
data-price="320000" data-coords="47.087155, 29.082526"
data-address="ул. Штефан чел Маре 22"
data-area="300" data-rooms="6" data-land="15"
data-full-address="Вадул-луй-Водэ, ул. Штефан чел Маре 22">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Country House" class="w-full h-64 object-cover">
<div class="type-tag premium-tag">ПРЕМИУМ</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€320,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="4">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">Загородный дом в Вадул-луй-Водэ</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span>Вадул-луй-Водэ, ул. Штефан чел Маре 22</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">300 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Комнат</div>
<div class="font-semibold">6</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Участок</div>
<div class="font-semibold">15 сот</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="4" data-price="320000">
Подробнее
</button>
</div>
</div>
<!-- Property 5 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O5" data-city="Кишинёв" data-district="Центр" data-type="commercial" data-coords="47.026676, 28.838697" data-rieltor-id="1"
data-price="280000" data-area="150" data-rooms="8" data-floors="3"
data-full-address="Кишинёв, Центр, ул. Александр Пушкин 44/1"
data-description="Просторное офисное помещение в центре Кишинёва. 8 отдельных кабинетов, переговорная комната, кухня-столовая, 2 санузла. Современный ремонт, панорамные окна с видом на город. Отличная транспортная доступность, охраняемая парковка.">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600607688969-a5bfcd646154?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Office Space" class="w-full h-64 object-cover">
<div class="type-tag commercial-tag">КОММЕРЧЕСКАЯ</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€280,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="1">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">Офисное помещение</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span>Кишинёв, Центр, ул. Александр Пушкин 44/1</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">150 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Кабинетов</div>
<div class="font-semibold">8</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Этаж</div>
<div class="font-semibold">3</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="5" data-price="280000">
Подробнее
</button>
</div>
</div>
<!-- Property 6 -->
<div class="property-card glass-effect rounded-xl overflow-hidden transition duration-500 ease-in-out hover:shadow-lg"
data-id="O6" data-city="Кишинёв" data-district="Чеканы" data-type="newbuilding" data-coords="47.042654, 28.89339" data-rieltor-id="2"
data-price="190000" data-area="90" data-rooms="2" data-floors="5"
data-full-address="Кишинёв, Чеканы, ул. Петру Заднипру 14"
data-description="Современные апартаменты в новом жилом комплексе на Чеканах. Просторная гостиная с кухней-нишей, 2 спальни, санузел. Лоджия с панорамным остеклением. Подземный паркинг, детская площадка, зона отдыха. Отличная инфраструктура района.">
<div class="relative">
<img src="https://images.unsplash.com/photo-1600566752355-35792bedcfea?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury Apartment" class="w-full h-64 object-cover">
<div class="type-tag newbuilding-tag">НОВОСТРОЙ</div>
<div class="price-tag gold-bg text-black font-bold px-4 py-2 rounded-full">
€190,000
</div>
<div class="agent-badge">
<img src="" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover agent-photo" data-rieltor-id="2">
</div>
</div>
<div class="p-6">
<h3 class="text-xl font-semibold mb-2">Апартаменты на Чеканах</h3>
<div class="flex items-center text-gray-400 mb-4">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span>Кишинёв, Чеканы, ул. Петру Заднипру 14</span>
</div>
<div class="grid grid-cols-3 gap-2 mb-4">
<div class="text-center">
<div class="text-sm text-gray-400">Площадь</div>
<div class="font-semibold">90 м²</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Комнат</div>
<div class="font-semibold">2</div>
</div>
<div class="text-center">
<div class="text-sm text-gray-400">Этаж</div>
<div class="font-semibold">5</div>
</div>
</div>
<button class="view-details-btn w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300" data-property="6" data-price="190000">
Подробнее
</button>
</div>
</div>
</div>
<div class="text-center mt-12">
<button id="load-more-btn" class="gold-bg text-black font-bold py-3 px-8 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300">
Показать ещё <i class="fas fa-chevron-down ml-2"></i>
</button>
<button id="close-btn" class="hidden btn-close text-white font-bold py-3 px-8 rounded-lg hover:bg-gray-800 transition duration-300">
Закрыть <i class="fas fa-chevron-up ml-2"></i>
</button>
</div>
</div>
</section>
<!-- Property Map Section -->
<section class="py-20 bg-black slide-up">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-3xl md:text-4xl font-bold mb-4 gold-text">Наши объекты на карте</h2>
<div class="w-20 h-1 gold-bg mx-auto mb-6"></div>
<p class="text-gray-400 max-w-2xl mx-auto">Исследуйте расположение нашей недвижимости на интерактивной карте</p>
</div>
<div class="map-container glass-effect rounded-xl overflow-hidden">
<div id="main-map" style="height: 100%;"></div>
</div>
</div>
</section>
<!-- Agents Section -->
<section id="agents" class="py-20 bg-gradient-to-b from-gray-900 to-black slide-up">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-3xl md:text-4xl font-bold mb-4 gold-text">Наши специалисты</h2>
<div class="w-20 h-1 gold-bg mx-auto mb-6"></div>
<p class="text-gray-400 max-w-2xl mx-auto">Профессиональные риелторы с многолетним опытом работы на рынке недвижимости</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8" id="agents-container">
<!-- Agents will be populated from JavaScript -->
</div>
<div class="text-center mt-12">
<button id="load-more-agents-btn" class="gold-bg text-black font-bold py-3 px-8 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300">
Показать ещё <i class="fas fa-chevron-down ml-2"></i>
</button>
<button id="close-agents-btn" class="hidden text-white font-bold py-3 px-8 rounded-lg hover:bg-gray-800 transition duration-300">
Закрыть <i class="fas fa-chevron-up ml-2"></i>
</button>
</div>
</div>
</section>
<!-- About Company Section -->
<section id="about" class="py-20 bg-black slide-up">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-3xl md:text-4xl font-bold mb-4 gold-text">О компании</h2>
<div class="w-20 h-1 gold-bg mx-auto mb-6"></div>
</div>
<div class="flex flex-col lg:flex-row items-center gap-12">
<div class="lg:w-1/2 order-2 lg:order-1">
<div class="glass-effect rounded-xl p-8">
<h3 class="text-2xl font-semibold mb-6 gold-text">Venera Rielt</h3>
<p class="text-gray-400 mb-4">Мы — лидер на рынке элитной недвижимости Молдовы с 2010 года. Наша компания специализируется на премиальном сегменте жилой и коммерческой недвижимости.</p>
<p class="text-gray-400 mb-4">Наш подход сочетает в себе глубокое знание местного рынка, международные стандарты работы и индивидуальный подход к каждому клиенту.</p>
<p class="text-gray-400 mb-6">За годы работы мы помогли более 500 клиентам найти свой идеальный дом или выгодно инвестировать в недвижимость.</p>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 text-center">
<div class="glass-effect rounded-lg p-4">
<div class="text-3xl font-bold gold-text mb-2">12+</div>
<div class="text-sm text-gray-400">Лет опыта</div>
</div>
<div class="glass-effect rounded-lg p-4">
<div class="text-3xl font-bold gold-text mb-2">500+</div>
<div class="text-sm text-gray-400">Довольных клиентов</div>
</div>
<div class="glass-effect rounded-lg p-4">
<div class="text-3xl font-bold gold-text mb-2">45</div>
<div class="text-sm text-gray-400">Объектов в продаже</div>
</div>
<div class="glass-effect rounded-lg p-4">
<div class="text-3xl font-bold gold-text mb-2">100%</div>
<div class="text-sm text-gray-400">Гарантия надёжности</div>
</div>
</div>
</div>
</div>
<div class="lg:w-1/2 order-1 lg:order-2">
<div class="testimonial-carousel glass-effect rounded-xl overflow-hidden">
<!-- Testimonial 1 -->
<div class="testimonial-item active">
<img src="https://images.unsplash.com/photo-1600585152220-90363fe7e115?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury Property" class="w-full h-96 object-cover">
</div>
<!-- Testimonial 2 -->
<div class="testimonial-item">
<img src="https://images.unsplash.com/photo-1605146769289-440113cc3d00?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury Property" class="w-full h-96 object-cover">
</div>
<!-- Testimonial 3 -->
<div class="testimonial-item">
<img src="https://images.unsplash.com/photo-1600607688969-a5bfcd646154?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Luxury Property" class="w-full h-96 object-cover">
</div>
<!-- Navigation arrows -->
<button class="carousel-prev absolute left-4 top-1/2 transform -translate-y-1/2 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-70 transition">
<i class="fas fa-chevron-left"></i>
</button>
<button class="carousel-next absolute right-4 top-1/2 transform -translate-y-1/2 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-70 transition">
<i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="py-20 bg-gradient-to-b from-black to-gray-900 slide-up">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-3xl md:text-4xl font-bold mb-4 gold-text">Связаться с нами</h2>
<div class="w-20 h-1 gold-bg mx-auto mb-6"></div>
<p class="text-gray-400 max-w-2xl mx-auto">Оставьте свои контакты, и наш специалист свяжется с вами в ближайшее время</p>
</div>
<div class="flex flex-col lg:flex-row gap-12 justify-center">
<div class="lg:w-1/3">
<div class="glass-effect rounded-xl p-8">
<h3 class="text-2xl font-semibold mb-6 gold-text">Контактная информация</h3>
<div class="space-y-6">
<div class="flex items-start">
<div class="gold-text mr-4 mt-1">
<i class="fas fa-map-marker-alt text-xl"></i>
</div>
<div>
<h4 class="font-semibold mb-1">Адрес</h4>
<p class="text-gray-400">Молдова, Кишинёв, ул. Пушкина 42, офис 15</p>
</div>
</div>
<div class="flex items-start">
<div class="gold-text mr-4 mt-1">
<i class="fas fa-phone-alt text-xl"></i>
</div>
<div>
<h4 class="font-semibold mb-1">Телефон</h4>
<p class="text-gray-400">+373 22 123 456</p>
<p class="text-gray-400">+373 60 123 456 (Viber, WhatsApp)</p>
</div>
</div>
<div class="flex items-start">
<div class="gold-text mr-4 mt-1">
<i class="fas fa-envelope text-xl"></i>
</div>
<div>
<h4 class="font-semibold mb-1">Email</h4>
<p class="text-gray-400">info@venera-rielt.md</p>
</div>
</div>
<div class="flex items-start">
<div class="gold-text mr-4 mt-1">
<i class="fas fa-clock text-xl"></i>
</div>
<div>
<h4 class="font-semibold mb-1">Часы работы</h4>
<p class="text-gray-400">Пн-Пт: 9:00 - 18:00</p>
<p class="text-gray-400">Сб: 10:00 - 15:00</p>
</div>
</div>
<div class="pt-4">
<h4 class="font-semibold mb-4 gold-text">Мы в социальных сетях</h4>
<div class="flex space-x-4">
<a href="#" class="social-icon text-gray-400 hover:text-blue-600"><i class="fab fa-facebook-f text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-pink-600"><i class="fab fa-instagram text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-red-600"><i class="fab fa-youtube text-xl"></i></a>
<a href="https://www.tiktok.com/@venera.rielt?_t=ZN-8z4bdlOBmNy&_r=1" class="social-icon text-gray-400 hover:text-white"><i class="fab fa-tiktok text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-blue-500"><i class="fab fa-telegram text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-green-500"><i class="fab fa-whatsapp text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-purple-500"><i class="fab fa-viber text-xl"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="lg:w-1/3">
<div class="glass-effect rounded-xl p-8">
<h3 class="text-2xl font-semibold mb-6 gold-text">Форма обратной связи</h3>
<form id="contact-form">
<div class="mb-6">
<label for="name" class="block text-gray-400 mb-2">Ваше имя</label>
<input type="text" id="name" class="w-full bg-gray-800 text-white p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Введите ваше имя">
</div>
<div class="mb-6">
<label for="phone" class="block text-gray-400 mb-2">Телефон</label>
<input type="tel" id="phone" class="w-full bg-gray-800 text-white p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="+373 XX XXX XXX">
</div>
<div class="mb-6">
<label for="email" class="block text-gray-400 mb-2">Email</label>
<input type="email" id="email" class="w-full bg-gray-800 text-white p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Введите ваш email">
</div>
<div class="mb-6">
<label for="message" class="block text-gray-400 mb-2">Сообщение</label>
<textarea id="message" rows="4" class="w-full bg-gray-800 text-white p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Опишите ваш запрос"></textarea>
</div>
<button type="submit" class="w-full gold-bg text-black font-bold py-3 px-6 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300">
Отправить <i class="fas fa-paper-plane ml-2"></i>
</button>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-black py-12">
<div class="container mx-auto px-4">
<div class="flex flex-col items-center">
<div class="text-center w-full mb-4">
<h2 class="text-3xl font-bold gold-text">Venera Rielt</h2>
<div class="logo-container relative inline-block mx-auto cursor-pointer" onclick="document.getElementById('admin-panel').classList.remove('hidden'); document.body.style.overflow = 'hidden';">
<img src="https://i.ibb.co/35ZQ5g8X/logo.png" alt="Venera Rielt Logo" class="h-32 mx-auto mb-2 logo-image">
<div class="logo-glow absolute inset-0 rounded-full mx-auto"></div>
</div>
<p class="text-gray-400 mt-2">REAL ESTATE MOLDOVA</p>
</div>
<div class="mb-4">
<nav class="flex flex-wrap justify-center gap-4 md:gap-8">
<a href="#" id="footer-home-link" class="text-gray-400 hover:text-white transition">Главная</a>
<a href="#properties" class="text-gray-400 hover:text-white transition">Объекты</a>
<a href="#agents" class="text-gray-400 hover:text-white transition">Специалисты</a>
<a href="#about" class="text-gray-400 hover:text-white transition">О компании</a>
<a href="#contact" class="text-gray-400 hover:text-white transition">Контакты</a>
</nav>
</div>
<div class="flex space-x-4 mb-4">
<a href="#" class="social-icon text-gray-400 hover:text-blue-600"><i class="fab fa-facebook-f"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-pink-600"><i class="fab fa-instagram"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-red-600"><i class="fab fa-youtube"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-white"><i class="fab fa-tiktok"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-blue-500"><i class="fab fa-telegram"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-green-500"><i class="fab fa-whatsapp"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-purple-500"><i class="fab fa-viber"></i></a>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500">
<p>© 2025 Venera Rielt. Все права защищены.</p>
</div>
</div>
</footer>
<!-- Admin Panel -->
<div id="admin-panel" class="fixed inset-0 bg-black bg-opacity-90 z-50 hidden overflow-auto">
<div class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-8">
<h2 class="text-3xl font-bold gold-text">Админ-панель</h2>
<button id="close-admin-panel" class="text-white text-2xl">×</button>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Properties Management -->
<div class="glass-effect rounded-xl p-6">
<h3 class="text-2xl font-semibold mb-4 gold-text">Объекты недвижимости</h3>
<div class="mb-4">
<input type="text" id="admin-property-search"
class="w-full bg-gray-800 text-white p-3 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none"
placeholder="Поиск по объектам (название, город, район, адрес)">
</div>
<div id="properties-list" class="mb-6 max-h-96 overflow-y-auto grid grid-cols-1 sm:grid-cols-2 gap-4">
<!-- Properties will be populated here -->
</div>
<button id="add-property" class="w-full py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
Добавить объект
</button>
</div>
<!-- Agents Management -->
<div class="glass-effect rounded-xl p-6">
<h3 class="text-2xl font-semibold mb-4 gold-text">Риелторы</h3>
<div id="agents-list" class="mb-6 max-h-96 overflow-y-auto grid grid-cols-1 sm:grid-cols-2 gap-4">
<!-- Agents will be populated here -->
</div>
<button id="add-agent" class="w-full py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
Добавить риелтора
</button>
</div>
</div>
</div>
</div>
<!-- Property Edit Modal -->
<div id="property-edit-modal" class="fixed inset-0 bg-black bg-opacity-70 z-50 hidden flex items-center justify-center">
<div class="glass-effect rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div class="flex justify-between items-center mb-4">
<h3 class="text-2xl font-bold gold-text" id="property-modal-title">Редактировать объект</h3>
<button id="close-property-modal" class="text-white text-2xl">×</button>
</div>
<form id="property-edit-form">
<div class="mb-4">
<label class="block text-gray-400 mb-2">ID</label>
<input type="text" id="property-id" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" readonly>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-gray-400 mb-2">Название</label>
<input type="text" id="property-title" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Главное фото (URL)</label>
<input type="text" id="property-main-photo" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Дополнительные фото (URL, через запятую)</label>
<textarea id="property-photos" rows="3" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="https://example.com/photo1.jpg, https://example.com/photo2.jpg"></textarea>
</div>
<div>
<label class="block text-gray-400 mb-2">Город</label>
<input type="text" id="property-city" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Район</label>
<input type="text" id="property-district" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Тип</label>
<select id="property-type" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
<option value="premium">Премиум</option>
<option value="secondary">Вторичка</option>
<option value="newbuilding">Новострой</option>
<option value="rental">Аренда</option>
<option value="commercial">Коммерческая</option>
<option value="garage">Гараж</option>
<option value="parking">Парковка</option>
<option value="storage">Кладовка</option>
<option value="house">Дом</option>
<option value="land">Участок</option>
</select>
</div>
<div>
<label class="block text-gray-400 mb-2">Цена (€)</label>
<input type="number" id="property-price" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Площадь (м²)</label>
<input type="number" id="property-area" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Комнаты</label>
<input type="number" id="property-rooms" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Этаж</label>
<input type="number" id="property-floors" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Участок (соток)</label>
<input type="number" id="property-land" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div>
<label class="block text-gray-400 mb-2">Парковочные места</label>
<input type="number" id="property-parking" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div>
<label class="block text-gray-400 mb-2">Состояние</label>
<select id="property-condition" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
<option value="Евроремонт">Евроремонт</option>
<option value="Хорошее">Хорошее</option>
<option value="Среднее">Среднее</option>
<option value="Требует ремонта">Требует ремонта</option>
<option value="Серый вариант">Серый вариант</option>
<option value="Белый вариант">Белый вариант</option>
<option value="В стадии строительства">В стадии строительства</option>
</select>
</div>
<div>
<label class="block text-gray-400 mb-2">Санузел</label>
<input type="text" id="property-bathroom" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Например: Раздельный, 2 санузла">
</div>
<div>
<label class="block text-gray-400 mb-2">Балкон</label>
<input type="text" id="property-balcony" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Например: 2 балкона, лоджия">
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Полный адрес</label>
<input type="text" id="property-full-address" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Описание</label>
<textarea id="property-description" rows="3" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none"></textarea>
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Координаты (широта, долгота)</label>
<input type="text" id="property-coords" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Риелтор</label>
<select id="property-rieltor-id" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
<!-- Options will be populated by JavaScript -->
</select>
</div>
</div>
<div class="flex justify-end space-x-4">
<button type="button" id="cancel-property-edit" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition">
Отмена
</button>
<button type="submit" class="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
Сохранить
</button>
</div>
</form>
</div>
</div>
<!-- Agent Edit Modal -->
<div id="agent-edit-modal" class="fixed inset-0 bg-black bg-opacity-70 z-50 hidden flex items-center justify-center">
<div class="glass-effect rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div class="flex justify-between items-center mb-4">
<h3 class="text-2xl font-bold gold-text" id="agent-modal-title">Редактировать риелтора</h3>
<button id="close-agent-modal" class="text-white text-2xl">×</button>
</div>
<form id="agent-edit-form">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">ID риелтора</label>
<input type="number" id="agent-rieltor-id" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
<p class="text-gray-500 text-sm mt-1">Этот ID будет использоваться для связи объектов недвижимости с риелтором</p>
</div>
<div>
<label class="block text-gray-400 mb-2">Имя</label>
<input type="text" id="agent-name" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Должность</label>
<input type="text" id="agent-position" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" required>
</div>
<div>
<label class="block text-gray-400 mb-2">Телефон</label>
<input type="text" id="agent-phone" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div>
<label class="block text-gray-400 mb-2">Email</label>
<input type="email" id="agent-email" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div>
<label class="block text-gray-400 mb-2">WhatsApp</label>
<input type="text" id="agent-whatsapp" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Номер с кодом страны">
</div>
<div>
<label class="block text-gray-400 mb-2">Telegram</label>
<input type="text" id="agent-telegram" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Никнейм или номер">
</div>
<div>
<label class="block text-gray-400 mb-2">Viber</label>
<input type="text" id="agent-viber" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" placeholder="Номер с кодом страны">
</div>
<div class="md:col-span-2">
<label class="block text-gray-400 mb-2">Фото (URL)</label>
<input type="text" id="agent-photo" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none">
</div>
<div class="md:col-span-2 hidden">
<label class="block text-gray-400 mb-2">ID</label>
<input type="text" id="agent-id" class="w-full bg-gray-800 text-white p-2 rounded-lg border border-gray-700 focus:border-gold-500 focus:outline-none" readonly>
</div>
</div>
<div class="flex justify-end space-x-4">
<button type="button" id="cancel-agent-edit" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition">
Отмена
</button>
<button type="submit" class="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
Сохранить
</button>
</div>
</form>
</div>
</div>
<!-- Map Overlay -->
<div id="map-overlay" class="map-overlay">
<button id="map-overlay-close" class="map-overlay-close">
<i class="fas fa-times"></i>
</button>
<div id="map-overlay-container" class="map-overlay-container"></div>
</div>
<!-- Property Details Overlay -->
<div id="property-overlay" class="overlay">
<div class="property-details glass-effect rounded-xl max-w-4xl w-full relative">
<button class="close-overlay absolute top-4 right-4 text-white text-2xl z-50 hover:text-gold-500">
<i class="fas fa-times"></i>
</button>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-0">
<div class="relative">
<!-- Carousel -->
<div class="property-carousel relative">
<div class="carousel-item active">
<img src="https://images.unsplash.com/photo-1564013799919-ab600027ffc6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Property" class="w-full h-full object-cover rounded-tl-xl lg:rounded-bl-xl lg:rounded-tr-none">
</div>
<div class="carousel-item">
<img src="https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Property" class="w-full h-full object-cover rounded-tl-xl lg:rounded-bl-xl lg:rounded-tr-none">
</div>
<div class="carousel-item">
<img src="https://images.unsplash.com/photo-1600566752227-8688d0926d4b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Property" class="w-full h-full object-cover rounded-tl-xl lg:rounded-bl-xl lg:rounded-tr-none">
</div>
<!-- Carousel controls -->
<button class="carousel-prev absolute left-4 top-1/2 transform -translate-y-1/2 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-70 transition">
<i class="fas fa-chevron-left"></i>
</button>
<button class="carousel-next absolute right-4 top-1/2 transform -translate-y-1/2 bg-black bg-opacity-50 text-white p-2 rounded-full hover:bg-opacity-70 transition">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<!-- Map -->
<div class="p-4">
<h4 class="font-semibold mb-2 gold-text">Расположение</h4>
<div id="property-map" class="h-48 rounded-lg" style="background-color: #1a1a1a;"></div>
</div>
</div>
<div class="p-8">
<div class="flex justify-between items-start mb-6">
<h3 class="text-2xl font-bold">Вилла в Буюканах</h3>
<div class="gold-bg text-black font-bold px-4 py-2 rounded-full">
€450,000
</div>
</div>
<div class="flex items-center text-gray-400 mb-6">
<i class="fas fa-map-marker-alt mr-2 gold-text"></i>
<span id="property-full-address"></span>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mb-6">
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Площадь</div>
<div class="font-semibold text-gray-400">250 м²</div>
</div>
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Комнат</div>
<div class="font-semibold text-gray-400">5</div>
</div>
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Этаж</div>
<div class="font-semibold text-gray-400">2</div>
</div>
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Состояние</div>
<div class="font-semibold text-gray-400">Евроремонт</div>
</div>
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Санузел</div>
<div class="font-semibold text-gray-400">Раздельный</div>
</div>
<div class="glass-effect rounded-lg p-3 text-center">
<div class="text-sm mb-1">Балкон</div>
<div class="font-semibold text-gray-400">2 лоджии</div>
</div>
</div>
<div class="mb-6">
<h4 class="font-semibold mb-2 gold-text">Описание</h4>
<p class="text-gray-400">
Элитная вилла в престижном районе Буюканы. Просторные светлые помещения, высокие потолки, панорамные окна.
Современная отделка премиальными материалами. Кухня-гостиная с выходом на террасу и в сад.
Мастер-спальня с гардеробной и собственной ванной комнатой. Дополнительно: камин, система "умный дом",
видеонаблюдение, автономное отопление. Ухоженный сад с зоной отдыха и летней кухней.
</p>
</div>
<div class="mb-6">
<h4 class="font-semibold mb-2 gold-text">Риелтор</h4>
<div class="flex items-center">
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Agent" class="w-12 h-12 rounded-full border-2 border-white object-cover mr-4">
<div>
<div class="font-semibold">Анна Петренко</div>
<div class="text-sm text-gray-400">Старший риелтор</div>
</div>
</div>
</div>
<div class="flex flex-col sm:flex-row gap-4">
<button class="flex-1 gold-bg text-black font-bold py-3 px-6 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300">
<i class="fas fa-phone-alt mr-2"></i> Позвонить
</button>
<div class="flex-1 flex justify-center space-x-4 items-center bg-transparent border border-gold-500 text-white font-bold py-3 px-6 rounded-lg hover:bg-gold-500 hover:text-black transition duration-300">
<a href="#" class="social-icon text-gray-400 hover:text-green-500"><i class="fab fa-whatsapp text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-blue-500"><i class="fab fa-telegram text-xl"></i></a>
<a href="#" class="social-icon text-gray-400 hover:text-purple-500"><i class="fab fa-viber text-xl"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Admin panel search functionality
function filterAdminProperties(searchTerm) {
searchTerm = searchTerm.toLowerCase();
const propertyCards = document.querySelectorAll('.property-card');
let hasMatches = false;
propertyCards.forEach(card => {
const title = card.querySelector('h3').textContent.toLowerCase();
const city = card.dataset.city ? card.dataset.city.toLowerCase() : '';
const district = card.dataset.district ? card.dataset.district.toLowerCase() : '';
const address = card.dataset.address ? card.dataset.address.toLowerCase() : '';
const fullAddress = card.dataset.fullAddress ? card.dataset.fullAddress.toLowerCase() : '';
const coords = card.dataset.coords || '';
const rieltorId = card.dataset.rieltorId || '';
// Find agent name by rieltor ID
let agentName = '';
const agent = agents.find(a => String(a.rieltor_id) === String(rieltorId));
if (agent) {
agentName = agent.name.toLowerCase();
}
const matches = title.includes(searchTerm) ||
city.includes(searchTerm) ||
district.includes(searchTerm) ||
address.includes(searchTerm) ||
fullAddress.includes(searchTerm) ||
coords.includes(searchTerm) ||
agentName.includes(searchTerm);
// Highlight matching cards in admin panel
const adminCard = document.querySelector(`.admin-property-card[data-id="${card.dataset.id}"]`);
if (adminCard) {
if (matches || !searchTerm) {
adminCard.style.display = 'block';
hasMatches = true;
} else {
adminCard.style.display = 'none';
}
}
});
return hasMatches;
}
// Admin panel functionality
document.addEventListener('DOMContentLoaded', function() {
// Admin property search handler
document.getElementById('admin-property-search').addEventListener('input', function(e) {
filterAdminProperties(e.target.value);
});
const adminPanel = document.getElementById('admin-panel');
const closeAdminPanel = document.getElementById('close-admin-panel');
const openAdminPanelLinks = document.querySelectorAll('#admin-panel-link, #admin-panel-link-desktop');
// Open admin panel
openAdminPanelLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
adminPanel.classList.remove('hidden');
document.body.style.overflow = 'hidden';
});
});
// Close admin panel
closeAdminPanel.addEventListener('click', function() {
adminPanel.classList.add('hidden');
document.body.style.overflow = 'auto';
});
// Initialize admin panel
initAdminPanel();
});
function initAdminPanel() {
renderPropertiesList();
renderAgentsList();
}
function renderPropertiesList() {
const propertiesList = document.getElementById('properties-list');
propertiesList.innerHTML = '';
document.querySelectorAll('.property-card').forEach((card, index) => {
const title = card.querySelector('h3').textContent;
const imageSrc = card.querySelector('img').src;
const price = card.querySelector('.price-tag').textContent;
const type = card.querySelector('.type-tag').textContent;
const propertyDiv = document.createElement('div');
propertyDiv.className = 'p-3 bg-gray-800 rounded-lg flex flex-col admin-property-card';
propertyDiv.dataset.id = card.dataset.id;
propertyDiv.innerHTML = `
<div class="flex-grow">
<div class="relative mb-2">
<img src="${card.dataset.mainPhoto || imageSrc}" alt="${title}" class="w-full h-32 object-cover rounded-lg">
<div class="absolute top-1 left-1 bg-black bg-opacity-50 text-white text-xs px-2 py-1 rounded">
${type}
</div>
<div class="absolute top-1 right-1 bg-yellow-500 text-black text-xs font-bold px-2 py-1 rounded">
${price}
</div>
</div>
<h4 class="font-semibold text-sm mb-2 truncate">${title}</h4>
<div class="text-xs text-gray-400 mb-3 truncate">
<i class="fas fa-map-marker-alt mr-1"></i>
${card.dataset.fullAddress || card.dataset.address || ''}
</div>
</div>
<div class="flex justify-between mt-auto pt-2">
<button class="edit-property flex-1 text-blue-500 py-1 text-sm mr-1 bg-gray-700 rounded hover:bg-gray-600" data-index="${index}">Редактировать</button>
<button class="delete-property flex-1 text-red-500 py-1 text-sm ml-1 bg-gray-700 rounded hover:bg-gray-600" data-index="${index}">Удалить</button>
</div>
`;
propertiesList.appendChild(propertyDiv);
});
}
function renderAgentsList() {
const agentsList = document.getElementById('agents-list');
agentsList.innerHTML = '';
agents.forEach((agent, index) => {
// Count properties for this agent
const propertyCount = document.querySelectorAll(`.property-card[data-rieltor-id="${agent.rieltor_id}"]`).length;
const agentDiv = document.createElement('div');
agentDiv.className = 'p-3 bg-gray-800 rounded-lg flex flex-col';
agentDiv.innerHTML = `
<div class="flex-grow">
<div class="flex items-center mb-3">
<img src="${agent.photo}" alt="${agent.name}" class="w-12 h-12 rounded-full object-cover mr-3">
<div>
<h4 class="font-semibold text-sm">${agent.name}</h4>
<p class="text-xs text-gray-400">${agent.position}</p>
</div>
</div>
<div class="flex justify-between text-xs mb-3">
<div class="bg-gray-700 px-2 py-1 rounded">
<i class="fas fa-phone mr-1"></i> ${agent.phone}
</div>
<div class="bg-gray-700 px-2 py-1 rounded">
<i class="fas fa-envelope mr-1"></i> ${agent.email}
</div>
</div>
<div class="text-center bg-gray-700 rounded py-1">
<span class="text-xs">Объектов: <span class="font-bold">${propertyCount}</span></span>
</div>
</div>
<div class="flex justify-between mt-auto pt-2">
<button class="edit-agent flex-1 text-blue-500 py-1 text-sm mr-1 bg-gray-700 rounded hover:bg-gray-600" data-index="${index}">Редактировать</button>
<button class="delete-agent flex-1 text-red-500 py-1 text-sm ml-1 bg-gray-700 rounded hover:bg-gray-600" data-index="${index}">Удалить</button>
</div>
`;
agentsList.appendChild(agentDiv);
});
}
// Property edit modal functions
function openPropertyEditModal(index = null) {
const modal = document.getElementById('property-edit-modal');
const title = document.getElementById('property-modal-title');
// Populate realtor dropdown
populateRealtorDropdown();
if (index !== null) {
// Edit existing property
title.textContent = 'Редактировать объект';
const card = document.querySelectorAll('.property-card')[index];
const data = card.dataset;
document.getElementById('property-id').value = card.dataset.id || '';
document.getElementById('property-title').value = card.querySelector('h3').textContent;
document.getElementById('property-main-photo').value = card.querySelector('img').src || '';
document.getElementById('property-photos').value = card.dataset.photos || '';
document.getElementById('property-city').value = data.city || '';
document.getElementById('property-district').value = data.district || '';
document.getElementById('property-type').value = data.type || '';
document.getElementById('property-price').value = data.price || '';
document.getElementById('property-area').value = data.area || '';
document.getElementById('property-rooms').value = data.rooms || '';
document.getElementById('property-floors').value = data.floors || '';
document.getElementById('property-land').value = data.land || '';
document.getElementById('property-parking').value = data.parking || '';
document.getElementById('property-condition').value = data.condition || 'Евроремонт';
document.getElementById('property-bathroom').value = data.bathroom || 'Раздельный';
document.getElementById('property-balcony').value = data.balcony || '1 балкон';
document.getElementById('property-full-address').value = data.fullAddress || '';
document.getElementById('property-description').value = data.description || '';
document.getElementById('property-coords').value = data.coords || '';
// Set realtor ID in dropdown
const realtorSelect = document.getElementById('property-rieltor-id');
const realtorId = data.rieltorId || '';
if (realtorSelect.querySelector(`option[value="${realtorId}"]`)) {
realtorSelect.value = realtorId;
} else {
realtorSelect.selectedIndex = 0;
}
} else {
// Add new property
title.textContent = 'Добавить объект';
document.getElementById('property-edit-form').reset();
document.getElementById('property-id').value = '';
// Reset realtor dropdown to first option
document.getElementById('property-rieltor-id').selectedIndex = 0;
}
modal.classList.remove('hidden');
}
// Populate realtor dropdown with agents data
function populateRealtorDropdown() {
const realtorSelect = document.getElementById('property-rieltor-id');
// Clear existing options except the first one
while (realtorSelect.options.length > 1) {
realtorSelect.remove(1);
}
// Add agents as options
agents.forEach(agent => {
const option = document.createElement('option');
option.value = agent.rieltor_id;
option.textContent = `${agent.rieltor_id}: ${agent.name} (${agent.position})`;
realtorSelect.appendChild(option);
});
}
function closePropertyEditModal() {
document.getElementById('property-edit-modal').classList.add('hidden');
}
// Agent edit modal functions
function openAgentEditModal(index = null) {
const modal = document.getElementById('agent-edit-modal');
const title = document.getElementById('agent-modal-title');
if (index !== null) {
// Edit existing agent
title.textContent = 'Редактировать риелтора';
const agent = agents[index];
document.getElementById('agent-id').value = agent.id || '';
document.getElementById('agent-name').value = agent.name || '';
document.getElementById('agent-position').value = agent.position || '';
document.getElementById('agent-phone').value = agent.phone || '';
document.getElementById('agent-email').value = agent.email || '';
document.getElementById('agent-whatsapp').value = agent.whatsapp || '';
document.getElementById('agent-telegram').value = agent.telegram || '';
document.getElementById('agent-viber').value = agent.viber || '';
document.getElementById('agent-photo').value = agent.photo || '';
document.getElementById('agent-rieltor-id').value = agent.rieltor_id || '';
} else {
// Add new agent
title.textContent = 'Добавить риелтора';
document.getElementById('agent-edit-form').reset();
document.getElementById('agent-id').value = '';
}
modal.classList.remove('hidden');
}
function closeAgentEditModal() {
document.getElementById('agent-edit-modal').classList.add('hidden');
}
// Save property
function saveProperty(e) {
e.preventDefault();
const formData = new FormData(e.target);
const index = document.getElementById('property-id').value;
const isNew = index === '';
// Create property data object
const propertyData = {
id: isNew ? `O${++propertyCounter}` : document.getElementById('property-id').value,
title: document.getElementById('property-title').value,
mainPhoto: document.getElementById('property-main-photo').value,
photos: document.getElementById('property-photos').value,
city: document.getElementById('property-city').value,
district: document.getElementById('property-district').value,
type: document.getElementById('property-type').value,
price: document.getElementById('property-price').value,
area: document.getElementById('property-area').value,
rooms: document.getElementById('property-rooms').value,
floors: document.getElementById('property-floors').value,
land: document.getElementById('property-land').value,
parking: document.getElementById('property-parking').value,
condition: document.getElementById('property-condition').value,
bathroom: document.getElementById('property-bathroom').value,
balcony: document.getElementById('property-balcony').value,
fullAddress: document.getElementById('property-full-address').value,
description: document.getElementById('property-description').value,
coords: document.getElementById('property-coords').value,
rieltorId: document.getElementById('property-rieltor-id').value
};
if (isNew) {
// Add new property (in a real app, this would update the database)
console.log('Adding new property:', propertyData);
alert('Новый объект добавлен! В реальном приложении данные были бы сохранены в базе данных.');
} else {
// Update existing property (in a real app, this would update the database)
console.log('Updating property at index:', index, propertyData);
alert('Объект обновлен! В реальном приложении данные были бы сохранены в базе данных.');
}
closePropertyEditModal();
return false;
}
// Save agent
function saveAgent(e) {
e.preventDefault();
const formData = new FormData(e.target);
const index = document.getElementById('agent-id').value;
const isNew = index === '';
// Create agent data object
const agentData = {
id: isNew ? `A${++agentCounter}` : document.getElementById('agent-id').value,
name: document.getElementById('agent-name').value,
position: document.getElementById('agent-position').value,
phone: document.getElementById('agent-phone').value,
email: document.getElementById('agent-email').value,
whatsapp: document.getElementById('agent-whatsapp').value,
telegram: document.getElementById('agent-telegram').value,
viber: document.getElementById('agent-viber').value,
photo: document.getElementById('agent-photo').value,
rieltor_id: document.getElementById('agent-rieltor-id').value
};
// Update realtor dropdown in property edit form
populateRealtorDropdown();
if (isNew) {
// Add new agent (in a real app, this would update the database)
console.log('Adding new agent:', agentData);
alert('Новый риелтор добавлен! В реальном приложении данные были бы сохранены в базе данных.');
} else {
// Update existing agent (in a real app, this would update the database)
console.log('Updating agent at index:', index, agentData);
alert('Данные риелтора обновлены! В реальном приложении данные были бы сохранены в базе данных.');
}
closeAgentEditModal();
return false;
}
// Delete property
function deleteProperty(index) {
if (confirm('Вы уверены, что хотите удалить этот объект?')) {
// In a real app, this would delete from the database
console.log('Deleting property at index:', index);
alert('Объект удален! В реальном приложении данные были бы удалены из базы данных.');
}
}
// Delete agent
function deleteAgent(index) {
if (confirm('Вы уверены, что хотите удалить этого риелтора?')) {
// In a real app, this would delete from the database
console.log('Deleting agent at index:', index);
alert('Риелтор удален! В реальном приложении данные были бы удалены из базы данных.');
}
}
// Counters for unique IDs
let agentCounter = 4; // Starting after existing agents
let propertyCounter = 6; // Starting after existing properties
// Agents data with unique IDs
const agents = [
{
id: "1",
rieltor_id: 1,
name: "Анна Петренко",
position: "Старший риелтор",
phone: "+373 22 111 111",
email: "anna@venera-rielt.md",
photo: "https://randomuser.me/api/portraits/women/44.jpg",
properties_count: 0 // Will be calculated
},
{
id: "2",
rieltor_id: 2,
name: "Виктор Кожухарь",
position: "Риелтор по коммерческой недвижимости",
phone: "+373 22 111 112",
email: "viktor@venera-rielt.md",
photo: "https://randomuser.me/api/portraits/men/32.jpg",
properties_count: 8
},
{
id: "3",
rieltor_id: 3,
name: "Елена Волошина",
position: "Эксперт по загородной недвижимости",
phone: "+373 22 111 113",
email: "elena@venera-rielt.md",
photo: "https://randomuser.me/api/portraits/women/68.jpg",
properties_count: 15
},
{
id: "4",
rieltor_id: 4,
name: "Дмитрий Сырбу",
position: "Риелтор по новостройкам",
phone: "+373 22 111 114",
email: "dmitri@venera-rielt.md",
photo: "https://randomuser.me/api/portraits/men/75.jpg",
properties_count: 10
}
];
// City districts data
const cityDistricts = {
'Кишинёв': ['Все районы', 'Центр', 'Ботаника', 'Рышкановка', 'Чеканы', 'Телецентр', 'Буюканы', 'Скулянка', 'Бубуечь', 'Дурлешты', 'Ватра', 'Друмул Таберей', 'Ставчены', 'Трушены'],
'Бельцы': ['Все районы', 'Центр', 'Северный', 'Южный', 'Западный', 'Восточный'],
'Тирасполь': ['Все районы', 'Центр', 'Микрорайон', 'Кировский', 'Октябрьский'],
'Бендеры': ['Все районы', 'Центр', 'Ленинский', 'Фрунзенский'],
'Рыбница': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Кагул': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Унгень': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Сороки': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Оргеев': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Комрат': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Чадыр-Лунга': ['Все районы', 'Центр', 'Северный', 'Южный'],
'Страшены': ['Все районы', 'Центр'],
'Дрокия': ['Все районы', 'Центр'],
'Единцы': ['Все районы', 'Центр'],
'Флорешты': ['Все районы', 'Центр'],
'Резина': ['Все районы', 'Центр'],
'Глодяны': ['Все районы', 'Центр'],
'Кантемир': ['Все районы', 'Центр'],
'Леова': ['Все районы', 'Центр'],
'Ниспорены': ['Все районы', 'Центр'],
'Окница': ['Все районы', 'Центр'],
'Вадул-луй-Водэ': ['Все районы', 'Центр']
};
// Map initialization
let mainMap, propertyMap;
const propertyMarkers = [];
const markerGroups = {}; // To track markers by coordinates
// Property coordinates will be read from data-coords attribute
function initMainMap() {
mainMap = L.map('main-map').setView([47.0245, 28.8323], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '',
detectRetina: true
}).addTo(mainMap);
// Custom icons for different property types
const iconPremium = L.divIcon({
className: 'custom-icon premium-icon',
html: '<i class="fas fa-crown"></i>',
iconSize: [30, 30]
});
const iconSecondary = L.divIcon({
className: 'custom-icon secondary-icon',
html: '<i class="fas fa-home"></i>',
iconSize: [30, 30]
});
const iconNewbuilding = L.divIcon({
className: 'custom-icon newbuilding-icon',
html: '<i class="fas fa-building"></i>',
iconSize: [30, 30]
});
const iconCommercial = L.divIcon({
className: 'custom-icon commercial-icon',
html: '<i class="fas fa-briefcase"></i>',
iconSize: [30, 30]
});
const iconRental = L.divIcon({
className: 'custom-icon rental-icon',
html: '<i class="fas fa-key"></i>',
iconSize: [30, 30]
});
const iconGarage = L.divIcon({
className: 'custom-icon garage-icon',
html: '<i class="fas fa-warehouse"></i>',
iconSize: [30, 30]
});
const iconParking = L.divIcon({
className: 'custom-icon parking-icon',
html: '<i class="fas fa-parking"></i>',
iconSize: [30, 30]
});
const iconStorage = L.divIcon({
className: 'custom-icon storage-icon',
html: '<i class="fas fa-box-open"></i>',
iconSize: [30, 30]
});
const iconHouse = L.divIcon({
className: 'custom-icon house-icon',
html: '<i class="fas fa-home"></i>',
iconSize: [30, 30]
});
const iconLand = L.divIcon({
className: 'custom-icon land-icon',
html: '<i class="fas fa-tree"></i>',
iconSize: [30, 30]
});
// Collect all properties with their coordinates
const properties = [];
document.querySelectorAll('.property-card').forEach((card, index) => {
card.dataset.index = index;
const coords = card.dataset.coords;
if (!coords) {
console.warn('Property card missing coordinates:', card.querySelector('h3').textContent);
return;
}
const [latStr, lngStr] = coords.split(',');
const lat = parseFloat(latStr.trim());
const lng = parseFloat(lngStr.trim());
if (isNaN(lat) || isNaN(lng)) {
console.error('Invalid coordinates for property:', card.querySelector('h3').textContent, coords);
return;
}
properties.push({
card: card,
lat: lat,
lng: lng,
index: index
});
});
// Group properties by coordinates
const groupedProperties = {};
properties.forEach(prop => {
const key = `${prop.lat},${prop.lng}`;
if (!groupedProperties[key]) {
groupedProperties[key] = [];
}
groupedProperties[key].push(prop);
});
// Create markers for each group
Object.keys(groupedProperties).forEach(key => {
const group = groupedProperties[key];
const [lat, lng] = key.split(',').map(Number);
const firstProperty = group[0];
const card = firstProperty.card;
const title = card.querySelector('h3').textContent;
const typeTag = card.querySelector('.type-tag');
const type = typeTag ? typeTag.textContent.trim() : '';
let icon;
switch(type.toLowerCase()) {
case 'премиум':
icon = iconPremium;
break;
case 'вторичка':
icon = iconSecondary;
break;
case 'новострой':
icon = iconNewbuilding;
break;
case 'коммерческая':
icon = iconCommercial;
break;
case 'аренда':
icon = iconRental;
break;
case 'гараж':
icon = iconGarage;
break;
case 'парковка':
icon = iconParking;
break;
case 'кладовка':
icon = iconStorage;
break;
case 'дом':
icon = iconHouse;
break;
case 'участок':
icon = iconLand;
break;
default:
icon = iconPremium;
}
// If multiple properties at same location, add badge
if (group.length > 1) {
const badgeHtml = `<div style="position: relative; display: inline-block;">
${icon.options.html}
<div style="position: absolute; top: -8px; right: -8px; background: #ff0000; color: white; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: bold; border: 2px solid white;">
${group.length}
</div>
</div>`;
icon = L.divIcon({
className: icon.options.className,
html: badgeHtml,
iconSize: [30, 30]
});
}
// Create marker
const marker = L.marker([lat, lng], {
icon: icon,
title: title
}).addTo(mainMap);
// Bind popup with list of properties if multiple, or single property if one
if (group.length > 1) {
let popupContent = `<div class="map-popup-list" style="max-height: 400px; overflow-y: auto; padding: 5px;">`;
group.forEach(prop => {
const propertyCard = prop.card;
const propertyImage = propertyCard.querySelector('img').src;
const propertyTitle = propertyCard.querySelector('h3').textContent;
const propertyAddress = propertyCard.querySelector('.flex.items-center span').textContent;
const propertyPrice = propertyCard.querySelector('.price-tag').textContent;
const propertyType = propertyCard.querySelector('.type-tag').textContent;
const propertyFeatures = Array.from(propertyCard.querySelectorAll('.grid-cols-3 > div')).map(feature => ({
label: feature.querySelector('.text-sm').textContent,
value: feature.querySelector('.font-semibold').textContent
}));
popupContent += `
<div class="map-popup-mini" style="width: 250px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
<div class="relative">
<img src="${propertyImage}" alt="${propertyTitle}" class="w-full h-32 object-cover rounded-t-lg">
<div class="absolute top-2 left-2 text-[10px] font-bold px-1.5 py-0.5 rounded ${propertyType === 'ПРЕМИУМ' ? 'bg-yellow-500 text-black' : 'bg-blue-500 text-white'}">
${propertyType}
</div>
<div class="absolute top-2 right-2 bg-yellow-500 text-black font-bold text-xs px-2 py-1 rounded-full">
${propertyPrice}
</div>
</div>
<div class="p-3">
<h4 class="font-bold text-sm mb-1 truncate">${propertyTitle}</h4>
<p class="text-gray-600 text-xs mb-2 truncate">
<i class="fas fa-map-marker-alt text-yellow-500 mr-1"></i>
${propertyAddress}
</p>
<div class="grid grid-cols-3 gap-1 mb-3">
${propertyFeatures.slice(0, 3).map(feature => `
<div class="text-center">
<div class="text-xs text-gray-500">${feature.label}</div>
<div class="text-sm font-semibold">${feature.value}</div>
</div>
`).join('')}
</div>
<button class="w-full bg-yellow-500 text-black text-xs font-bold py-2 px-3 rounded hover:bg-yellow-600 transition"
onclick="openPropertyOverlay(${prop.index})">
Подробнее
</button>
</div>
</div>`;
});
popupContent += `</div>`;
marker.bindPopup(popupContent, {
maxWidth: 270,
className: 'map-popup-list-container',
closeButton: true
});
} else {
// Single property popup (existing code)
const propertyCard = card;
const propertyImage = propertyCard.querySelector('img').src;
const propertyTitle = propertyCard.querySelector('h3').textContent;
const propertyAddress = propertyCard.querySelector('.flex.items-center span').textContent;
const propertyPrice = propertyCard.querySelector('.price-tag').textContent;
const propertyType = propertyCard.querySelector('.type-tag').textContent;
const propertyFeatures = Array.from(propertyCard.querySelectorAll('.grid-cols-3 > div')).map(feature => ({
label: feature.querySelector('.text-sm').textContent,
value: feature.querySelector('.font-semibold').textContent
}));
const popupContent = `
<div class="map-popup-mini" style="width: 250px;">
<div class="relative">
<img src="${propertyImage}" alt="${propertyTitle}" class="w-full h-32 object-cover rounded-t-lg">
<div class="absolute top-2 left-2 text-[10px] font-bold px-1.5 py-0.5 rounded ${propertyType === 'ПРЕМИУМ' ? 'bg-yellow-500 text-black' : 'bg-blue-500 text-white'}">
${propertyType}
</div>
<div class="absolute top-2 right-2 bg-yellow-500 text-black font-bold text-xs px-2 py-1 rounded-full">
${propertyPrice}
</div>
</div>
<div class="p-3">
<h4 class="font-bold text-sm mb-1 truncate">${propertyTitle}</h4>
<p class="text-gray-600 text-xs mb-2 truncate">
<i class="fas fa-map-marker-alt text-yellow-500 mr-1"></i>
${propertyAddress}
</p>
<div class="grid grid-cols-3 gap-1 mb-3">
${propertyFeatures.slice(0, 3).map(feature => `
<div class="text-center">
<div class="text-xs text-gray-500">${feature.label}</div>
<div class="text-sm font-semibold">${feature.value}</div>
</div>
`).join('')}
</div>
<button class="w-full bg-yellow-500 text-black text-xs font-bold py-2 px-3 rounded hover:bg-yellow-600 transition"
onclick="openPropertyOverlay(${firstProperty.index})">
Подробнее
</button>
</div>
</div>
`;
marker.bindPopup(popupContent, {
maxWidth: 300,
minWidth: 200,
className: 'map-popup-mini-container',
closeButton: false,
offset: L.point(0, -20)
});
}
propertyMarkers.push(marker);
});
}
function initPropertyMap(lat, lng) {
// Remove existing map if it exists
if (propertyMap) {
propertyMap.remove();
propertyMap = null;
}
// Create new map
propertyMap = L.map('property-map', {
zoomControl: false,
attributionControl: false
}).setView([lat, lng], 15);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '',
detectRetina: true
}).addTo(propertyMap);
// Add marker
L.marker([lat, lng]).addTo(propertyMap);
// Force map to update its size
setTimeout(() => {
propertyMap.invalidateSize();
}, 0);
}
// Function to update districts based on selected city
function updateDistricts() {
const citySelect = document.getElementById('city');
const districtSelect = document.getElementById('district');
const selectedCity = citySelect.value;
// Clear current options
districtSelect.innerHTML = '';
// Add new options based on selected city
if (selectedCity && cityDistricts[selectedCity]) {
cityDistricts[selectedCity].forEach(district => {
const option = document.createElement('option');
option.value = district;
option.textContent = district;
districtSelect.appendChild(option);
});
} else {
// Default option if city not found
const option = document.createElement('option');
option.value = 'Все районы';
option.textContent = 'Все районы';
districtSelect.appendChild(option);
}
}
// Function to render agents with pagination
let visibleAgents = [];
let currentAgentPage = 0;
const agentsPerPage = window.innerWidth < 768 ? 3 : 4;
function renderAgents() {
const container = document.getElementById('agents-container');
container.innerHTML = '';
// Calculate agents to show
const startIndex = currentAgentPage * agentsPerPage;
const endIndex = startIndex + agentsPerPage;
visibleAgents = agents.slice(0, endIndex);
// Render visible agents
visibleAgents.forEach(agent => {
const agentHtml = `
<div class="glass-effect rounded-xl p-6 text-center transition duration-500 ease-in-out hover:shadow-lg">
<div class="agent-photo mx-auto mb-6 w-32 h-32 rounded-full overflow-hidden border-4 border-gray-700">
<img src="${agent.photo}" alt="${agent.name}" class="w-full h-full object-cover">
</div>
<h3 class="text-xl font-semibold mb-2">${agent.name}</h3>
<p class="text-gray-400 mb-4">${agent.position}</p>
<div class="gold-bg text-black font-bold px-3 py-1 rounded-full text-sm inline-block mb-4">
${agent.properties_count} объектов
</div>
<div class="flex justify-center space-x-4 mb-4">
<a href="https://wa.me/${agent.phone.replace(/\D/g, '')}" class="social-icon text-gray-400 hover:text-green-500"><i class="fab fa-whatsapp text-xl"></i></a>
<a href="https://t.me/${agent.phone.replace(/\D/g, '')}" class="social-icon text-gray-400 hover:text-blue-500"><i class="fab fa-telegram text-xl"></i></a>
<a href="viber://chat?number=${agent.phone.replace(/\D/g, '')}" class="social-icon text-gray-400 hover:text-purple-500"><i class="fab fa-viber text-xl"></i></a>
<a href="tel:${agent.phone}" class="social-icon text-gray-400 hover:text-gold-500"><i class="fas fa-phone-alt text-xl"></i></a>
</div>
<button class="w-full gold-bg text-black font-bold py-2 px-4 rounded-lg btn-gold hover:bg-yellow-600 transition duration-300"
onclick="filterByAgent(${agent.rieltor_id})">
Посмотреть объекты
</button>
</div>
`;
container.insertAdjacentHTML('beforeend', agentHtml);
});
// Update buttons visibility
const loadMoreBtn = document.getElementById('load-more-agents-btn');
const closeBtn = document.getElementById('close-agents-btn');
if (endIndex >= agents.length) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.remove('hidden');
} else {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
}
// Hide both buttons if there are less agents than initial page size
if (agents.length <= agentsPerPage) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.add('hidden');
}
}
function loadMoreAgents() {
currentAgentPage++;
renderAgents();
// Scroll to the last agent card smoothly
const agentCards = document.querySelectorAll('#agents-container > div');
if (agentCards.length > 0) {
agentCards[agentCards.length - 1].scrollIntoView({
behavior: 'smooth',
block: 'nearest'
});
}
}
function closeAgents() {
currentAgentPage = 0;
renderAgents();
document.getElementById('agents').scrollIntoView({ behavior: 'smooth' });
}
// Global variables for agent filtering
let currentFilteredAgentId = null;
let filteredProperties = [];
// Function to filter properties by agent
function filterByAgent(rieltorId) {
currentFilteredAgentId = rieltorId;
const propertyCards = document.querySelectorAll('.property-card');
filteredProperties = [];
// Collect matching properties
propertyCards.forEach(card => {
if (parseInt(card.dataset.rieltorId) === rieltorId) {
filteredProperties.push(card);
}
});
if (filteredProperties.length > 0) {
// Reset to initial visible count
const initialCount = window.innerWidth < 768 ? 5 : 6;
// Hide all properties first
propertyCards.forEach(card => card.classList.remove('visible'));
// Show initial batch
for (let i = 0; i < Math.min(initialCount, filteredProperties.length); i++) {
filteredProperties[i].classList.add('visible');
}
// Update buttons
if (filteredProperties.length > initialCount) {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
} else {
loadMoreBtn.style.display = 'none';
closeBtn.classList.add('hidden');
}
document.getElementById('properties').scrollIntoView({ behavior: 'smooth' });
} else {
alert('У этого риелтора пока нет объектов в базе.');
}
}
// Function to count properties per agent
function countAgentProperties() {
agents.forEach(agent => {
agent.properties_count = document.querySelectorAll(`.property-card[data-rieltor-id="${agent.rieltor_id}"]`).length;
});
}
// Function to update agent photos on property cards
function updateAgentPhotos() {
document.querySelectorAll('.agent-photo').forEach(img => {
const rieltorId = img.dataset.rieltorId;
const agent = agents.find(a => a.rieltor_id == rieltorId);
if (agent) {
img.src = agent.photo;
img.alt = agent.name;
}
});
}
// Initialize main map when page loads
document.addEventListener('DOMContentLoaded', function() {
countAgentProperties();
renderAgents();
initMainMap();
updateAgentPhotos();
// Set up city change event
document.getElementById('city').addEventListener('change', updateDistricts);
// Initialize districts for default city
updateDistricts();
// Show initial properties based on screen size
const initialCount = window.innerWidth < 768 ? 5 : 6;
document.querySelectorAll('.property-card').forEach((card, index) => {
if (index < initialCount) {
card.classList.add('visible');
}
});
visibleCount = initialCount;
// Add expand button to main map
const expandBtn = document.createElement('button');
expandBtn.className = 'map-expand-btn';
expandBtn.innerHTML = '<i class="fas fa-expand"></i>';
expandBtn.title = 'Развернуть карту';
document.querySelector('.map-container').appendChild(expandBtn);
// Expand map functionality
expandBtn.addEventListener('click', function() {
document.getElementById('map-overlay').classList.add('active');
// Initialize overlay map if not already initialized
if (!window.overlayMap) {
window.overlayMap = L.map('map-overlay-container', {
zoomControl: true
}).setView(mainMap.getCenter(), mainMap.getZoom());
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '',
detectRetina: true
}).addTo(window.overlayMap);
// Copy markers from main map to overlay
propertyMarkers.forEach(marker => {
const overlayMarker = L.marker(marker.getLatLng(), {
icon: marker.options.icon
}).addTo(window.overlayMap);
// Copy popup content
if (marker._popup) {
overlayMarker.bindPopup(marker._popup._content, {
maxWidth: 300,
minWidth: 200,
className: 'map-popup-mini-container',
closeButton: false,
offset: L.point(0, -20)
});
}
});
} else {
// Update view if map already exists
window.overlayMap.setView(mainMap.getCenter(), mainMap.getZoom());
}
});
// Close overlay map
document.getElementById('map-overlay-close').addEventListener('click', function() {
document.getElementById('map-overlay').classList.remove('active');
enableBodyScroll();
});
});
// Property search functionality
document.getElementById('search-form').addEventListener('submit', function(e) {
e.preventDefault();
// Get filter values
const city = document.getElementById('city').value;
const district = document.getElementById('district').value;
const propertyType = document.getElementById('property-type').value;
const minPrice = parseInt(document.getElementById('min-price').value) || 0;
const maxPrice = parseInt(document.getElementById('max-price').value) || Infinity;
const minArea = parseInt(document.getElementById('min-area').value) || 0;
const maxArea = parseInt(document.getElementById('max-area').value) || Infinity;
// Get all property cards
const propertyCards = document.querySelectorAll('.property-card');
let hasMatches = false;
// Reset pagination on new search
const isMobile = window.innerWidth < 768;
const itemsPerPage = isMobile ? 5 : 6;
visibleCount = 0;
// Filter properties
let matchingCount = 0;
const matchingCards = [];
propertyCards.forEach(card => {
const cardCity = card.dataset.city || '';
const cardDistrict = card.dataset.district || '';
const cardPrice = parseInt(card.dataset.price) || 0;
const cardArea = parseInt(card.dataset.area) || 0;
const cardType = card.dataset.type || '';
// Check filters
const cityMatch = city === 'Все города' || city === 'Все' || !city ||
city.toLowerCase() === cardCity.toLowerCase();
const districtMatch = district === 'Все районы' || district === 'Все' || !district ||
district.toLowerCase() === cardDistrict.toLowerCase();
const typeMatch = propertyType === 'Все типы' || propertyType === 'Все' || !propertyType ||
propertyType.toLowerCase() === cardType.toLowerCase() ||
(propertyType === 'Премиум' && cardType.toLowerCase() === 'premium') ||
(propertyType === 'Вторичка' && cardType.toLowerCase() === 'вторичка') ||
(propertyType === 'Новострой' && cardType.toLowerCase() === 'newbuilding') ||
(propertyType === 'Аренда' && cardType.toLowerCase() === 'rental') ||
(propertyType === 'Коммерческая' && cardType.toLowerCase() === 'commercial');
const priceMatch = cardPrice >= minPrice && cardPrice <= maxPrice;
const areaMatch = cardArea >= minArea && cardArea <= maxArea;
// Check matches and collect matching cards
if (cityMatch && districtMatch && typeMatch && priceMatch && areaMatch) {
matchingCards.push(card);
matchingCount++;
hasMatches = true;
}
card.classList.remove('visible');
});
// Show first batch of matching properties
const showCount = Math.min(itemsPerPage, matchingCount);
for (let i = 0; i < showCount; i++) {
matchingCards[i].classList.add('visible');
}
visibleCount = showCount;
// Show/hide load more button
if (matchingCount <= itemsPerPage) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.add('hidden');
} else {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
}
// Show message if no matches
if (!hasMatches) {
alert('По вашему запросу ничего не найдено. Попробуйте изменить параметры поиска.');
} else {
// Scroll to properties section
document.getElementById('properties').scrollIntoView({ behavior: 'smooth' });
}
});
// Mobile menu toggle
document.getElementById('mobile-menu-button').addEventListener('click', function() {
const menu = document.getElementById('mobile-menu');
menu.classList.toggle('hidden');
});
// Property details overlay
const viewDetailsButtons = document.querySelectorAll('.view-details-btn');
// Admin panel event listeners
document.addEventListener('click', function(e) {
// Add property
if (e.target.id === 'add-property') {
openPropertyEditModal();
}
// Add agent
if (e.target.id === 'add-agent') {
openAgentEditModal();
}
// Edit property
if (e.target.classList.contains('edit-property')) {
const index = e.target.dataset.index;
openPropertyEditModal(parseInt(index));
}
// Delete property
if (e.target.classList.contains('delete-property')) {
const index = e.target.dataset.index;
deleteProperty(parseInt(index));
}
// Edit agent
if (e.target.classList.contains('edit-agent')) {
const index = e.target.dataset.index;
openAgentEditModal(parseInt(index));
}
// Delete agent
if (e.target.classList.contains('delete-agent')) {
const index = e.target.dataset.index;
deleteAgent(parseInt(index));
}
// Close modals
if (e.target.id === 'close-property-modal' || e.target.id === 'cancel-property-edit') {
closePropertyEditModal();
}
if (e.target.id === 'close-agent-modal' || e.target.id === 'cancel-agent-edit') {
closeAgentEditModal();
}
});
// Form submissions
document.getElementById('property-edit-form').addEventListener('submit', saveProperty);
document.getElementById('agent-edit-form').addEventListener('submit', saveAgent);
// Close modals when clicking outside
document.getElementById('property-edit-modal').addEventListener('click', function(e) {
if (e.target === this) closePropertyEditModal();
});
document.getElementById('agent-edit-modal').addEventListener('click', function(e) {
if (e.target === this) closeAgentEditModal();
});
const overlay = document.getElementById('property-overlay');
const closeOverlay = document.querySelector('.close-overlay');
function disableBodyScroll() {
document.body.style.overflow = 'hidden';
document.body.style.touchAction = 'none';
}
function enableBodyScroll() {
document.body.style.overflow = '';
document.body.style.touchAction = '';
}
function openPropertyOverlay(buttonOrIndex) {
// Handle both button element and index number
const button = typeof buttonOrIndex === 'number'
? document.querySelectorAll('.view-details-btn')[buttonOrIndex]
: buttonOrIndex;
disableBodyScroll();
const propertyCard = button.closest('.property-card');
const propertyData = propertyCard.dataset;
const agentImg = propertyCard.querySelector('.agent-badge img').src;
const agentName = propertyCard.querySelector('.p-6 h3').textContent;
const propertyImg = propertyCard.querySelector('img').src;
const propertyType = propertyCard.querySelector('.type-tag').textContent;
// Update overlay with property data
document.querySelector('#property-overlay .p-8 h3').textContent = agentName;
const price = button.dataset.price ? `€${parseInt(button.dataset.price).toLocaleString()}` : `€${parseInt(propertyData.price || '0').toLocaleString()}`;
document.querySelector('#property-overlay .p-8 .gold-bg').textContent = price;
// Update address in overlay
const addressElement = document.querySelector('#property-overlay .flex.items-center span');
addressElement.textContent = propertyData.fullAddress || `${propertyData.city || ''}, ${propertyData.district || ''}, ${propertyData.address || ''}`.replace(/, , /g, ', ').replace(/^, |, $/g, '');
// Update property features
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(1) div.font-semibold').textContent = `${propertyData.area} м²`;
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(2) div.font-semibold').textContent = propertyData.rooms;
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(3) div.font-semibold').textContent = propertyData.floors || '1';
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(4) div.font-semibold').textContent = propertyData.condition || 'Евроремонт';
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(5) div.font-semibold').textContent = propertyData.bathroom || 'Раздельный';
document.querySelector('#property-overlay .grid-cols-2 div:nth-child(6) div.font-semibold').textContent = propertyData.balcony || '1 балкон';
// Update description
document.querySelector('#property-overlay .p-8 p.text-gray-400').textContent =
propertyData.description || 'Описание данного объекта недвижимости.';
// Update agent info if exists
const rieltorId = propertyCard.dataset.rieltorId;
const agentInfoContainer = document.querySelector('#property-overlay .mb-6:has(h4.gold-text)');
if (rieltorId) {
const agent = agents.find(a => a.rieltor_id == rieltorId);
if (agent) {
agentInfoContainer.style.display = 'block';
document.querySelector('#property-overlay .flex.items-center img').src = agent.photo;
document.querySelector('#property-overlay .flex.items-center .font-semibold').textContent = agent.name;
document.querySelector('#property-overlay .flex.items-center .text-sm').textContent = agent.position;
// Update contact buttons
const callBtn = document.querySelector('#property-overlay button:has(i.fa-phone-alt)');
callBtn.innerHTML = `<i class="fas fa-phone-alt mr-2"></i> ${agent.phone}`;
callBtn.onclick = function() { window.location.href = `tel:${agent.phone}`; };
const whatsappBtn = document.querySelector('#property-overlay a:has(i.fa-whatsapp)');
whatsappBtn.href = `https://wa.me/${agent.phone.replace(/\D/g, '')}`;
const telegramBtn = document.querySelector('#property-overlay a:has(i.fa-telegram)');
telegramBtn.href = `https://t.me/${agent.phone.replace(/\D/g, '')}`;
const viberBtn = document.querySelector('#property-overlay a:has(i.fa-viber)');
viberBtn.href = `viber://chat?number=${agent.phone.replace(/\D/g, '')}`;
}
} else {
agentInfoContainer.style.display = 'none';
}
// Update images in carousel
const carouselItems = document.querySelectorAll('.property-carousel .carousel-item');
carouselItems.forEach(item => {
item.querySelector('img').src = propertyImg;
});
// Get coordinates from property card and init map
const coords = propertyCard.dataset.coords;
if (coords) {
const [lat, lng] = coords.split(',').map(Number);
setTimeout(() => {
initPropertyMap(lat, lng);
}, 100);
} else {
// Default coordinates if no coords specified
setTimeout(() => {
initPropertyMap(47.0245, 28.8323);
}, 100);
}
overlay.classList.add('active');
document.body.style.overflow = 'hidden';
}
viewDetailsButtons.forEach(button => {
button.addEventListener('click', function(e) {
e.preventDefault();
openPropertyOverlay(this);
});
});
closeOverlay.addEventListener('click', function(e) {
e.preventDefault();
overlay.classList.remove('active');
enableBodyScroll();
// Clean up map when overlay closes
if (propertyMap) {
propertyMap.remove();
propertyMap = null;
}
});
// Close overlay when clicking outside content
overlay.addEventListener('click', function(e) {
if (e.target === overlay) {
overlay.classList.remove('active');
enableBodyScroll();
}
});
// Close overlay when clicking outside content
overlay.addEventListener('click', function(e) {
if (e.target === overlay) {
overlay.classList.remove('active');
document.body.style.overflow = 'auto';
}
});
// Carousel functionality for property details
let currentPropertySlide = 0;
const propertySlides = document.querySelectorAll('.property-carousel .carousel-item');
const propertyPrev = document.querySelector('.property-carousel .carousel-prev');
const propertyNext = document.querySelector('.property-carousel .carousel-next');
function showPropertySlide(n) {
propertySlides.forEach(slide => slide.classList.remove('active'));
currentPropertySlide = (n + propertySlides.length) % propertySlides.length;
propertySlides[currentPropertySlide].classList.add('active');
}
propertyPrev.addEventListener('click', () => showPropertySlide(currentPropertySlide - 1));
propertyNext.addEventListener('click', () => showPropertySlide(currentPropertySlide + 1));
// Testimonial carousel
let currentTestimonial = 0;
const testimonials = document.querySelectorAll('.testimonial-item');
const testimonialPrev = document.querySelector('.carousel-prev');
const testimonialNext = document.querySelector('.carousel-next');
function showTestimonial(n) {
testimonials.forEach(testimonial => testimonial.classList.remove('active'));
currentTestimonial = (n + testimonials.length) % testimonials.length;
testimonials[currentTestimonial].classList.add('active');
}
testimonialPrev.addEventListener('click', () => showTestimonial(currentTestimonial - 1));
testimonialNext.addEventListener('click', () => showTestimonial(currentTestimonial + 1));
// Auto-rotate testimonials
setInterval(() => {
showTestimonial(currentTestimonial + 1);
}, 5000);
// Reset page to initial state function
function resetPage() {
// 1. Reset search filters
document.getElementById('search-form').reset();
updateDistricts(); // Reset districts dropdown
// 2. Show initial properties count based on screen size
const initialCount = window.innerWidth < 768 ? 5 : 6;
let visibleProperties = 0;
document.querySelectorAll('.property-card').forEach((card, index) => {
card.classList.remove('hidden'); // Make sure all cards are visible for filtering
if (index < initialCount) {
card.classList.add('visible');
visibleProperties++;
} else {
card.classList.remove('visible');
}
});
// 3. Update pagination buttons
visibleCount = visibleProperties;
const totalProperties = document.querySelectorAll('.property-card').length;
// 5. Hide "Show more" button if there are no more properties to load
if (visibleCount >= totalProperties) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.add('hidden');
} else {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
}
// Reset agents to initial state
const initialAgentsCount = 4;
document.querySelectorAll('#agents .glass-effect').forEach((card, index) => {
if (index < initialAgentsCount) {
card.classList.remove('hidden');
} else {
card.classList.add('hidden');
}
});
// Close any open overlays
overlay.classList.remove('active');
document.getElementById('map-overlay').classList.remove('active');
document.body.style.overflow = 'auto';
// Close mobile menu if open
document.getElementById('mobile-menu').classList.add('hidden');
// Scroll to top smoothly
window.scrollTo({
top: 0,
behavior: 'smooth'
});
// Reset main map view
if (mainMap) {
mainMap.setView([47.0245, 28.8323], 13);
}
}
// Reset page function
function resetPage() {
// 1. Close all overlays
document.getElementById('property-overlay').classList.remove('active');
document.getElementById('map-overlay').classList.remove('active');
enableBodyScroll();
// 2. Reset search form and agent filter
document.getElementById('search-form').reset();
updateDistricts();
currentFilteredAgentId = null;
filteredProperties = [];
// 3. Reset properties to initial state
const initialCount = window.innerWidth < 768 ? 5 : 6;
document.querySelectorAll('.property-card').forEach((card, index) => {
if (index < initialCount) {
card.classList.add('visible');
} else {
card.classList.remove('visible');
}
});
// 4. Reset buttons
loadMoreBtn.style.display = document.querySelectorAll('.property-card').length > initialCount ? 'inline-flex' : 'none';
closeBtn.classList.add('hidden');
// 5. Reset agents to initial state
currentAgentPage = 0;
renderAgents();
// 6. Close mobile menu if open
document.getElementById('mobile-menu').classList.add('hidden');
// 7. Scroll to top
window.scrollTo({
top: 0,
behavior: 'smooth'
});
// 8. Reset map view if exists
if (mainMap) {
mainMap.setView([47.0245, 28.8323], 13);
}
}
// Reset page when clicking logo or home links
document.querySelectorAll('#home-link, #mobile-home-link, #footer-home-link, #logo-link').forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
resetPage();
});
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href');
if (targetId === '#') return;
const targetElement = document.querySelector(targetId);
if (targetElement) {
window.scrollTo({
top: targetElement.offsetTop - 80,
behavior: 'smooth'
});
// Close mobile menu if open
const mobileMenu = document.getElementById('mobile-menu');
mobileMenu.classList.add('hidden');
}
});
});
// Initialize agents on page load
renderAgents();
// Handle window resize to update pagination
window.addEventListener('resize', function() {
const newAgentsPerPage = window.innerWidth < 768 ? 3 : 4;
if (newAgentsPerPage !== agentsPerPage) {
currentAgentPage = 0;
renderAgents();
}
});
// Agents buttons handlers
document.getElementById('load-more-agents-btn').addEventListener('click', loadMoreAgents);
document.getElementById('close-agents-btn').addEventListener('click', closeAgents);
// Property pagination
const propertyCards = document.querySelectorAll('.property-card');
const loadMoreBtn = document.getElementById('load-more-btn');
const closeBtn = document.getElementById('close-btn');
let visibleCount = 0;
const itemsPerPage = 5;
function showNextProperties() {
const isMobile = window.innerWidth < 768;
const itemsPerPage = isMobile ? 5 : 6;
if (currentFilteredAgentId) {
// Filtered by agent - show next batch from filtered properties
const visibleCount = document.querySelectorAll('.property-card.visible').length;
const showCount = Math.min(itemsPerPage, filteredProperties.length - visibleCount);
for (let i = visibleCount; i < visibleCount + showCount; i++) {
if (filteredProperties[i]) {
filteredProperties[i].classList.add('visible');
}
}
// Update buttons
if (visibleCount + showCount >= filteredProperties.length) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.remove('hidden');
} else {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
}
} else {
// Regular pagination - show next batch from all properties
const hiddenCards = Array.from(document.querySelectorAll('.property-card:not(.visible)'));
const showCount = Math.min(itemsPerPage, hiddenCards.length);
for (let i = 0; i < showCount; i++) {
hiddenCards[i].classList.add('visible');
}
// Update buttons
const remainingHidden = document.querySelectorAll('.property-card:not(.visible)').length;
if (remainingHidden === 0) {
loadMoreBtn.style.display = 'none';
closeBtn.classList.remove('hidden');
} else {
loadMoreBtn.style.display = 'inline-flex';
closeBtn.classList.add('hidden');
}
}
}
function closeProperties() {
const initialCount = window.innerWidth < 768 ? 5 : 6;
if (currentFilteredAgentId) {
// Filtered by agent - show only initial batch
document.querySelectorAll('.property-card').forEach(card => card.classList.remove('visible'));
for (let i = 0; i < Math.min(initialCount, filteredProperties.length); i++) {
filteredProperties[i].classList.add('visible');
}
loadMoreBtn.style.display = filteredProperties.length > initialCount ? 'inline-flex' : 'none';
closeBtn.classList.add('hidden');
} else {
// Regular pagination - show initial batch
document.querySelectorAll('.property-card').forEach((card, index) => {
if (index < initialCount) {
card.classList.add('visible');
} else {
card.classList.remove('visible');
}
});
loadMoreBtn.style.display = document.querySelectorAll('.property-card').length > initialCount ? 'inline-flex' : 'none';
closeBtn.classList.add('hidden');
}
}
// Initialize based on screen size
const initialCount = window.innerWidth < 768 ? 5 : 6;
document.querySelectorAll('.property-card').forEach((card, index) => {
if (index < initialCount) {
card.classList.add('visible');
}
});
visibleCount = initialCount;
if (propertyCards.length <= initialCount) {
loadMoreBtn.classList.add('hidden');
}
// Load more on button click
loadMoreBtn.addEventListener('click', showNextProperties);
closeBtn.addEventListener('click', closeProperties);
// Animation on scroll
const animatedElements = document.querySelectorAll('.slide-up, .fade-in');
function checkScroll() {
animatedElements.forEach(element => {
const elementTop = element.getBoundingClientRect().top;
const windowHeight = window.innerHeight;
if (elementTop < windowHeight - 100) {
element.style.opacity = '1';
element.style.transform = 'translateY(0)';
}
});
}
// Initial check
checkScroll();
// Handle window resize
window.addEventListener('resize', function() {
const initialCount = window.innerWidth < 768 ? 5 : 6;
if (visibleCount <= initialCount) {
propertyCards.forEach((card, index) => {
if (index < initialCount) {
card.classList.add('visible');
} else {
card.classList.remove('visible');
}
});
visibleCount = initialCount;
closeBtn.classList.add('hidden');
}
if (propertyCards.length <= initialCount) {
loadMoreBtn.classList.add('hidden');
} else {
loadMoreBtn.classList.remove('hidden');
}
});
// Check on scroll
window.addEventListener('scroll', checkScroll);
</script>
<script>
// Initialize EmailJS
emailjs.init("PpKk5iquwdfCvid0B");
// Handle contact form submission
document.getElementById('contact-form').addEventListener('submit', function(e) {
e.preventDefault();
const formData = {
from_name: this.querySelector('#name').value,
phone: this.querySelector('#phone').value,
email: this.querySelector('#email').value,
message: this.querySelector('#message').value
};
emailjs.send('service_2tli96l', 'template_x0ddy0m', formData)
.then(function(response) {
alert("Сообщение отправлено!");
document.getElementById('contact-form').reset();
}, function(error) {
alert("Ошибка при отправке");
console.error('EmailJS error:', error);
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=DISSASTER/vr1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Venera Rielt | Premium Real Estate Moldova</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script src="https://cdn.jsdelivr.net/npm/emailjs-com@2/dist/email.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--gold: #FFD700;
--black: #000000;
--white: #FFFFFF;
--glass: rgba(255, 255, 255, 0.05);
--glass-border: rgba(255, 255, 255, 0.1);
--glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
body {
font-family: 'Montserrat', sans-serif;
background-color: var(--black);
color: var(--white);
overflow-x: hidden;
}
.glass-effect {
background: var(--glass);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid var(--glass-border);
box-shadow: var(--glass-shadow);
}
.gold-text {
color: var(--gold);
}
.logo-container {
position: relative;
}
.logo-image {
position: relative;
z-index: 2;
}
.logo-glow {
position: absolute;
width: 128px;
height: 128px;
background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(255,215,0,0) 70%);
filter: blur(15px);
z-index: 1;
animation: pulseGlow 3s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
0% {
opacity: 0.5;
transform: scale(0.95);
}
100% {
opacity: 1;
transform: scale(1.05);
}
}
.gold-border {
border-color: var(--gold);
}
.gold-bg {
background-color: var(--gold);
}
.neon-glow {
box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
.hero-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
opacity: 0.7;
}
.property-card,
#agents .glass-effect.hidden {
display: none;
}
.property-card:hover {
transform: translateY(-10px);