Skip to content

Commit

Permalink
* adds a "capture screen" option to the settings in side panel (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoul0813 authored Oct 15, 2024
1 parent c6acb80 commit af837a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ <h4>Ready?</h4>

<section class="menu">
<section class="menutitle">
<img class="menuicon" src="imgs/right-arrow.png" />Breakpoints</section>
<img class="menuicon" src="imgs/down-arrow.png" />Breakpoints</section>
<section class="menucontent visible">
<section id="newbp">
<input type="text" id="bpaddr" />
Expand Down Expand Up @@ -276,6 +276,7 @@ <h4>Ready?</h4>
<label>Web Serial:</label>
<button id="web-serial-connect">Connect Serial</button>
</div>
<button id="screen-capture">Capture Screen</button>
</section>
</section>
</section>
Expand Down
12 changes: 12 additions & 0 deletions view/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ $('#canvas-smooth-val').on('change', (e) => {
}
})

$('#screen-capture').on('click', () => {
console.log('capture screen');
const canvas = document.getElementById('screen');
const image = canvas.toDataURL();
console.log('image', image);

const link = document.createElement('a');
link.href = image;
link.download = 'zeal-screenshot.png';
link.click();
});

jQuery(() => {
$('#continue').hide();
$('#pause').show();
Expand Down

0 comments on commit af837a3

Please sign in to comment.