forked from rebillar/site-accueil-insa
150 lines
3.5 KiB
PHP
150 lines
3.5 KiB
PHP
|
<?php
|
||
|
//ce fichier doit être inclut dans une page html avec un iframe de telle sorte à ce que tout les liens dans les js soient OK.
|
||
|
require_once 'ajax.php';
|
||
|
?>
|
||
|
|
||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
|
||
|
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
||
|
crossorigin="anonymous"></script>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
|
||
|
|
||
|
<style>
|
||
|
.hidden {
|
||
|
display: none;
|
||
|
}
|
||
|
|
||
|
/* Map loading */
|
||
|
#loading-screen {
|
||
|
position: absolute;
|
||
|
z-index: 2;
|
||
|
/*top: 0; */
|
||
|
left: 0;
|
||
|
width: 100vw;
|
||
|
height: 50vh;
|
||
|
background-color: #000000;
|
||
|
opacity: 1;
|
||
|
transition: 1s opacity;
|
||
|
}
|
||
|
|
||
|
#loading-screen.fade-out {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
|
||
|
.loader {
|
||
|
display: block;
|
||
|
position: relative;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
width: 40vh;
|
||
|
height: 40vh;
|
||
|
margin: -20vh 0 0 -20vh;
|
||
|
border-radius: 50%;
|
||
|
border: 3px solid transparent;
|
||
|
border-top-color: #9370DB;
|
||
|
-webkit-animation: spin 2s linear infinite;
|
||
|
animation: spin 2s linear infinite;
|
||
|
}
|
||
|
.loader:before {
|
||
|
content: "";
|
||
|
position: absolute;
|
||
|
top: 5px;
|
||
|
left: 5px;
|
||
|
right: 5px;
|
||
|
bottom: 5px;
|
||
|
border-radius: 50%;
|
||
|
border: 3px solid transparent;
|
||
|
border-top-color: #BA55D3;
|
||
|
-webkit-animation: spin 3s linear infinite;
|
||
|
animation: spin 3s linear infinite;
|
||
|
}
|
||
|
.loader:after {
|
||
|
content: "";
|
||
|
position: absolute;
|
||
|
top: 15px;
|
||
|
left: 15px;
|
||
|
right: 15px;
|
||
|
bottom: 15px;
|
||
|
border-radius: 50%;
|
||
|
border: 3px solid transparent;
|
||
|
border-top-color: #FF00FF;
|
||
|
-webkit-animation: spin 1.5s linear infinite;
|
||
|
animation: spin 1.5s linear infinite;
|
||
|
}
|
||
|
|
||
|
@-webkit-keyframes spin {
|
||
|
0% {
|
||
|
-webkit-transform: rotate(0deg);
|
||
|
-ms-transform: rotate(0deg);
|
||
|
transform: rotate(0deg);
|
||
|
}
|
||
|
100% {
|
||
|
-webkit-transform: rotate(360deg);
|
||
|
-ms-transform: rotate(360deg);
|
||
|
transform: rotate(360deg);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@keyframes spin {
|
||
|
0% {
|
||
|
-webkit-transform: rotate(0deg);
|
||
|
-ms-transform: rotate(0deg);
|
||
|
transform: rotate(0deg);
|
||
|
}
|
||
|
100% {
|
||
|
-webkit-transform: rotate(360deg);
|
||
|
-ms-transform: rotate(360deg);
|
||
|
transform: rotate(360deg);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#map_section {
|
||
|
position: absolute;
|
||
|
margin: auto;
|
||
|
margin-top: 0;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
width: 100vw;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<script>
|
||
|
function enable3DMap() {
|
||
|
var map3d = document.querySelector('#maps #map3d');
|
||
|
var map = document.querySelector('#maps #map');
|
||
|
|
||
|
map3d.classList.add("hidden");
|
||
|
map.classList.add("hidden");
|
||
|
map3d.classList.remove("hidden");
|
||
|
}
|
||
|
|
||
|
function enable2DMap() {
|
||
|
var map3d = document.querySelector('#maps #map3d');
|
||
|
var map = document.querySelector('#maps #map');
|
||
|
map.classList.add("hidden");
|
||
|
map3d.classList.add("hidden");
|
||
|
map.classList.remove("hidden");
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<section id="map_section">
|
||
|
<div id="maps_button">
|
||
|
<button onclick="enable3DMap()" class="main-button">Map 3D</button>
|
||
|
<button onclick="enable2DMap()" class="main-button">Map 2D</button>
|
||
|
</div>
|
||
|
|
||
|
<section id="loading-screen">
|
||
|
<div class="loader"></div>
|
||
|
</section>
|
||
|
|
||
|
<div id="maps" class="">
|
||
|
<script src="script_map3d.js" type="module"></script>
|
||
|
|
||
|
<div id="map" class="hidden">
|
||
|
<?php echo file_get_contents("map2d.svg"); ?>
|
||
|
<canvas id="canvasID"></canvas>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script type="text/javascript" src="script_map2d.js"></script>
|
||
|
</section>
|