/
Pupa
/
CurrencyConvert
Обзор
Документация
Войти
/
Pupa
/
CurrencyConvert
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
script/ui.js
81 строка
2 KB
Pupa
version 0.1
14 фев 2026, 19:46
14 фев 2026, 19:46
cfa801d
Код
Авторство
О чём код?
let input = document.querySelector('.add-sum__input') input.oninput = function() { this.value = this.value.substr(0, 10) } let tumbler = document.querySelector('.theme-toggle') tumbler.addEventListener('click', changeColor) let counter = 0 function changeColor() { console.log('click') let body = document.querySelector('body') let p_cerif = document.querySelectorAll('p') let h3_cerif = document.querySelector('h3') let calc_block = document.querySelector('.calculate__block') let input = document.querySelector('.add-sum__input') let select = document.querySelector('select') let result_block = document.querySelector('.result__block') if (counter == 0) { console.log(0) counter = 1 body.classList.add('light-theme__body') body.classList.remove('dark-theme__body') for (let element of p_cerif) { element.classList.add('light-theme__cerif') element.classList.remove('dark-theme__cerif') } h3_cerif.classList.add('light-theme__cerif') h3_cerif.classList.remove('dark-theme__cerif') calc_block.classList.add('light-theme__calc') calc_block.classList.remove('dark-theme__calc') input.classList.add('light-theme__input') input.classList.remove('dark-theme__input') select.classList.add('light-theme__input') select.classList.remove('dark-theme__input') result_block.classList.add('light-theme__res') result_block.classList.remove('dark-theme__res') } else { console.log(1) counter = 0 body.classList.add('dark-theme__body') body.classList.remove('light-theme__body') for (let element of p_cerif) { element.classList.add('dark-theme__cerif') element.classList.remove('light-theme__cerif') } h3_cerif.classList.add('dark-theme__cerif') h3_cerif.classList.remove('light-theme__cerif') calc_block.classList.add('dark-theme__calc') calc_block.classList.remove('light-theme__calc') input.classList.add('dark-theme__input') input.classList.remove('light-theme__input') select.classList.add('dark-theme__input') select.classList.remove('light-theme__input') result_block.classList.add('dark-theme__res') result_block.classList.remove('light-theme__res') } }