Skip to content

Commit

Permalink
upd. nav (adaptation)
Browse files Browse the repository at this point in the history
  • Loading branch information
GamingHackintosh committed Jul 5, 2024
1 parent 54a9390 commit b6db84d
Show file tree
Hide file tree
Showing 10 changed files with 2,974 additions and 2,690 deletions.
7 changes: 1 addition & 6 deletions assets/CSS/adaptation.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,7 @@
}
}

/*=== History-Map.css ===*/
@media (max-width: 768px) {
.map-container {
width: 90%;
}
}



/* Стили для планшетов */
Expand Down
2 changes: 0 additions & 2 deletions assets/CSS/font.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
@font-face {
font-family: 'Header-TITLE';
src: url('../fonts/MorfinSans-Regular.ttf') format('truetype');
/* ... */
}
@font-face {
font-family: 'Header-DESC';
src: url('../fonts/dance_partner_0.ttf') format('truetype');
/* ... */
}
2 changes: 1 addition & 1 deletion assets/CSS/history-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
align-items: center;
background-color: #4C4945;
padding: 15px;
border-radius: 15px;
border-radius: 30px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

Expand Down
6 changes: 5 additions & 1 deletion assets/CSS/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
display: inline-flex;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
Expand All @@ -44,4 +44,8 @@
}
.nav-list a:active {
background-color: #3E280B;
}
.nav-list a.active {
background-color: #A67B5B;
color: #F7E1C8;
}
9 changes: 9 additions & 0 deletions assets/JS/Nav-Visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ document.addEventListener('DOMContentLoaded', function () {
});
}

// Функция для установки активного класса на выбранную ссылку
function setActiveLink(link) {
navLinks.forEach(navLink => {
navLink.classList.remove('active');
});
link.classList.add('active');
}

// Добавление события клика на элементы навигации
navLinks.forEach(link => {
link.addEventListener('click', function (e) {
e.preventDefault();
const sectionId = this.getAttribute('data-section');
showSection(sectionId);
setActiveLink(this);
});
});

Expand Down
36 changes: 24 additions & 12 deletions assets/JS/initial-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ document.addEventListener("DOMContentLoaded", function () {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

// Загружаем данные из date.json
fetch('assets/data/date.json')
.then(response => response.json())
.then(data => {
data.dates.forEach(event => {
// Добавляем метку для каждого события
L.marker([event.latitude, event.longitude]).addTo(map)
.bindPopup(`<b>${event.name}</b><br>${event.description}`);
});
})
.catch(error => console.error('Ошибка загрузки данных:', error));
});
// Функция для загрузки JSON данных
function loadJSON(url, callback) {
var xhr = new XMLHttpRequest();
xhr.overrideMimeType("application/json");
xhr.open('GET', url, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
callback(JSON.parse(xhr.responseText));
}
};
xhr.send(null);
}

// Загрузка данных из date.json
loadJSON('assets/json/date.json', function (data) {
// Добавляем метки на карту
data.forEach(event => {
if (event.location && event.location.latitude && event.location.longitude) {
L.marker([event.location.latitude, event.location.longitude]).addTo(map)
.bindPopup(`<b>${event.title}</b><br>${event.date}`);
}
});
});
});
2 changes: 1 addition & 1 deletion assets/JS/search-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ document.addEventListener("DOMContentLoaded", () => {
let eventsData = [];

// Загружаем данные из date.json
fetch("assets/date.json")
fetch("assets/json/date.json")
.then(response => response.json())
.then(data => {
eventsData = data;
Expand Down
2,665 changes: 0 additions & 2,665 deletions assets/date.json

This file was deleted.

2,931 changes: 2,931 additions & 0 deletions assets/json/date.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<link rel="stylesheet" href="assets/CSS/modal-window.css">

<!-- Styles (WEB) --->
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />

<!-- Favicon -->
<link rel="icon" href="assets/photo/icon/favicon.png" type="image/x-icon">
Expand Down Expand Up @@ -330,6 +330,6 @@ <h2 id="modal-title"></h2>
<script src="assets/JS/articles.js"></script>
<script src="assets/JS/initial-map.js"></script>
<!-- Scripts (WEB) -->
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
</body>
</html>

0 comments on commit b6db84d

Please sign in to comment.