-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1426db4
commit aba5404
Showing
8 changed files
with
150 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,43 @@ | ||
// Данная функция добавляет и отображает дату с боку от просматриваемого мероприятия (Controller part) | ||
class EventsSideBlock { | ||
// Создание элемента div для блока | ||
element = document.createElement("div"); | ||
title; | ||
background; | ||
description; | ||
year; | ||
month; | ||
|
||
set["bg"](v) { | ||
this.background = v; | ||
this.element.lastElementChild.style.backgroundImage = v; | ||
// Свойство установки фона блока | ||
set["bg"](background_value) | ||
{ | ||
this.background = background_value; | ||
this.element.lastElementChild.style.backgroundImage = background_value; | ||
} | ||
|
||
constructor({title, background, description, daddy, year, month}) { | ||
// Конструктор всего блока | ||
constructor({title, background, description, daddy, year, month}) | ||
{ | ||
let element1 = this.element; | ||
element1.classList = ["box"]; | ||
element1.appendChild(document.createElement("div")); | ||
|
||
// Инициализируем свойства блока | ||
this.title = title; | ||
this.description = description; | ||
this.bg = background; | ||
this.bg = background; // Используем свойство bg для установки фона | ||
this.year = year; | ||
this.month = month; | ||
|
||
// Создаем и добавляем внутренний слой блока | ||
let sup_layer = Object.assign(document.createElement("div")); | ||
element1.children[0].appendChild(sup_layer).classList.add('sup_layer'); | ||
|
||
// Создаем и добавляем span с заголовком внутреннего слоя | ||
let span = Object.assign(document.createElement("span"), {innerHTML: title}); | ||
element1.children[0].children[0].appendChild(span); | ||
|
||
// Добавление сформированного блока в родительский элемент | ||
daddy.appendChild(element1); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.