0.0.173 upd style.css for header, add switcher for languages

This commit is contained in:
2023-10-18 16:16:45 +03:00
parent 71846ade42
commit 3ce22bcb32
6 changed files with 131 additions and 11 deletions

View File

@@ -121,6 +121,51 @@ function socket_close(e){
console.log("closed")
setTimeout(restart_ws,1000)
}
document.addEventListener('DOMContentLoaded', function() {
let img = document.getElementById('dropbtn_lang')
if (window.location.href.indexOf("ru") > -1){
img.style.background = "url('/static/img/png/ru.png')"
img.style.backgroundRepeat = "no-repeat"
img.style.backgroundPosition = "left center"
}else if(window.location.href.indexOf("en") > -1){
img.style.background = "url('/static/img/png/en.png')"
img.style.backgroundRepeat = "no-repeat"
img.style.backgroundPosition = "left center"
}
});
window.addEventListener('scroll', () => {
let headerBG = document.getElementById('header_bg')
headerBG.style.backgroundColor = 'rgb(248 248 248 / 90%)'
headerBG.style.padding = '20px 40px'
// headerBG.style.paddingBottom = 'padding: 10px 40px 10px 40px'
// headerBG.style.paddingRight = 'padding: 10px 40px 10px 40px'
// headerBG.style.paddingLeft = 'padding: 10px 40px 10px 40px'
})
// Действия при изменении URL
// function changeImgLang(el) {
//
// let img = document.getElementById('dropbtn_lang')
//
// if (el.innerText === 'RU'){
// img.style.background = "url('/static/img/png/ru.png') no-repeat left center;"
// }
// else if(el.innerText === 'EN'){
// img.style.background = "url('/static/img/png/en.png')"
// img.style.backgroundRepeat = "no-repeat"
// img.style.backgroundPosition = "left center"
//
// }
//
// }
// var window_messages = document.querySelector(".container-messages")
// function middleWareJS (){