Змінено директорії
Додано скрипти CRON Поліпшено механізм запису стендів та їх редагування
This commit is contained in:
@@ -20,6 +20,43 @@
|
||||
<span>Доступні стенди</span>
|
||||
</summary>
|
||||
|
||||
<div id="list"></div>
|
||||
<div id="list">
|
||||
<div id="null-list" class="mess-list" data-visible="false">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
||||
<path
|
||||
d="M15,109.8l48,17c0,0,0,0,0,0c0.1,0,0.2,0.1,0.3,0.1c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.4,0c0,0,0.1,0,0.1,0c0.2,0,0.3,0,0.5,0 c0,0,0.1,0,0.1,0c0.1,0,0.2-0.1,0.3-0.1c0,0,0,0,0,0l48-17c1.2-0.4,2-1.6,2-2.8V73.4l10-3.5c0.8-0.3,1.5-1,1.8-1.8s0.2-1.8-0.3-2.6 l-12-20c0,0,0,0,0-0.1c0-0.1-0.1-0.1-0.1-0.2c0,0,0,0,0-0.1c0,0,0,0,0,0c0-0.1-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0,0,0,0-0.1-0.1 c0,0,0,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.1c0,0-0.1-0.1-0.1-0.1c0,0,0,0-0.1,0c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.1 c-0.1,0-0.1,0-0.2-0.1c0,0,0,0-0.1,0c0,0,0,0,0,0l-48-17c-0.2-0.1-0.4-0.1-0.6-0.1c0,0-0.1,0-0.1,0c-0.2,0-0.3,0-0.5,0 c-0.1,0-0.1,0-0.2,0c-0.2,0-0.4,0.1-0.6,0.1l-48,17c0,0,0,0,0,0c0,0-0.1,0-0.1,0.1c0,0,0,0,0,0c-0.1,0.1-0.3,0.1-0.4,0.2 c0,0,0,0,0,0c0,0,0,0,0,0c-0.2,0.1-0.4,0.3-0.6,0.5l0,0c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0c-0.1,0.1-0.1,0.2-0.2,0.2c0,0,0,0,0,0 c0,0,0,0-0.1,0.1l-12,20C1,66.2,0.9,67.2,1.2,68s1,1.5,1.8,1.8l10,3.5V107C13,108.3,13.8,109.4,15,109.8z M109,104.9l-42,14.9V95.7 c0-1.7-1.3-3-3-3s-3,1.3-3,3v24.1l-42-14.9V75.5l32,11.3c0.3,0.1,0.7,0.2,1,0.2c1,0,2-0.5,2.6-1.5L64,69.8l9.4,15.7 C74,86.5,75,87,76,87c0.3,0,0.7-0.1,1-0.2l32-11.3V104.9z M67,34.2L103,47L67,59.8V34.2z M77.3,80.4l-8.9-14.8l42.2-15l8.9,14.8 L77.3,80.4z M17.3,50.6l42.2,15l-8.9,14.8l-42.2-15L17.3,50.6z"
|
||||
/>
|
||||
</svg>
|
||||
<h3>Доступних днів поки немає</h3>
|
||||
</div>
|
||||
|
||||
<div id="load-list" class="mess-list" data-visible="true">
|
||||
<svg
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.0"
|
||||
width="64px"
|
||||
height="64px"
|
||||
viewBox="0 0 128 128"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d="M64 9.75A54.25 54.25 0 0 0 9.75 64H0a64 64 0 0 1 128 0h-9.75A54.25 54.25 0 0 0 64 9.75z"
|
||||
></path>
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
from="0 64 64"
|
||||
to="360 64 64"
|
||||
dur="1400ms"
|
||||
repeatCount="indefinite"
|
||||
></animateTransform>
|
||||
</g>
|
||||
</svg>
|
||||
<h3>Зачекайте ...</h3>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
@@ -24,26 +24,56 @@ const Stand_list = {
|
||||
return Stand_list.list;
|
||||
},
|
||||
setHTML: async function () {
|
||||
const block_list = document.getElementById('list');
|
||||
const block = document.getElementById('list');
|
||||
const null_list = document.getElementById('null-list');
|
||||
const load_list = document.getElementById('load-list');
|
||||
|
||||
null_list.setAttribute("data-visible", "false");
|
||||
load_list.setAttribute("data-visible", "true");
|
||||
|
||||
|
||||
const url = `${CONFIG.api}stand/list`;
|
||||
let list = this.list.length > 0 ? this.list : await this.loadAPI(url);
|
||||
|
||||
let html = "";
|
||||
for (const element of list) {
|
||||
html += this.renderCard({ element });
|
||||
}
|
||||
if (list.length == 0) {
|
||||
null_list.setAttribute("data-visible", "true");
|
||||
load_list.setAttribute("data-visible", "false");
|
||||
|
||||
block_list.innerHTML = html;
|
||||
return;
|
||||
} else {
|
||||
null_list.setAttribute("data-visible", "false");
|
||||
load_list.setAttribute("data-visible", "false");
|
||||
|
||||
let html = "";
|
||||
for (const element of list) {
|
||||
html += this.renderCard({ element });
|
||||
}
|
||||
|
||||
block.innerHTML = html;
|
||||
}
|
||||
},
|
||||
renderCard: ({ element }) => {
|
||||
renderCard: ({ element, pack=0 }) => {
|
||||
const images = [
|
||||
['stand_1.png', 'stand_2.png', 'stand_3.png'],
|
||||
['stand_4.png', 'stand_5.png']
|
||||
];
|
||||
const randomImage = images[pack][Math.floor(Math.random() * images[pack].length)];
|
||||
|
||||
const editor = USER.possibilities.can_add_stand
|
||||
? `<a id="editor_button" class="button-edit" data-route title="Змінити графік" href="/stand/editor/${element.id}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M 22.828125 3 C 22.316375 3 21.804562 3.1954375 21.414062 3.5859375 L 19 6 L 24 11 L 26.414062 8.5859375 C 27.195062 7.8049375 27.195062 6.5388125 26.414062 5.7578125 L 24.242188 3.5859375 C 23.851688 3.1954375 23.339875 3 22.828125 3 z M 17 8 L 5.2597656 19.740234 C 5.2597656 19.740234 6.1775313 19.658 6.5195312 20 C 6.8615312 20.342 6.58 22.58 7 23 C 7.42 23.42 9.6438906 23.124359 9.9628906 23.443359 C 10.281891 23.762359 10.259766 24.740234 10.259766 24.740234 L 22 13 L 17 8 z M 4 23 L 3.0566406 25.671875 A 1 1 0 0 0 3 26 A 1 1 0 0 0 4 27 A 1 1 0 0 0 4.328125 26.943359 A 1 1 0 0 0 4.3378906 26.939453 L 4.3632812 26.931641 A 1 1 0 0 0 4.3691406 26.927734 L 7 26 L 5.5 24.5 L 4 23 z"></path></svg></a>`
|
||||
: ``;
|
||||
|
||||
return `
|
||||
<div class="card">
|
||||
<div class="contents">
|
||||
<div class="image">
|
||||
<img src="/img/${randomImage}">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>
|
||||
<p>${element.title}</p>
|
||||
</div>
|
||||
${editor}
|
||||
</div>
|
||||
</div>
|
||||
<a href="/stand/card/${element.id}" data-route></a>
|
||||
|
||||
@@ -98,14 +98,12 @@
|
||||
content: "";
|
||||
}
|
||||
|
||||
|
||||
.page-stand-list summary {
|
||||
width: calc(100% - 40px);
|
||||
cursor: pointer;
|
||||
color: var(--ColorThemes3);
|
||||
border-radius: var(--border-radius);
|
||||
font-size: var(--FontSize5);
|
||||
font-weight: 300;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -113,6 +111,11 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page-stand-list summary span {
|
||||
font-weight: 500;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page-stand-list #list {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
@@ -126,12 +129,37 @@
|
||||
transition: .3s ease;
|
||||
}
|
||||
|
||||
.page-stand-list #list>.mess-list {
|
||||
height: 200px;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.page-stand-list #list>.mess-list[data-visible="true"] {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.page-stand-list #list>.mess-list>svg {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
fill: var(--ColorThemes3);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.page-stand-list #list>.mess-list>h3 {
|
||||
font-size: var(--FontSize5);
|
||||
color: var(--ColorThemes3);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.page-stand-list .card {
|
||||
position: relative;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
background-color: var(--ColorThemes2);
|
||||
margin: 0px 10px 20px 10px;
|
||||
margin: 10px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border-radius: calc(var(--border-radius) - 5px);
|
||||
@@ -196,7 +224,6 @@
|
||||
|
||||
.page-stand-list .card>.contents {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
background: rgb(64 64 64 / 0.7);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -209,9 +236,30 @@
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.image {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.image>img {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
filter: brightness(0.9) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.page-stand-list .card>.contents>.image>img {
|
||||
filter: brightness(0.6) contrast(80%) saturate(110%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.info {
|
||||
width: calc(100% - 20px);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.info>div {
|
||||
@@ -226,6 +274,7 @@
|
||||
border-radius: calc(var(--border-radius) - 5px - 4px);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-l1);
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.info>div>span {
|
||||
@@ -241,4 +290,24 @@
|
||||
font-weight: 400;
|
||||
padding: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.info>.button-edit {
|
||||
min-width: 35px;
|
||||
height: 35px;
|
||||
border-radius: calc(var(--border-radius) - 5px - 4px);
|
||||
background: var(--PrimaryColor);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 10px;
|
||||
z-index: 20;
|
||||
box-shadow: var(--shadow-l1);
|
||||
}
|
||||
|
||||
.page-stand-list .card>.contents>.info>.button-edit>svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: var(--PrimaryColorText);
|
||||
}
|
||||
Reference in New Issue
Block a user