uo-tashtagol.kemobl.ru
86 строк · 5.1 Кб
1// For date events
2
3// import { waiting_block } from "./functions.js"; // it`s working
4// the file is loaded from a relative address relative to the current file and the name of the static server is used.
5
6const events = staticURL => {7return {8'23-02|24-02': date => {9console.log(`Start event [${date}]`);10const style = `<link type="text/css" href="${staticURL}/css/events/23febr_2.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;11document.head.insertAdjacentHTML('beforeend', style);12},13'08-03|09-03': date => {14console.log(`Start event [${date}]`);15const style = `<link type="text/css" href="${staticURL}/css/events/8march.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;16document.head.insertAdjacentHTML('beforeend', style);17},18'01-05|02-05': date => {19console.log(`Start event [${date}]`);20const style = `<link type="text/css" href="${staticURL}/css/events/1may.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;21document.head.insertAdjacentHTML('beforeend', style);22},23'01-05|14-05': date => {24console.log(`Start event [${date}]`);25const style = `<link type="text/css" href="${staticURL}/css/events/1-14may.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;26document.head.insertAdjacentHTML('beforeend', style);27},28'05-05|10-05': async date => {29console.log(`Start event [${date}]`);30let { eventAudioPlayer } = await import(`${staticURL}/js/events_audio_player.js`);31let { waiting_block } = await import(`${staticURL}/js/functions.js`);32let playlist = [['Марк Бернес - Темная ночь', `${staticURL}/music/9may/9-temnaja_noch.mp3`],33['Марк Бернес - Журавли', `${staticURL}/music/9may/Bernes_M-Zhuravli.mp3`],34['Муслим Магомаев - День Победы', `${staticURL}/music/9may/den_pobedy.mp3`],35['Булат Окуджава - Мы за ценой не постоим', `${staticURL}/music/9may/bulat_okudzhava-my_za_cenoj_ne_postoim.mp3`],36['Леонид Утёсов - В землянке', `${staticURL}/music/9may/leonid_utjosov_v_zemljanke.mp3`],37['Катюша - Академический Ансамбль песни и пляски Российской Армии имени А.В. Александрова', `${staticURL}/music/9may/katjusha-2020-akademicheskij_ansambl_pesni_i_.mp3`],38['Кубанский казачий хор - Смуглянка', `${staticURL}/music/9may/nikolaj_ustinov_smugljanka-1944.mp3`],39['Валерий Золотухин — Тальяночка', `${staticURL}/music/9may/valerij_zolotukhin_taljanochka-1975.mp3`]]40if (document.querySelector('.site-menu__wrapper')) {41eventAudioPlayer(playlist)42} else {43waiting_block('.site-menu__wrapper', () => eventAudioPlayer(playlist));44}45},46'09-05|10-05': date => {47console.log(`Start event [${date}]`);48const style = `<link type="text/css" href="${staticURL}/css/events/9may.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;49document.head.insertAdjacentHTML('beforeend', style);50},51'12-06|13-06': date => {52console.log(`Start event [${date}]`);53const style = `<link type="text/css" href="${staticURL}/css/events/12-06.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;54document.head.insertAdjacentHTML('beforeend', style);55},56'22-08|23-08': date => {57console.log(`Start event [${date}]`);58document.querySelector('.site_header .site_header__logo').insertAdjacentHTML('afterBegin',59`<video src='${staticURL}/video/flag_rf.webm' autoplay loop muted></video>\n` +60`<link type='text/css' rel='stylesheet' href='${staticURL}/css/events/28-08[flag_day].css?ver=${(new Date()).getTime()}'/>`61);62},63'15-11|01-01': async (event_date, dt) => {64console.log(`Start event [${event_date}]`);65let { newYear } = await import(`${staticURL}/js/functions.js`);66newYear(staticURL,`${dt.getFullYear()}/11/01`, `${(dt.getFullYear() + 1)}/01/01`, dt);67
68},69'01-10|01-03': async date => {70let { waiting_block, snowInit } = await import(`${staticURL}/js/functions.js`);71waiting_block('.site_header', async () => {72console.log(`Start event [${date}]`);73await import(`${staticURL}/js/jquery-3.7.1.slim.min.js`);74snowInit(['.site_header'], '.site_header', `${staticURL}/js/snowfall.jquery.js`);75})76},77'-': date => {78console.log(`Start event [${date}]`);79const style = `<link type="text/css" href="${staticURL}/css/events/23febr_1.css?ver=${(new Date()).getTime()}" rel='stylesheet'>`;80document.head.insertAdjacentHTML('beforeend', style);81}82}83}
84console.log('events module loaded');85
86export { events }