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
document.body.innerHTML = ` | |
<style> | |
.with-overlay { | |
display: inline-block; | |
border: 1px solid; | |
} | |
.with-overlay { | |
position: relative; | |
} |
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
/** | |
* Storing flags in one variable and checking for | |
* enabled/disabled states using | |
* bitwise operators. | |
* @author elycruz | |
* @reference: | |
* - https://www.youtube.com/watch?v=RRyxCmLX_ag | |
* - https://www.youtube.com/watch?v=6hnLMnid1M0 | |
*/ |
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
const isset = x => x !== null && x !== undefined, | |
{log, error} = console, | |
xInputName = 'x-input', | |
xInputStyles = ` | |
:host { | |
background-color: green; | |
} |
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
/** | |
* Exploring animation keyframes with display `none` etc. | |
*/ | |
document.body.innerHTML = ` | |
<style> | |
@keyframes slide-in { | |
0% { | |
display: none; |
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
document.body.innerHTML = ` | |
<style> | |
table { | |
position: relative; | |
overflow: auto; | |
} | |
table, td, th { | |
border: 1px solid; | |
} | |
thead th { |
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
document.body.innerHTML = ` | |
<style> | |
html, body { | |
font-family: Arial, Verdana Helvetica, Sans-serif; | |
} | |
table { | |
width: 80vw; | |
} |
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
class TN { | |
constructor(assocList) { | |
if (assocList) { | |
assocList.forEach(([k, v]) => { | |
this.set(k, v); | |
}); | |
} | |
} | |
set(k, v)) { |
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
export const | |
getRowIndex = (itemIdx: number, itemsPerRow: number): number => | |
Math.round((itemIdx - (itemIdx % itemsPerRow)) / itemsPerRow), | |
getColumnIndex = (itemIdx: number, itemsPerRow: number): number => | |
itemIdx % itemsPerRow | |
; |
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
/** | |
* Idea for assoc_list_helpers (for going to and fro associated lists on specific keys and as a whole) (untested, and/or incomplete implementations) | |
*/ | |
const | |
/** | |
* Returns an associated list on incoming's object type. | |
* @note Does deep conversion on all values of passed in type's type. | |
* @note Useful for working with object primitive (json and the like). |
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
import {isset} from 'fjl'; | |
const easings = { | |
linear(t) { | |
return t; | |
}, | |
easeInQuad(t) { | |
return t * t; | |
}, | |
easeOutQuad(t) { |