This commit is contained in:
jcheca
2024-08-08 16:28:16 +02:00
parent b4dfc443a7
commit ff50d6d054
4 changed files with 148 additions and 1 deletions

View File

@@ -67,6 +67,50 @@
font-size: 16px;
}
</style>
<style>
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
padding-top: 60px;
}
.modal-content {
background-color: #fefefe;
margin: 5% auto;
padding: 20px;
border: 5px solid #888;
width: 80%;
max-height: 70vh;
overflow-y: auto;
}
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
<body>
@@ -105,6 +149,37 @@
</div>
<button id="myBtn">Resultat</button>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close">&times;</span>
<pre id="jsonContent"></pre>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var modal = document.getElementById("myModal");
var btn = document.getElementById("myBtn");
var span = document.getElementsByClassName("close")[0];
var jsonContent = document.getElementById("jsonContent");
btn.onclick = function() {
fetch('/web3/')
.then(response => response.json())
.then(data => {
jsonContent.textContent = JSON.stringify(data, null, 2);
modal.style.display = "block";
});
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
});
</script>
<div class="container" id="block-form">
<h1 id="welcome">BIENVENUE DANS LE PONG 42</h1>
<div class="input-container">