Skip to content

Commit

Permalink
fix visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinidadec committed Nov 9, 2023
1 parent 4ac79ef commit 0c7dc7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<button id="download" height="10">Download</button>
Log:
<br>
<pre id="log" style="height: 5pc; overflow-y: scroll;background-color: lightgray;"></pre>
<pre id="log" style="height: 5pc; overflow-y: scroll; background-color: lightgray;"></pre>
Output:
<br>
<img id="output-image" style="visibility: hidden;" alt="Image">
<pre id="output-text" style="visibility: hidden; height: 30pc; overflow-y: scroll;background-color: lightgray;"></pre>
<img id="output-image" style="display: none;" alt="Image">
<pre id="output-text" style="display: none; height: 30pc; overflow-y: scroll; background-color: lightgray;"></pre>
</body>
<script type="module" src="web-test.mjs"></script>
</html>
8 changes: 4 additions & 4 deletions web-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ document.getElementById('download').addEventListener('click', () => {
const image = new Blob([buffer], { type: 'image/jpeg' });
const imageUrl = URL.createObjectURL(image);
// @ts-ignore
document.getElementById('output-image').style.visibility = 'visible'
document.getElementById('output-image').style.display = 'block'
// @ts-ignore
document.getElementById('output-image').src = imageUrl;
return
}

// @ts-ignore
document.getElementById('output-text').style.visibility = 'visible'
document.getElementById('output-text').style.display = 'block'
// @ts-ignore
document.getElementById('output-text').innerText = new TextDecoder().decode(buffer)
})
});

const reset = () => {
// @ts-ignore
document.getElementById('output-image').style.visibility = 'hidden'
document.getElementById('output-image').style.display = 'none'
// @ts-ignore
document.getElementById('output-text').style.visibility = 'hidden'
document.getElementById('output-text').style.display = 'none'
}

0 comments on commit 0c7dc7c

Please sign in to comment.