Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Sep 4, 2024
1 parent 7bb113e commit e85f342
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@
An online runner to play, learn, and create with D2, the modern diagram
scripting language that turns text to diagrams.
</div>
<div id="hero-text-version">
</div>
<div id="hero-text-version"></div>
</div>
</div>
<div id="hero-right-drawing">
Expand Down Expand Up @@ -221,7 +220,11 @@
</div>
</div>
<div id="sketch-mobile" style="display: none">
<img id="sketch-mobile-icon" src="assets/icons/sketch.svg" class="btn-icon" />
<img
id="sketch-mobile-icon"
src="assets/icons/sketch.svg"
class="btn-icon"
/>
</div>
</div>
<div id="render-toolbar-right" class="workstation-toolbar-right">
Expand Down
4 changes: 3 additions & 1 deletion src/js/modules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ async function exportPNG() {
const width = parseFloat(viewBox[2]) * window.devicePixelRatio;
const height = parseFloat(viewBox[3]) * window.devicePixelRatio;

const blob = new Blob([new XMLSerializer().serializeToString(svgEl)], {type: 'image/svg+xml'});
const blob = new Blob([new XMLSerializer().serializeToString(svgEl)], {
type: "image/svg+xml",
});
const encoded = URL.createObjectURL(blob);

const tempImg = new Image();
Expand Down
8 changes: 6 additions & 2 deletions src/js/modules/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import QueryParams from "../lib/queryparams";

function init() {
readQueryParam();
document.getElementById("sketch-checkbox").addEventListener("change", (e) => toggleSketch(e.target.checked));
document.getElementById("sketch-mobile-icon").addEventListener("click", () => toggleSketch(QueryParams.get("sketch") === "0"));
document
.getElementById("sketch-checkbox")
.addEventListener("change", (e) => toggleSketch(e.target.checked));
document
.getElementById("sketch-mobile-icon")
.addEventListener("click", () => toggleSketch(QueryParams.get("sketch") === "0"));
updateMobileIcon(QueryParams.get("sketch") === "1");
}

Expand Down

0 comments on commit e85f342

Please sign in to comment.