Pibd-21_Ievlewa_M.D._Intern.../js/script.js

33 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-12-03 19:52:09 +04:00
document.addEventListener("DOMContentLoaded", function() {
const eventName = ''; // Получаем название мероприятия из предыдущей страницы
const urlParams = new URLSearchParams(window.location.search);
const artistName = urlParams.get('name');
document.getElementById('artistName').textContent = artistName;
const heroSection = document.getElementById('heroSection');
const eventDescription = document.getElementById('eventDescription');
const eventDates = document.getElementById('eventDates');
const eventPerformers = document.getElementById('eventPerformers');
// Загрузка изображения мероприятия
heroSection.style.background = `url('pictures/${eventName}.jpg') center/cover no-repeat`;
// Загрузка информации из .txt файлов с помощью JavaScript
fetch(`artists/${eventName}-description.txt`)
.then(response => response.text())
.then(data => {
eventDescription.textContent = data;
});
fetch(`artists/${eventName}-dates.txt`)
.then(response => response.text())
.then(data => {
eventDates.textContent = data;
});
fetch(`artists/${eventName}-performers.txt`)
.then(response => response.text())
.then(data => {
eventPerformers.textContent = data;
});
});