В этой теме можно попросить сделать себе аватар, а также примерить одну из форумных плашек и описание в профиле.
• Это все плашки?
Они будут постоянно пополняться, не волнуйтесь.
• А можно ли попросить сделать свою плашку?
Можно. Приносите исходник, пишите, что хотите видеть во всплывающем тексте, сделаем.
• А будут ли какие-то уникальные плашки?
Да, будут. За участие в конкурсах.
• Можно ли приносить гиф-исходники?
Можно, если они по весу не превышают 500МБ.
• А это обязательно?
Нет, конечно, все исключительно по желанию.
[html]
<script>
// --------- FILL STRIPES ------------
function labelStripe(className, nameCategory, src, descr) {
return `<label class="${className}"><input type="radio" name="${nameCategory}" id="${src}" onchange="updateProfilePreview()"> <div class="stripeDescr">${descr}</div> <img src="${src}"> </label>`;
}
function fillStripes(stripes, userId) {
document.getElementById('stripeContainer').innerHTML = stripes
.filter(stripe => (stripe.allowed.includes("all") || stripe.allowed.includes(userId)))
.map(stripe => labelStripe("profileStripeLabel", "profileStripe", stripe.src, stripe.descr)).join('');
}
// --------- USER DATA ------------
let userLatinName = '';
let userProfileUrl = '';
let userApplicationFormUrl = '';
window.addEventListener("message", (event) => {
if (!event.origin.match(/oldshadows\.rusff\.me$/)) return;
if (event.data.eventName != 'profileFillingResponce') return;
userLatinName = event.data.userLatinName;
userProfileUrl = event.data.userProfileUrl;
userApplicationFormUrl = event.data.userApplicationFormUrl;
fillStripes(event.data.stripes, event.data.userId);
});
window.parent.postMessage({ eventName: 'profileFillingRequest' }, "*");
function copyResults() {
let copyContent = '';
// -- форма заполнения профиля --
const cyrillicName = document.getElementById('cyrillicName').value;
if (cyrillicName) {
const profileDescrName = document.getElementById('mainDescr').value;
let profileForm = `<a href='${userApplicationFormUrl}'><b>${cyrillicName}</b></a>, ${profileDescrName}`;
if (document.getElementById('hrAdd').checked) {
profileForm += '<hr>';
} else {
profileForm += '<br>';
}
const profileAdd = document.getElementById('addDescr').value;
const profileAddNotFilled = profileAdd == '' || profileAdd == `любое описание на ваш вкус <a href='ссылка на анкету персонажа'><b>имя на кириллице</b></a>`;
if (!profileAddNotFilled) {
profileForm += profileAdd;
}
copyContent += `Форма профиля:
${String.fromCharCode(91)}code${String.fromCharCode(93)}${profileForm}${String.fromCharCode(91)}/code${String.fromCharCode(93)}\n\n`;
}
// -- форма плашки и фона --
const stripeForm = Array.from(document.getElementsByName('profileStripe'))
.filter(element => element.checked)
.map(element => element.id)
.join('');
if (stripeForm) {
copyContent += `Плашка:
${String.fromCharCode(91)}img${String.fromCharCode(93)}${stripeForm}${String.fromCharCode(91)}/img${String.fromCharCode(93)}\n\n`;
}
window.parent.postMessage({
eventName: 'profileCopyInfoRequest',
copyData: copyContent.trim() // Удаляем лишние переносы в конце
}, "*");
}
// --------- post user profile update ------------
function updateProfilePreview() {
const cyrillicName = document.getElementById('cyrillicName').value ?? userLatinName;
const profileDescrName = document.getElementById('mainDescr').value;
let profileForm = `<a href='${userApplicationFormUrl}'><b>${cyrillicName}</b></a>, ${profileDescrName}`;
if (document.getElementById('hrAdd').checked) {
profileForm += '<hr>';
} else {
profileForm += '<br>';
}
const profileAdd = document.getElementById('addDescr').value;
const profileAddNotFilled = profileAdd == '' || profileAdd == `любое описание на ваш вкус <a href='ссылка на анкету персонажа'><b>имя на кириллице</b></a>`;
if (!profileAddNotFilled) {
profileForm += profileAdd;
}
const stripeForm = Array.from(document.getElementsByName('profileStripe'))
.filter(element => element.checked)
.map(element => element.id)
.join('');
window.parent.postMessage({
eventName: 'profileDemo',
profileDescr: profileForm,
stripe: stripeForm
}, "*");
}
document.getElementById('instructionResult').onclick = copyResults;
updateProfilePreview();
window.addEventListener("message", (event) => {
if (!event.origin.match(/oldshadows\.rusff\.me$/)) return;
if (event.data.eventName != 'fontChange') return;
$('.post-content p, .post-content div').css('font-size', event.data.fontSize + 'px');
});
</script>
<div class="fillingForm">
<label class="fillingCategoryRadio"><input type="radio" id="profileDescr" name="fillingCategoryRadio" checked /> <span>Описание в профиле</span></label>
<label class="fillingCategoryRadio"><input type="radio" id="profileStripe" name="fillingCategoryRadio" /> <span>Плашки</span></label>
<div class="instructionBlock profileDescr">
<h2 class="instructionHeading">Описание в профиль</h2>
<label for="cyrillicName" class="labelDescr">Имя на кириллице:</label>
<input type="text" id="cyrillicName" name="cyrillicName" oninput="updateProfilePreview()">
<label for="mainDescr" class="labelDescr">Описание в профиль:</label>
<input type="text" id="mainDescr" name="mainDescr" value="возраст, раса, род деятельности" oninput="updateProfilePreview()">
<label for="hrAdd" class="hrAdd">
<input type="checkbox" id="hrAdd" name="hrAdd" onchange="updateProfilePreview()" checked />
<span>Добавить полосу между секциями</span>
</label>
<label for="addDescr" class="labelDescr">При желании можете добавить в профиль пару, красивую цитату, важного родственника, врага и тому подобное через это поле. Если не нужно, оставьте его пустым или не меняйте:</label>
<input type="text" id="addDescr" oninput="updateProfilePreview()" name="addDescr" value="любое описание на ваш вкус <a href='ссылка на анкету персонажа'><b>имя на кириллице</b></a>">
</div>
<div class="instructionBlock profileStripe">
<h2 class="instructionHeading">Плашки</h2>
<div id="stripeContainer"></div>
</div>
</div>
<div class="formButtons">
<input type="button" id="instructionResult" value="Скопировать код">
</div>
<style>
h2.instructionHeading {
font-size: 16px;
font-family: 'Palatino Linotype';
font-weight: bold;
letter-spacing: 1px;
}
.labelDescr {
display: block;
margin: 9px 0px 1px 0px;
}
.instructionBlock {
text-align: left;
margin: 10px 0 !important;
padding: 14px 14px 12px 14px !important;
border: 1px solid var(--pinkBorder);
background: var(--qBG);
border-radius: 4px;
}
.instructionBlock input[type="text"] {
width: calc(100% - 10px);
}
label.hrAdd {
margin: 10px 0 0 0;
display: block;
}
input#hrAdd {
accent-color: var(--darkpinkText);
}
.profileStripeLabel {
margin: 5px 5px;
display: inline-block;
width: 180px;
border-radius: 5px;
padding: 5px;
background: rgb(255 255 255 / 17%);
}
.profileStripeLabel img { border-radius: 3px; }
.profileStripeLabel input { display: none; }
.profileStripeLabel:has(input:checked) {
background: rgb(0 0 0 / 12%);
}
.stripeDescr {
color: rgb(0 0 0 / 51%);
padding: 0px 0px 3px 0px;
}
div#stripeContainer {
display: flex;
flex-wrap: wrap;
align-items: baseline;
}
label.fillingCategoryRadio {
border-radius: 16px;
border: 1px solid var(--pinkBorder);
background: var(--lightBG);
padding: 2px 6px;
display: inline-block;
margin: 0px 4px 5px 0px;
}
label.fillingCategoryRadio:has(input:checked) {
background: var(--pinkBorder);
color: #fff;
}
.fillingCategoryRadio input[type="radio"] {
display: none;
}
label.fillingCategoryRadio {
cursor: pointer;
}
.profileDescr, .profileStripe { display: none; }
.fillingCategoryRadio:has(#profileDescr:checked) ~ .profileDescr {
display: block !important;
}
.fillingCategoryRadio:has(#profileStripe:checked) ~ .profileStripe {
display: block !important;
}
.fillingForm { text-align: center; }
</style>
[/html]