kinda mukodik
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
@@ -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));
|
||||
}
|
||||
|
||||
//waiting();
|
||||
|
||||
console.log('megva');
|
||||
|
||||
footer = document.getElementsByClassName('footer');
|
||||
|
||||
console.log(footer.length);
|
||||
|
||||
for (let i = 0; i < footer.length; i++) {
|
||||
footer[i].style.backgroundColor = '#e4007c';
|
||||
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
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
waitForElm('footer').then((elm) => {
|
||||
|
||||
// 0->bgcolor, 1->color, 2->image
|
||||
|
||||
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],
|
||||
];
|
||||
|
||||
for (let j = 0; j < replacements.length; j++) {
|
||||
var items = document.getElementsByClassName(replacements[j][0]);
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user