Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
delir committed May 6, 2023
1 parent 7c0c630 commit 0280748
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
23 changes: 21 additions & 2 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ html {
color: inherit !important;
}

.m4tQCU {
display: flex;
align-items: center;
}

.ZPBgKT {
background-color: var(--block-footer-bg) ;
}
Expand Down Expand Up @@ -206,13 +211,15 @@ html {


/* STYLE ADDED BUTTON */
.B2b9Lj .btn {
.btn {
display: flex;
align-items: center;
margin-left: 20px;
}

.B2b9Lj .tog {
.btn-turn-on {
height: 35px;
margin-top: 16px;
padding: 7px 15px;
background-color: var(--color-border);
color: black !important;
Expand All @@ -222,5 +229,17 @@ html {
cursor: pointer;
}

.btn-turn-off {
height: 35px;
margin-top: 16px;
padding: 7px 15px;
background-color: transparent;
color: var(--color-border) !important;
border: 1px solid var(--color-border);
border-radius: 5px;
font-weight: 600;
cursor: pointer;
}



33 changes: 20 additions & 13 deletions res/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
FC_BUTTON_ACCEPT = localStorage.getItem('BTN_ACCEPT');

if(FC_BUTTON_ACCEPT === null) {
localStorage.setItem('BTN_ACCEPT', "on");
localStorage.setItem('BTN_ACCEPT', 'on');
}



function buttonsHTML() {
let buttonsCode = document.querySelectorAll('.m4tQCU');

buttonsCode[0].innerHTML = '<ul class="B2b9Lj"><li class="j0yYJr niqoHv"><a class="AFLXSF" href="/"><span>Главная</span></a></li><li class="j0yYJr"><a class="AFLXSF" href="/matches"><span>Матчи</span></a></li><li class="j0yYJr"><div class="IbDbLH"><button type="button" class="WA17Fa"><div class="GCQCcK"><span>Соревнования</span></div></button><div class="Dt_KDD"><a class="mFXxRZ" href="/leagues"><span>Лиги</span></a><a class="mFXxRZ" href="/tournaments"><span>Турниры</span></a></div></div></li><li class="j0yYJr"><div class="IbDbLH"><button type="button" class="WA17Fa"><div class="GCQCcK"><span>Топы</span></div></button><div class="Dt_KDD"><a class="mFXxRZ" href="/users"><span>Игроки</span></a><a class="mFXxRZ" href="/teams"><span>Команды</span></a></div></div></li><li class="j0yYJr"><a class="AFLXSF" href="/streams"><span>Стримы</span></a></li><li class="j0yYJr"><a class="AFLXSF" href="/servers"><span>Серверы</span></a></li><li class="j0yYJr"><a class="AFLXSF" href="https://forums.fastcup.net" target="_blank" rel="noopener noreferrer"><span>Форум</span></a></li><li class="j0yYJr"><a class="AFLXSF" href="https://gameguard.ac" target="_blank" rel="noopener noreferrer"><span>Античит</span></a></li><li class="j0yYJr"><div class="IbDbLH"><button type="button" class="WA17Fa"><div class="GCQCcK"><span>Помощь</span></div></button><div class="Dt_KDD"><a class="mFXxRZ" href="/faq">FAQ</a><a class="mFXxRZ" href="/rules"><span>Правила</span></a><button class="mFXxRZ"><div class="GCQCcK"><span>Поддержка</span></div></button></div></div></li><div class="btn"><button class="tog AC btn-turn-on">Auto-accept</button></div></li></div></a></li></ul>'

let btnAC = document.querySelectorAll('.AC');
if (FC_BUTTON_ACCEPT === "on") {
btnAC[0].innerText = "Auto-Accept ON";
// BUTTON
let buttonsCode = document.querySelectorAll('.kI42CN');
let btn = document.createElement("BUTTON");
btn.className = 'AC ' + 'btn-turn-on';
if (FC_BUTTON_ACCEPT === 'on') {
btn.innerText = 'Auto-Accept ON';
btn.classList.add('btn-turn-on');
btn.classList.remove('btn-turn-off');
} else {
btnAC[0].innerText = "Auto-Accept OFF";
btn.innerText = 'Auto-Accept OFF';
btn.classList.add('btn-turn-off');
btn.classList.remove('btn-turn-on');
}
buttonsCode[0].appendChild(btn);

// SWITCH
let btnAC = document.querySelectorAll('.AC');
btnAC[0].addEventListener('click', function buttonSwitchAC() {
let tempAC = btnAC[0];
if(!tempAC.classList.contains('btn-turn-off')) {
Expand All @@ -26,18 +32,19 @@ function buttonsHTML() {
localStorage.setItem('BTN_ACCEPT', 'off');
btnAC[0].innerText = "Auto-Accept OFF";
btnAC[0] = tempAC;

}
else {
tempAC.classList.remove('btn-turn-off');
tempAC.classList.add('btn-turn-on');
localStorage.setItem('BTN_ACCEPT', 'on');
btnAC[0].innerText = "Auto-Accept ON";
btnAC[0].innerText = 'Auto-Accept ON';
btnAC[0] = tempAC;
}
});
}

function autoaccept() {
function autoAccept() {
FC_BUTTON_ACCEPT = localStorage.getItem('BTN_ACCEPT');
if(FC_BUTTON_ACCEPT === 'on') {
let temp = document.querySelectorAll('.J8yUlf');
Expand All @@ -56,5 +63,5 @@ setTimeout(() => {
}, 300)

setInterval(() => {
autoaccept();
autoAccept();
}, 4000)

0 comments on commit 0280748

Please sign in to comment.