Skip to content

Commit

Permalink
show switcher on home page instead of modal
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Jul 12, 2024
1 parent 3d93f29 commit fa4fbbd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
11 changes: 10 additions & 1 deletion css/switch-deploy.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#switch-deploy {
position: fixed;
left: 10px;
bottom: 10px;
display: flex;
flex-direction: row;
align-items: center;
z-index: 1;
background-color: #fff;
padding: 5px;
border-radius: 5px;
border: 1px solid #000;
}

#switch-deploy-button {
Expand All @@ -16,8 +24,9 @@

#switch-deploy-button:hover {
background-color: #c5c5c5;
cursor: pointer;
}

#switch-deploy-text {
margin: 0 10px 0 0;
margin: 0 7px 0 0;
}
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,18 @@
</li>
</ul>
</div>
<div id="switch-deploy">
<p id="switch-deploy-text">Switch to</p>
<button id="switch-deploy-button">release</button>
</div>
</div>

<div id="views">
<p>Select a view:</p>
<div id="view-selector" class="view-selector-menu"></div>
</div>

<div id="switch-deploy">
<p id="switch-deploy-text">Switch to</p>
<button id="switch-deploy-button">release</button>
</div>

<canvas id="canvas" width="100vw" height="100vh"></canvas>

<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" type="text/javascript"></script>
Expand Down
7 changes: 7 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ function showViewsMenu() {
viewsMenu.style.display = "flex";
}

function hideDeploySwitch() {
const deploySwitch = document.getElementById("switch-deploy");

deploySwitch.style.display = "none";
}

document.getElementById("input-file").addEventListener("change", (event) => {
for (const file of event.target.files) {
if (!file.name.endsWith("edm4hep.json")) {
Expand Down Expand Up @@ -133,6 +139,7 @@ document
showEventSwitcher();
showViewsMenu();
renderEvent(eventNum);
hideDeploySwitch();
});

export { canvas, ctx, jsonData, selectedObjectTypes };

0 comments on commit fa4fbbd

Please sign in to comment.