$('#color__white').on('click', function() {
$('.bg__banner').css({ background: "url('https://lh3.googleusercontent.com/Rt8TYR6K-aTSv125emcExagI7ehiTklC6wlMPFvnd6aC00-DMWxeu7BaWrMvXcsSNNM')" });
});
$('#color__black').on('click', function() {
$('.bg__banner').css({ background: "url('https://lh3.googleusercontent.com/V9Eqc_2TmD5fy06JjfY9drZPfgYtHZQuRK7Ndt-6d0FsucKnXqTug_PwIpal36p-EfE=s180')" });
});
const lists = document.querySelectorAll('.list li');
lists.forEach(list => {
list.addEventListener('click', () => {
lists.forEach(list => list.classList.remove('active'));
list.classList.add('active');
});
});
const divs = $(".team > .team_single");
for (let i = 0; i < divs.length; i += 2) {
divs.slice(i, i + 2).wrapAll("<div class='new'></div>");
}
Интересно мнение о моем коде
Сори за говнокод
function openhide(){
document.querySelector('.hide_sett_passive').classList.add('hide_sett_active');
document.querySelector('.hide_sett_passive').classList.remove('hide_sett_passive');
}
function closehide(){
document.querySelector('.hide_sett_active').classList.add('hide_sett_passive');
document.querySelector('.hide_sett_active').classList.remove('hide_sett_active');
}
function openprebook(){
document.querySelector('.preblock_passive').classList.add('preblock_active');
document.querySelector('.preblock_passive').classList.remove('preblock_passive');
}
function closeprebook(){
document.querySelector('.preblock_active').classList.add('preblock_passive');
document.querySelector('.preblock_active').classList.remove('preblock_active');
}
function open_prebooksItems1(){
document.querySelector('.preblock_hs_itm1_passive').classList.add('preblock_hs_itm1_active');
document.querySelector('.preblock_hs_itm1_passive').classList.remove('preblock_hs_itm1_passive');
}
function close_prebooksItems1(){
document.querySelector('.preblock_hs_itm1_active').classList.add('preblock_hs_itm1_passive');
document.querySelector('.preblock_hs_itm1_active').classList.remove('preblock_hs_itm1_active');
}
function close_when_all_close(){
document.querySelector('.cl').addEventListener("click", function() {
closehide();
closeprebook();
close_prebooksItems1();
})
}
function MakeActive_hide_sett_passive(){
document.querySelector('.shesterenki').addEventListener("click", function() {
openhide();
});
}
function click_hs_itm1(){
document.querySelector('.hs_itm1').addEventListener("click", function() {
openprebook();
open_prebooksItems1();
});
}
document.addEventListener("DOMContentLoaded", function() {
close_when_all_close();
MakeActive_hide_sett_passive();
click_hs_itm1();
});
const input = document.querySelector("input");
const button = document.querySelector("button");
button.disabled = true;
input.addEventListener("input", function() {
button.disabled = !this.value.length;
})
const enter = document.querySelector('.sign-in');
const backgroundForm = document.querySelector('.backgroundForm');
const login = document.querySelector('.login');
enter.addEventListener('click', function() {
backgroundForm.classList.toggle('active');
login.classList.toggle('active');
});
const btn = document.querySelector("#btn");
const box1 = document.querySelector("#box1");
const boxText = document.querySelector("#box-text");
const boxBackground = box1.style.backgroundColor;
btn.addEventListener("click", function() {
boxText.innerHTML = `background-color: ${boxBackground}`;
})
$("#btn").click(function() {
$("#box-text").text("background-color: " + $("#box1").css("background-color"));
});
$('.floor').click(function() {
$('.floor, .floorcase').each(function() {
$(this).addClass('fade');
});
});
$(document).mouseup(function(e) {
const floor = $('.floor');
const floorcase = $('.floorcase');
if (floor.has(e.target).length === 0 && floorcase.has(e.target).length === 0) {
floor.removeClass('fade');
floorcase.removeClass('fade');
}
});