Files
frm.so/notes.js

62 lines
1.7 KiB
JavaScript

img(`db/images/${networks[i].logo}`, "2.25em", "2.25em")
.marginTop(3, vh)
.paddingRight(0.5, em)
.onClick(function (finished) {
if(finished) {
this.setAttribute("selected", "")
}
})
.cursor("default")
.DEFAULT()
.opacity(0)
.borderLeft(0)
.paddingLeft(10, px)
.HOVERED()
.opacity(0.8)
.classStyle("selected")
.borderLeft("1px solid var(--accent)")
.paddingLeft(9, px)
quill gotchas
image width / height
forgetting to put a "/" at the beginning of the url for window.navigateTo (if you don't want to add to the existing url)
forgetting to define the event callback with or without the word "function", like so:
if you want "this" to be scoped to the element the listener is on:
.onClick(function (finished) {
if(finished) {
this.setAttribute("selected", "")
}
})
if you want "this" to be scoped to the parent shadow:
.onClick((finished) => {
if(finished) {
this.setAttribute("selected", "")
}
})
window.svg = async function svg(src, width, height) {
const res = await fetch(src);
const svgText = await res.text();
let container = document.createElement("div")
container.innerHTML = svgText;
const svg = container.querySelector("svg");
if(width)
svg.setAttribute("width", width);
if(height)
svg.setAttribute("height", height);
svg.style.display = "block";
svg.setAttribute("aria-hidden", "true");
quill.render(container)
return container
}
rendered 1 svg but gave an error on the attr() function