Skip to content

Commit

Permalink
hiding the lines
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Nov 7, 2024
1 parent a073451 commit 3e17461
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/modelviewer.dev/examples/annotations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,20 @@ <h4 id="intro"><span class="font-medium">Animated Hotspots. </span></h4>

window.addEventListener("resize", onResize);

modelViewer1.addEventListener('ar-status', onResize);
function setVisible(visible) {
lines.forEach((element) => {
if (visible) {
element.classList.remove('hide');
} else {
element.classList.add('hide');
}
});
}

modelViewer1.addEventListener('ar-status', (event) => {
setVisible(event.detail.status !== 'session-started');
onResize();
});

modelViewer1.addEventListener('load', () => {
onResize();
Expand Down

0 comments on commit 3e17461

Please sign in to comment.