Skip to content

Commit 4dab470

Browse files
authored
Merge pull request #49 from tmr232/render-page-open-code
Add a button to open the code on Github
2 parents 7bfcf62 + 38906af commit 4dab470

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/render/src/App.svelte

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@
149149
}, 1500);
150150
}
151151
152+
function openCode() {
153+
const urlSearchParams = new URLSearchParams(window.location.search);
154+
const githubUrl = urlSearchParams.get("github") ?? "";
155+
156+
if (!githubUrl) return;
157+
158+
window.open(githubUrl, "_blank").focus();
159+
}
160+
152161
function saveSVG() {
153162
if (!rawSVG) {
154163
return;
@@ -181,6 +190,7 @@
181190
<div class="controlsContainer">
182191
<div class="controls">
183192
<button on:click={resetView}>Reset View</button>
193+
<button on:click={openCode}>Open Code</button>
184194
<button on:click={saveSVG}>Download SVG</button>
185195
</div>
186196
</div>

0 commit comments

Comments
 (0)