Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
/*Новый Tabs*/ | |||
document.querySelectorAll('.job_header').forEach(header => { | |||
header.addEventListener('mouseover', () => { | |||
header.style.borderColor = '#3b4d8f'; // меняем цвет бордера при наведении | |||
}); | |||
header.addEventListener('mouseout', () => { | |||
header.style.borderColor = ''; // возвращаем стандартный цвет | |||
}); | |||
// Добавление плавного скролла при клике на руководство | |||
header.querySelectorAll('.guideline-link').forEach(link => { | |||
link.addEventListener('click', (e) => { | |||
e.preventDefault(); | |||
document.querySelector(link.getAttribute('href')).scrollIntoView({ | |||
behavior: 'smooth' | |||
}); | |||
}); | |||
}); | |||
}); | |||
/*Новый Tabs*/ | |||
/* Лого сайта | /* Лого сайта | ||
Shegare */ | Shegare */ | ||
| Строка 66: | Строка 88: | ||
document.getElementById('bodyContent').style.minHeight = '1350px'; | document.getElementById('bodyContent').style.minHeight = '1350px'; | ||
} | } | ||
Версия от 22:35, 16 октября 2024
/*Новый Tabs*/
document.querySelectorAll('.job_header').forEach(header => {
header.addEventListener('mouseover', () => {
header.style.borderColor = '#3b4d8f'; // меняем цвет бордера при наведении
});
header.addEventListener('mouseout', () => {
header.style.borderColor = ''; // возвращаем стандартный цвет
});
// Добавление плавного скролла при клике на руководство
header.querySelectorAll('.guideline-link').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
document.querySelector(link.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
});
/*Новый Tabs*/
/* Лого сайта
Shegare */
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>';
/* Перенос page-info в конец footer-places
Shegare */
document.getElementById('footer-places').insertAdjacentHTML('afterEnd', document.getElementsByClassName('page-info')[0].innerHTML);
document.getElementsByClassName('page-info')[0].innerHTML = null;
/* Begin логика цвета через headerColor
Shegare */
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') {
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
Shegare */
/* Begin sidebar для ролей
Shegare */
if(document.getElementsByClassName('JobsTableContainer').length >= 1) {
document.getElementById('content').insertAdjacentHTML('afterbegin', document.getElementsByClassName('JobsTableContainer')[0].innerHTML);
document.getElementById('IdJobsTableContainer1').id = 'IdJobsTableContainer2';
document.getElementById('content').style.display = 'flex';
document.getElementById('bodyContent').style.minHeight = '1350px';
}