Pibd-21_Ievlewa_M.D._Intern.../js/script.js
2023-12-03 18:52:09 +03:00

33 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
});
});