/
Seler1ty
/
Project_Sber
Обзор
Документация
Войти
/
Seler1ty
/
Project_Sber
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
type1(dev)/style.css
716 строк
14 KB
DarkusBlake
Create: index.html, style.css, city.js, layers.js, main.js, map.js, search.js, ui.js, utils.js
15 июн 2026, 19:52
Верифицирован
15 июн 2026, 19:52
0314866
Код
Авторство
О чём код?
* { margin: 0; padding: 0; box-sizing: border-box; } .leaflet-attribution-flag { display: none !important; } /* Улучшенное позиционирование контролов Leaflet */ .leaflet-top.leaflet-left { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; } .leaflet-top.leaflet-left .leaflet-control-zoom { order: 1; margin-bottom: 0; } .leaflet-top.leaflet-left .leaflet-bar { order: 2; margin-bottom: 0; } /* CSS переменная для динамического отступа */ :root { --safe-bottom: 0px; --nav-bar-height: 0px; } body { font-family: 'Inter', sans-serif; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); overflow: hidden; position: relative; } .controls { background: rgba(255, 255, 255, 0.95); padding: 15px; border-bottom: 2px solid #e0e0e0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); z-index: 1000; flex-shrink: 0; } .city-selector { margin-bottom: 15px; } .city-selector h1 { font-size: 1.4rem; color: #2c3e50; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; } .city-buttons { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; } .city-btn { flex: 1; min-width: 120px; padding: 12px 20px; background: #f8f9fa; border: 2px solid #dee2e6; border-radius: 10px; font-size: 1rem; font-weight: 600; color: #495057; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 8px; } .city-btn:hover { background: #e9ecef; transform: translateY(-2px); } .city-btn.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-color: #667eea; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); } #map { flex: 1; min-height: 0; width: 100%; z-index: 1; position: relative; } /* Панель слоёв (инструменты) - в левом нижнем углу карты */ .layers-panel { position: absolute; bottom: calc(20px + var(--nav-bar-height)); left: 20px; background: rgba(255, 255, 255, 0.95); padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); z-index: 1002; min-width: 180px; backdrop-filter: blur(5px); border: 1px solid rgba(0, 0, 0, 0.1); transition: all 0.2s ease; } .layers-panel:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); } .layers-panel h4 { margin-bottom: 12px; color: #2c3e50; font-size: 1rem; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e0e0e0; padding-bottom: 8px; } .layer-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.9rem; color: #333; cursor: pointer; } .layer-item span { display: flex; align-items: center; gap: 8px; } /* Переключатель слоёв */ .layer-switch { position: relative; display: inline-block; width: 44px; height: 24px; } .layer-switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.3s; border-radius: 24px; } .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; } input:checked + .slider { background-color: #4CAF50; box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); } input:checked + .slider:before { transform: translateX(20px); } /* Информационная панель - динамически создаётся, поверх карты */ .info-panel { position: fixed; top: 150px; right: 20px; width: 320px; background: white; z-index: 10000; padding: 20px; border-radius: 12px; box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3); max-height: calc(100vh - 180px - var(--nav-bar-height)); overflow-y: auto; border: 1px solid rgba(0, 0, 0, 0.08); font-family: 'Inter', sans-serif; animation: slideInRight 0.3s ease; } /* Анимация появления панели */ @keyframes slideInRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } } .info-placeholder { color: #888; text-align: center; font-style: italic; padding: 20px 0; } .info-details { animation: fadeIn 0.3s ease; } .info-title { font-size: 1.3rem; font-weight: 700; color: #2c3e50; margin-bottom: 5px; border-bottom: 2px solid #e0e0e0; padding-bottom: 10px; overflow: hidden; } /* Статистика */ .info-stats { display: flex; gap: 12px; margin: 15px 0; flex-wrap: wrap; } .info-stat-card { flex: 1; background: #f8f9fa; border-radius: 12px; padding: 12px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } .info-stat-number { font-size: 1.5rem; font-weight: 700; color: #2c3e50; } .info-stat-label { font-size: 0.75rem; color: #6c757d; text-transform: uppercase; letter-spacing: 0.5px; } .quality-badge { display: inline-block; padding: 6px 12px; border-radius: 20px; font-weight: 600; font-size: 0.9rem; margin: 10px 0; } .quality-badge.level-1 { background: #ffebee; color: #c62828; } .quality-badge.level-2 { background: #fff8e1; color: #f57f17; } .quality-badge.level-3 { background: #e8f5e9; color: #2e7d32; } /* Таблица парков */ .parks-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.85rem; } .parks-table th { background: #e9ecef; padding: 8px; text-align: left; } .parks-table td { padding: 6px 8px; border-bottom: 1px solid #dee2e6; } .parks-table tr:hover { background: #f1f3f5; } .total-green-area { background: #d4edda; padding: 8px; border-radius: 8px; margin-bottom: 10px; font-size: 0.9rem; text-align: center; } .info-additional { margin-top: 15px; padding-top: 10px; border-top: 1px solid #e0e0e0; font-size: 0.85rem; color: #495057; } .info-additional div { margin-bottom: 6px; } /* Кнопка легенды - слева, над панелью инструментов */ .legend-btn { position: absolute; bottom: calc(20px + 180px + 15px + var(--nav-bar-height)); left: 20px; background: #2c3e50; color: white; border: none; border-radius: 50px; padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer; z-index: 1003; display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); transition: all 0.3s ease; font-family: 'Inter', sans-serif; } .legend-btn:hover { background: #1a252f; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); } /* Модальное окно легенды */ .legend-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); animation: fadeIn 0.3s ease; } .legend-modal-content { background-color: white; margin: 10% auto; padding: 0; border-radius: 16px; width: 90%; max-width: 350px; box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3); animation: slideIn 0.3s ease; font-family: 'Inter', sans-serif; } .legend-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 2px solid #e0e0e0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 16px 16px 0 0; } .legend-modal-header h3 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; } .legend-close { font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.3s; line-height: 1; } .legend-close:hover { opacity: 0.7; transform: scale(1.1); } .legend-modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; } .legend-modal-body h4 { margin: 15px 0 10px 0; color: #2c3e50; font-size: 1rem; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e0e0e0; padding-bottom: 6px; } .legend-modal-body h4:first-of-type { margin-top: 0; } .legend-modal-body .legend-item { display: flex; align-items: center; margin-bottom: 10px; font-size: 0.9rem; } .legend-modal-body .legend-color { width: 24px; height: 24px; border-radius: 4px; margin-right: 12px; border: 1px solid #ccc; } /* Спиннер загрузки */ .loading-spinner { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); padding: 20px 30px; border-radius: 16px; display: none; flex-direction: column; align-items: center; gap: 12px; z-index: 10001; color: white; font-size: 14px; font-weight: 500; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.2); } .loading-spinner .spinner { width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.3); border-top: 3px solid #4CAF50; border-radius: 50%; animation: spin 1s linear infinite; } .loading-spinner .loading-text { font-size: 14px; letter-spacing: 0.5px; } /* Поиск */ .custom-search { background: white !important; padding: 5px !important; border-radius: 4px !important; box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important; display: flex !important; gap: 5px !important; } .custom-search input { padding: 8px 12px !important; border: 1px solid #ddd !important; border-radius: 3px !important; font-size: 14px !important; width: 220px !important; outline: none !important; } .custom-search input:focus { border-color: #4CAF50 !important; } .custom-search button { padding: 8px 12px !important; background: #4CAF50 !important; color: white !important; border: none !important; border-radius: 3px !important; cursor: pointer !important; transition: background 0.2s !important; } .custom-search button:hover { background: #45a049 !important; } .search-marker { background: #4CAF50; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 2px solid white; box-shadow: 0 2px 4px rgba(0,0,0,0.3); font-weight: bold; } .temp-marker { animation: pulse 0.5s ease-out; } @keyframes pulse { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } } /* Popup стили */ .leaflet-popup-content { min-width: 200px; font-size: 13px; } .leaflet-popup-content button { width: 100%; padding: 5px; background: #4CAF50; color: white; border: none; border-radius: 3px; cursor: pointer; margin-top: 5px; } .leaflet-popup-content button:hover { background: #45a049; } /* Анимации */ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Адаптивные стили */ @media (max-width: 768px) { .controls { padding: 10px; } .city-selector h1 { font-size: 1.2rem; } .city-btn { min-width: 100px; padding: 10px 15px; font-size: 0.9rem; } .info-panel { width: 260px; padding: 15px; max-height: calc(100vh - 200px - var(--nav-bar-height)); right: 10px; top: 10px; } .layers-panel { bottom: calc(10px + var(--nav-bar-height)); left: 10px; min-width: 160px; padding: 10px; } .legend-btn { bottom: calc(10px + 160px + 10px + var(--nav-bar-height)); left: 10px; padding: 10px 16px; font-size: 12px; } .legend-modal-content { width: 95%; margin: 20% auto; } .legend-modal-body { max-height: 70vh; } } @media (max-width: 480px) { .loading-spinner { padding: 15px 25px; } .loading-spinner .spinner { width: 30px; height: 30px; } .custom-toast { font-size: 12px !important; padding: 8px 16px !important; white-space: normal !important; text-align: center; max-width: 90%; } .custom-search input { width: 160px !important; padding: 6px 10px !important; font-size: 12px !important; } .custom-search button { padding: 6px 10px !important; } } /* Защита от перекрытия на совсем маленьких экранах */ @media (max-width: 380px) { .layers-panel { bottom: calc(5px + var(--nav-bar-height)); padding: 8px; min-width: 140px; } .legend-btn { bottom: calc(5px + 140px + 5px + var(--nav-bar-height)); padding: 8px 14px; font-size: 11px; } .layer-item { gap: 8px; margin-bottom: 8px; font-size: 0.8rem; } .layers-panel h4 { margin-bottom: 8px; font-size: 0.85rem; } }