mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2024-12-24 22:48:30 +03:00
86 lines
3.4 KiB
TypeScript
86 lines
3.4 KiB
TypeScript
/*
|
|
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
export const index = () => {
|
|
// const html = document.documentElement;
|
|
// const body = document.body;
|
|
// const menuLinks = document.querySelectorAll('.admin-menu a');
|
|
// const collapseBtn = document.querySelector('.admin-menu .collapse-btn');
|
|
// const toggleMobileMenu = document.querySelector('.toggle-mob-menu');
|
|
// const switchInput = document.querySelector('.switch input');
|
|
// const switchLabel = document.querySelector('.switch label');
|
|
// const switchLabelText = switchLabel.querySelector('span:last-child');
|
|
// const collapsedClass = 'collapsed';
|
|
// const lightModeClass = 'light-mode';
|
|
//
|
|
// /*TOGGLE HEADER STATE*/
|
|
// collapseBtn.addEventListener('click', function() {
|
|
// body.classList.toggle(collapsedClass);
|
|
// this.getAttribute('aria-expanded') == 'true'
|
|
// ? this.setAttribute('aria-expanded', 'false')
|
|
// : this.setAttribute('aria-expanded', 'true');
|
|
// this.getAttribute('aria-label') == 'collapse menu'
|
|
// ? this.setAttribute('aria-label', 'expand menu')
|
|
// : this.setAttribute('aria-label', 'collapse menu');
|
|
// });
|
|
//
|
|
// /*TOGGLE MOBILE MENU*/
|
|
// toggleMobileMenu.addEventListener('click', function() {
|
|
// body.classList.toggle('mob-menu-opened');
|
|
// this.getAttribute('aria-expanded') == 'true'
|
|
// ? this.setAttribute('aria-expanded', 'false')
|
|
// : this.setAttribute('aria-expanded', 'true');
|
|
// this.getAttribute('aria-label') == 'open menu'
|
|
// ? this.setAttribute('aria-label', 'close menu')
|
|
// : this.setAttribute('aria-label', 'open menu');
|
|
// });
|
|
//
|
|
// /*SHOW TOOLTIP ON MENU LINK HOVER*/
|
|
// for (const link of menuLinks) {
|
|
// link.addEventListener('mouseenter', function() {
|
|
// if (
|
|
// body.classList.contains(collapsedClass) &&
|
|
// window.matchMedia('(min-width: 768px)').matches
|
|
// ) {
|
|
// const tooltip = this.querySelector('span').textContent;
|
|
// this.setAttribute('title', tooltip);
|
|
// } else {
|
|
// this.removeAttribute('title');
|
|
// }
|
|
// });
|
|
// }
|
|
//
|
|
// /*TOGGLE LIGHT/DARK MODE*/
|
|
// if (localStorage.getItem('dark-mode') === 'false') {
|
|
// html.classList.add(lightModeClass);
|
|
// switchInput.checked = false;
|
|
// switchLabelText.textContent = 'Light';
|
|
// }
|
|
//
|
|
// switchInput.addEventListener('input', function() {
|
|
// html.classList.toggle(lightModeClass);
|
|
// if (html.classList.contains(lightModeClass)) {
|
|
// switchLabelText.textContent = 'Light';
|
|
// localStorage.setItem('dark-mode', 'false');
|
|
// } else {
|
|
// switchLabelText.textContent = 'Dark';
|
|
// localStorage.setItem('dark-mode', 'true');
|
|
// }
|
|
// });
|
|
//
|
|
// let a;
|
|
};
|