kinda mukodik

This commit is contained in:
2026-03-24 19:56:21 +01:00
parent bbb0830229
commit def50f4cc5
2 changed files with 51 additions and 17 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

+46 -12
View File
@@ -2,22 +2,56 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function waiting()
{
while (!document.body.contains(document.getElementById("mat-expansion-panel-header-3"))) {
sleep(100);
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
observer.disconnect();
resolve(document.querySelector(selector));
}
});
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
//waiting();
waitForElm('footer').then((elm) => {
console.log('megva');
// 0->bgcolor, 1->color, 2->image
footer = document.getElementsByClassName('footer');
const replacements = [
['footer', '#e4007c',0],
['header__main-menu', '#e4007c',0],
['header__title', '#e4007c',1],
//['primary-bg-wrapper', '#ffe4e1',0],
['primary-bg-wrapper', 'https://neptun.bme.hu/oktatoi/App_Themes/Skin_Neptun_Pink/header_right.jpg?fbclid=IwY2xjawQvu8lleHRuA2FlbQIxMQBzcnRjBmFwcF9pZAEwAAEejsSjILW2IucqCqzuuEmt-idaaEp76dLcLqEzWhnOaZUiYjytqglkMrF-8QI_aem_Lkw_NpJhItr0qdkMhEyCmA',2],
];
console.log(footer.length);
for (let j = 0; j < replacements.length; j++) {
var items = document.getElementsByClassName(replacements[j][0]);
for (let i = 0; i < footer.length; i++) {
footer[i].style.backgroundColor = '#e4007c';
}
for (let i = 0; i < items.length; i++) {
switch (replacements[j][2]) {
case 0:
items[i].style.backgroundColor = replacements[j][1];
break;
case 1:
items[i].style.color = replacements[j][1];
break;
case 2:
items[i].style.backgroundImage = 'url(' + replacements[j][1] + ')';
break;
}
}
}
});