Шрифт в постах

Стиль оформления

Дополнительно

Размер элементов форума
вверх
вниз

azzt test

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » azzt test » Тестовый форум » плашки


плашки

Сообщений 1 страница 2 из 2

1

180x40

0

2

[html]

<div id="bgContainer"></div>

<script>
const allImages = ["https://upforme.ru/uploads/001c/03/d9/3/776823.jpg",
"https://upforme.ru/uploads/001c/03/d9/3/62072.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/883646.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/254438.jpg",
"https://upforme.ru/uploads/001c/03/d9/3/960700.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/887081.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/598291.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/408856.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/879999.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/225516.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/571358.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/677908.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/644290.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/427469.jpg",
"https://upforme.ru/uploads/001c/03/d9/2/341839.jpg",
"https://upforme.ru/uploads/001c/03/d9/3/185509.jpg",
"https://upforme.ru/uploads/001c/03/d9/118/985807.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/664935.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/480071.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/14570.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/522978.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/632614.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/286988.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/125509.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/58283.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/476641.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/858833.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/804961.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/382948.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/849053.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/442505.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/305118.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/594365.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/854477.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/448543.jpg",
"https://upforme.ru/uploads/001c/1a/e7/2/184980.jpg",
];

function labelStripe(className, nameCategory, src, index) {
    return `<label class="${className}"><input type="radio" name="${nameCategory}" id="${src}" onchange="updateProfilePreview()"> <div class="bgDescr">${index+1}</div> <img src="${src}"> </label>`;
}
function fillBgs(allImages) {
    document.getElementById('bgContainer').innerHTML = allImages
        .map((bgImage, index) => labelStripe("profileBgLabel", "profileBg", bgImage, index)).join('');
}

// Вызываем функцию с массивом изображений
fillBgs(allImages);

// --------- post user profile update ------------
function updateProfilePreview() {
    const bgForm = Array.from(document.getElementsByName('profileBg'))
        .filter(element => element.checked)
        .map(element => element.id)
        .join('');
    console.log(bgForm);
    window.parent.postMessage({
        eventName: 'profileDemo',
        stripe: bgForm
    }, "*");
}

</script>

<style>

.profileBgLabel {
    margin: 5px 5px;
    display: inline-block;
    width: 150px;
    border-radius: 5px;
    padding: 5px;
    background: rgb(255 255 255 / 17%);
}

.profileBgLabel img { border-radius: 3px; }

.profileBgLabel input { display: none; }

.profileBgLabel:has(input:checked) {
    background: rgb(0 0 0 / 12%);
}

.bgDescr {
    color: rgb(0 0 0 / 51%);
    padding: 0px 0px 3px 0px;
}

div#bgContainer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

label.profileBgLabel img {
    width: 150px;
    height: 30px;
    object-fit: cover;
}

</style>
[/html]

0


Вы здесь » azzt test » Тестовый форум » плашки


Рейтинг форумов | Создать форум бесплатно