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
customElements.define("", class extends HTMLElement { | |
constructor() { | |
super() | |
.attachShadow({ mode: "open" }) | |
.innerHTML = `<style></style>`; | |
} | |
connectedCallback() { | |
this.innerHTML = ``; | |
} | |
}) |
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
customElements.define("", class extends HTMLElement { | |
constructor() { | |
super() | |
.attachShadow({ mode: "open" }) | |
.innerHTML = `<style></style>`; | |
} | |
connectedCallback() { | |
this.innerHTML = ``; | |
} | |
}) |
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
// ********************************************************** ACME_BaseClass | |
class ACME_BaseClass extends HTMLElement { | |
// ======================================================== ACME_BaseClass.$query | |
$query( | |
// selector is a DOM selector string eg. "div:not[id='1']" | |
// if starts with * then return all elements as NodeList | |
// if starts with ** then return all elements as Array | |
selector, | |
// optional 2nd parameter is the root element to query from | |
root = this.shadowRoot || this |
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
<html> | |
<head> | |
<title></title> | |
<script src="element.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
// The native TreeWalker API has been around for ages, IE9 was the last Browser to implement it ... in 2011 | |
function log() { | |
console.log(`%c TreeWalker `, `background:purple;color:yellow`, ...arguments); | |
} | |
// find element takes a function definition, the output must be Truthy or Falsy | |
function findElements( | |
acceptFunc = (x) => customElements.get(x.localName) || false | |
) { | |
log("start"); | |
console.time("TreeWalker"); |
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
<script>navigator.serviceWorker.register('sw.js').then(()=>{location.href="$/index.js"})</script> |
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
/* | |
Open F12 Network Tab | |
Press Ctrl-Shift-I to open SECOND console window | |
Execute this script (runs in first Console window) | |
*/ | |
const rsColor='lightgreen'; | |
const rsStaticColor=rsColor; | |
const remoteColor='pink'; | |
let remoteTime=0; | |
let localTime=0; |
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
display(letter) { | |
let char2bitarray = (char) => { | |
const font8x8 = [ | |
[0, 0, 0, 0, 0, 0, 0, 0], // U+0020 (space) | |
[24, 60, 60, 24, 24, 0, 24, 0], // U+0021 (!) | |
[54, 54, 0, 0, 0, 0, 0, 0], // U+0022 (") | |
[54, 54, 127, 54, 127, 54, 54, 0], // U+0023 (#) | |
[12, 62, 3, 30, 48, 31, 12, 0], // U+0024 ($) | |
[0, 99, 51, 24, 12, 102, 99, 0], // U+0025 (%) | |
[28, 54, 28, 110, 59, 51, 110, 0], // U+0026 (&) |
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
/* | |
CSS changes for: https://transalpclub.nl/forum/unread | |
apply with Stylus Browser extension (or anyway you want to add CSS) | |
*/ | |
body { | |
/* minder witruimte rondom tekstregels */ | |
line-height: 1em; |
NewerOlder