SHEGARE (обсуждение | вклад) Нет описания правки |
SHEGARE (обсуждение | вклад) Нет описания правки |
||
| Строка 16: | Строка 16: | ||
colorBtn += header[0].innerHTML[i]; | colorBtn += header[0].innerHTML[i]; | ||
} | } | ||
headerRender (colorBorder, colorBtn); | headerRender (colorBorder, colorBtn); | ||
document.body.addEventListener('click', function() { | document.body.addEventListener('click', function() { | ||
headerRender(colorBorder, colorBtn); | headerRender(colorBorder, colorBtn); | ||
}) | }) | ||
} | } | ||
function headerRender (colorBorder, colorBtn) { | function headerRender (colorBorder, colorBtn) { | ||
var array = document.querySelectorAll('h1, h2, h3 , h4, h5'); | var array = document.querySelectorAll('h1, h2, h3 , h4, h5'); | ||
for(var i = 0; i < array.length; i++) | for(var i = 0; i < array.length; i++) | ||
{ | { | ||
if (array[i].className === 'citizen-section-heading') { | if (array[i].className === 'citizen-section-heading') { | ||
console.log('Called opened') | console.log('Called opened') | ||
| Строка 46: | Строка 37: | ||
} | } | ||
else if(array[i].className === 'citizen-section-heading citizen-section-heading--collapsed') { | else if(array[i].className === 'citizen-section-heading citizen-section-heading--collapsed') { | ||
array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.background = 'black'; | array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.background = 'black'; | ||
array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.boxShadow = 'unset'; | array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.boxShadow = 'unset'; | ||
} | } | ||
} | } | ||
} | } | ||
//End логика цвета через headerColor | //End логика цвета через headerColor | ||
// Лого сайта | // Лого сайта | ||
document.getElementsByClassName('citizen-header__logo')[0].innerHTML = '<div class="logo1"><a href="https://spacestories.club/index.php?title=Заглавная страница" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу"><img class="mw-logo-icon" src="/resources/assets/logo.png" alt="" aria-hidden="true" height="32" width="32"</a></div><div class="logo2"><a href="https://spacestories.club/index.php?title=Colonial_Marines" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу CM"><img class="mw-logo-icon" src="/images/0/0d/CMlog.png" alt="" aria-hidden="true" height="32" width="32"></a></div>'; | document.getElementsByClassName('citizen-header__logo')[0].innerHTML = '<div class="logo1"><a href="https://spacestories.club/index.php?title=Заглавная страница" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу"><img class="mw-logo-icon" src="/resources/assets/logo.png" alt="" aria-hidden="true" height="32" width="32"</a></div><div class="logo2"><a href="https://spacestories.club/index.php?title=Colonial_Marines" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу CM"><img class="mw-logo-icon" src="/images/0/0d/CMlog.png" alt="" aria-hidden="true" height="32" width="32"></a></div>'; | ||
// Для поиска и применения стилей к .citizen-table-wrapper | // Для поиска и применения стилей к .citizen-table-wrapper | ||
Версия от 18:13, 23 сентября 2024
//Begin логика цвета через headerColor
if(document.getElementsByClassName('headerColor').length >= 1) {
var header = document.getElementsByClassName('headerColor');
var colorBorder = '';
var colorBtn = '';
var i = 0;
for(; header[0].innerHTML[i] !== '|'; i++)
{
colorBorder += header[0].innerHTML[i];
}
i++;
for(; i < header[0].innerHTML.length; i++)
{
colorBtn += header[0].innerHTML[i];
}
headerRender (colorBorder, colorBtn);
document.body.addEventListener('click', function() {
headerRender(colorBorder, colorBtn);
})
}
function headerRender (colorBorder, colorBtn) {
var array = document.querySelectorAll('h1, h2, h3 , h4, h5');
for(var i = 0; i < array.length; i++)
{
if (array[i].className === 'citizen-section-heading') {
console.log('Called opened')
array[i].querySelector('.citizen-sections-enabled,.citizen-section-indicator').style.background = ('rgb(' + colorBtn + ')');
array[i].querySelector('.citizen-sections-enabled,.citizen-section-indicator').style.boxShadow = ('0 0 20px 0px rgb(' + colorBtn + ' / 20%)');
array[i].querySelector('.mw-headline').style.borderImage = ('linear-gradient(to right top, ' + colorBorder + ')');
array[i].querySelector('.mw-headline').style.borderImageSlice = '1';
}
else if(array[i].className === 'citizen-section-heading citizen-section-heading--collapsed') {
array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.background = 'black';
array[i].querySelector('.citizen-sections-enabled,.citizen-section-heading--collapsed,.citizen-section-indicator').style.boxShadow = 'unset';
}
}
}
//End логика цвета через headerColor
// Лого сайта
document.getElementsByClassName('citizen-header__logo')[0].innerHTML = '<div class="logo1"><a href="https://spacestories.club/index.php?title=Заглавная страница" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу"><img class="mw-logo-icon" src="/resources/assets/logo.png" alt="" aria-hidden="true" height="32" width="32"</a></div><div class="logo2"><a href="https://spacestories.club/index.php?title=Colonial_Marines" class="mw-logo citizen-header__button" title="Перейти на заглавную страницу CM"><img class="mw-logo-icon" src="/images/0/0d/CMlog.png" alt="" aria-hidden="true" height="32" width="32"></a></div>';
// Для поиска и применения стилей к .citizen-table-wrapper
document.querySelectorAll('.citizen-table-wrapper').forEach(function(wrapper) {
if (wrapper.querySelector('.job_gear')) {
wrapper.style.overflowX = 'unset'; // Применяем стиль
}
});
// Для поиска и применения стилей к .citizen-overflow--right
document.querySelectorAll('.citizen-overflow--right').forEach(function(overflowRight) {
if (overflowRight.querySelector('.job_gear')) {
overflowRight.style.webkitMaskImage = 'unset'; // Для WebKit браузеров (Safari)
overflowRight.style.maskImage = 'unset'; // Для остальных браузеров
}
});
// Шаблон JobHeaderTEST
// Шаблон JobHeaderTEST