mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
Remove logging
This commit is contained in:
parent
dce356dff8
commit
4c8091337e
3 changed files with 6 additions and 7 deletions
|
|
@ -337,7 +337,7 @@
|
|||
} else { // Render using data url (storage disabled)
|
||||
src = "data:text/html," + SCRIPT_LOADER;
|
||||
}
|
||||
console.log("src", src)
|
||||
console.log("Loading script with source:\n" + src)
|
||||
iframe.src = src;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,5 @@ function QRCodeURL(url, options) {
|
|||
let size = options?.size ?? 547;
|
||||
let errorCorrection = options?.correction ?? 'L';
|
||||
let margin = options?.margin?.toString() || "1";
|
||||
console.log("margin", options?.margin);
|
||||
return `https://chart.googleapis.com/chart?cht=qr&chs=${size}x${size}&chld=${errorCorrection}|${margin}&choe=UTF-8&chl=${encodeURIComponent(url || location.href)}`;
|
||||
}
|
||||
|
|
@ -283,23 +283,23 @@ function render() {
|
|||
|
||||
var bgImg = new Image();
|
||||
bgImg.onload = function(){
|
||||
console.log("bgImg", bgImg, bgImg.naturalHeight, bgImg.naturalWidth)
|
||||
let thumbnail = document.querySelector("#thumbnail");
|
||||
let thumbnailContainer = document.querySelector("#thumbnail-container");
|
||||
thumbnail.style.backgroundImage = 'url(' + bgImg.src + ')';
|
||||
console.log("bgImg.naturalHeight / window.innerHeight", bgImg.naturalHeight, thumbnailContainer.offsetHeight, thumbnailContainer.offsetHeight / bgImg.naturalHeight)
|
||||
thumbnail.style.filter = `blur(${thumbnailContainer.offsetHeight / bgImg.naturalHeight}px)`;
|
||||
thumbnail.style.transform = `scale(1.1)`;
|
||||
};
|
||||
bgImg.src = image;
|
||||
|
||||
|
||||
let originalURL = json.mainEntityOfPage?.["@id"] || json.mainEntityOfPage || json.url;
|
||||
document.body.appendChild(
|
||||
m(".recipe", {},
|
||||
image ? m("#thumbnail-container", m("#thumbnail.thumbnail.noprint", { style: "background-image:url(" + ");" })) : null,
|
||||
m("article",
|
||||
m("header",
|
||||
m("img.publisher", { src: json.publisher?.image ?.[0]?.url ?? json.publisher ?.logo ?.url }),
|
||||
m("a", {href:originalURL, target:"_blank"},
|
||||
m("img.publisher", { src: json.publisher?.image ?.[0]?.url ?? json.publisher ?.logo ?.url }),
|
||||
),
|
||||
m("h1", title),
|
||||
m(".metadata",
|
||||
m("div", m("span.yield", m(".icon.material-icons-outlined", "restaurant"), yield)),
|
||||
|
|
@ -324,7 +324,7 @@ function render() {
|
|||
|
||||
m("div.spacer"),
|
||||
m(".actions",
|
||||
m("a.action.noprint", { title:"Open original", href: json.mainEntityOfPage || json.url, target:"_blank"}, m(".icon.material-icons-outlined", "public")),
|
||||
m("a.action.noprint", { title:"Open original", href: originalURL, target:"_blank"}, m(".icon.material-icons-outlined", "public")),
|
||||
m("a.action.noprint", { title:"Share", onclick: share}, m(".icon.material-icons-outlined", "share")),
|
||||
m("a.action.noprint", { title:"Show steps as list", href: "#", onclick: () => {reformat = !reformat; render(); return false;}}, m(".icon.material-icons-outlined", "notes")),
|
||||
m("a.action.noprint", { title:"Print", href: "#", onclick: () => window.print() }, m(".icon.material-icons-outlined", "print")),
|
||||
|
|
|
|||
Loading…
Reference in a new issue