specter-desktop/src/cryptoadvance/specter/templates/includes/overlay.html
Kim Neunert 556ec5f961
Releasing procedure with pip (#69)
* automate pip-packages-gen + upload for gittags
release documentation
proper package including and  static + templates

* Change import- and start  logic, removed cli.py

* project-renaming to cryptoadvance.specter
propoer packaging
include proper dependencies

* Adding requirements.txt

* Specify maintainers and thanks to contributors

* Removing test-url for pip-uload. This is now live!
2020-02-20 13:00:53 +01:00

115 lines
3.7 KiB
HTML

<style>
.page_overlay {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
background-color: rgba(0,0,0, 0.75);
z-index: 2;
}
.page_overlay_popup {
display: none;
/*margin: 0 auto;*/
max-width: 450px;
text-align: center;
border-radius: 0.5em;
border: 2px solid #313E50;
background-color: #192432;
z-index: 3;
padding: 1.5em;
}
.page_overlay_popup_cancel {
margin-top: 2em;
float: right;
}
</style>
<div class="page_overlay" id="page_overlay">
<div class="page_overlay_popup" id="page_overlay_popup">
<div id="page_overlay_popup_content"></div>
<div class="page_overlay_popup_cancel"><a href="#" id="page_overlay_popup_cancel_button" class="item medium">cancel</a></div>
<br/>
<div class="clear-both"></div>
</div>
</div>
<script>
function initPageOverlay(container_id) {
// Transfer the content to a new hidden div
var holder = document.createElement("DIV");
holder.style.display = "none";
document.body.appendChild(holder);
holder.appendChild(document.getElementById(container_id));
}
function showPageOverlay(container_id) {
// Transfer the content to the popup overlay div
document.getElementById("page_overlay_popup_content").appendChild(document.getElementById(container_id));
// Show the whole-screen dimming layer
var overlay = document.getElementById("page_overlay");
overlay.style.display = "flex";
// Position and show the popup
var overlayPopup = document.getElementById("page_overlay_popup");
// var top_position = (window.innerHeight/2) - overlayPopup.offsetHeight/2;
// if (top_position < 20) { top_position = 20; }
// overlayPopup.style.position = "relative";
overlayPopup.style.display = "block";
// overlayPopup.style.top = top_position;
// Show the content
var pageContent = document.getElementById("page_overlay_popup_content").children[0];
pageContent.style.display = "block";
window.scrollTo(0, 0);
}
function hidePageOverlay() {
// Transfer the content back into a holder div
initPageOverlay(document.getElementById("page_overlay_popup_content").children[0].id);
var overlay = document.getElementById("page_overlay");
overlay.style.display = "none";
var overlayPopup = document.getElementById("page_overlay_popup");
overlayPopup.style.display = "none";
}
document.addEventListener("DOMContentLoaded", function(){
// Handler when the DOM is fully loaded
document.getElementById("page_overlay_popup_cancel_button").addEventListener("click", function(event) {
// Wire up the popup cancel button
hidePageOverlay();
});
document.addEventListener("keyup", function(e) {
// Dismiss popup with ESC button
if (e.keyCode == 27) {
var elem = document.getElementById("page_overlay");
// If it's visible... (using jQuery's visibility test)
if (!!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length )) {
hidePageOverlay();
}
}
});
document.getElementById("page_overlay").addEventListener("click", function(e) {
// Ignore clicks on children
if(e.target !== e.currentTarget) return;
hidePageOverlay();
});
});
</script>