60 lines
1.6 KiB
PHP
Executable File
60 lines
1.6 KiB
PHP
Executable File
<style type="text/css">
|
|
#overlay {
|
|
position: fixed; /* Sit on top of the page content */
|
|
display: none; /* Hidden by default */
|
|
width: 100%; /* Full width (cover the whole page) */
|
|
height: 100%; /* Full height (cover the whole page) */
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-color: rgba(0,0,0,0.5); /* Black background with opacity */
|
|
z-index: 212; /* Specify a stack order in case you're using a different order for other elements */
|
|
cursor: pointer; /* Add a pointer on hover */
|
|
}
|
|
|
|
#overlayText{
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
font-size: 50px;
|
|
color: white;
|
|
transform: translate(-50%,-50%);
|
|
-ms-transform: translate(-50%,-50%);
|
|
}
|
|
</style>
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
let overlayEnabled = false; // drapeau bloquant
|
|
|
|
function onOverlay() {
|
|
document.getElementById("overlay").style.display = "block";
|
|
// alert('On');
|
|
}
|
|
|
|
function offOverlay() {
|
|
document.getElementById("overlay").style.display = "none";
|
|
// alert('Off');
|
|
}
|
|
</script>
|
|
|
|
<?php
|
|
echo '<div id="overlay" >';
|
|
echo '<div id="overlayText">' .$overlayText. '</div>';
|
|
echo '</div>';
|
|
|
|
function flushOverlay($overlayText) {
|
|
// echo 'flushOverlay : ' .$overlayText;
|
|
ob_flush();
|
|
flush();
|
|
usleep(1000); // 0,01 seconde
|
|
echo '<script type="text/javascript">';
|
|
echo "onOverlay();";
|
|
echo "if (document.getElementById('overlayText')) document.getElementById('overlayText').innerHTML =' ".$overlayText."';";
|
|
echo "</script>";
|
|
ob_flush();
|
|
flush();
|
|
ob_flush();
|
|
sleep(1); // ← PAUSE ici (1 secondes) avant la suite du traitement PHP
|
|
}
|
|
?>
|