This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
one line github files looks weird to me :d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const count = ((counter = 0) => () => counter++)() | |
console.log(count(), count(), count()) // 0 1 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $ = new Proxy({}, { get: (_, c) => document.querySelector(`.${c}`) }) | |
$.toggleBtn.onclick = e => { | |
$.content.classList.toggle("visible") | |
} | |
$.toggleBtn.click() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const el = str =>{ | |
const strs = str.split('.') | |
let el = document.createElement(strs.shift()) | |
for (let cls of strs) el.classList.add(cls) | |
return el | |
} | |
el('div.wrapper.hidden') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const range = (b = 1, a = 0) => [...Array(b - a).keys()].map(i => i + a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
function makeBindi(keys) { | |
return new Proxy({}, { | |
get(_, key) { | |
return makeBindi([...keys, key]) | |
}, | |
set(_, key, func) { | |
document.addEventListener('keydown', e => { | |
if ( | |
(e.key.toLowerCase() === key) && |