This file contains hidden or 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
/** | |
* Converts a step value to a corresponding T-shirt size. | |
* The default value '0' is equal to 'm'. | |
* @param {number} step - The step value to convert into a T-shirt size. | |
* @returns {string} The T-shirt size corresponding to the given step value. | |
*/ | |
const convertToTShirtSize = (step = 0) => { | |
const times = Math.max(0, Math.abs(step) - 1); | |
const index = Math.sign(step) + 1; | |
return 'x'.repeat(times) + ['s','m','l'][index]; |
This file contains hidden or 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
/* bling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |