Skip to content

Instantly share code, notes, and snippets.

View Danny-Engelman's full-sized avatar
💭
working on WCQ

Danny Engelman Danny-Engelman

💭
working on WCQ
View GitHub Profile
@Danny-Engelman
Danny-Engelman / index.html
Created July 12, 2023 16:55
HTML start file
<html>
<head>
<title></title>
<script src="element.js"></script>
</head>
<body>
</body>
</html>
@Danny-Engelman
Danny-Engelman / ACME BaseClass
Created July 15, 2023 07:29
A Component Making Elements - BaseClass
// ********************************************************** 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
@Danny-Engelman
Danny-Engelman / customElements.define.js
Created July 15, 2023 07:35
A customElements.define basic template
customElements.define("", class extends HTMLElement {
constructor() {
super()
.attachShadow({ mode: "open" })
.innerHTML = `<style></style>`;
}
connectedCallback() {
this.innerHTML = ``;
}
})