This commit is contained in:
Baptiste 2022-04-18 21:26:55 +02:00
parent c0dfc9a172
commit 78fcfa0245
2 changed files with 151 additions and 46 deletions

View file

@ -0,0 +1,93 @@
#map_section {
margin: auto;
margin-top: 30px;
border: 2px solid white;
width: 80%;
}
/* Map loading */
#loading-screen {
position: absolute;
z-index: 2;
/*top: 0; */
left: 0;
width: 100%;
height: 50%;
background-color: #000000;
opacity: 1;
transition: 1s opacity;
}
#loading-screen.fade-out {
opacity: 0;
}
.loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
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);
}
}

56
map.php
View file

@ -14,26 +14,6 @@ require_once 'assets/map/ajax.php';
} }
</style> </style>
<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="assets/map/script_map3d.js" type="module"></script>
<div id="map" class="hidden">
<?php echo file_get_contents("assets/map/map2d.svg"); ?>
<canvas id="canvasID"></canvas>
</div>
</div>
<script> <script>
function enable3DMap() { function enable3DMap() {
var map3d = document.querySelector('#maps #map3d'); var map3d = document.querySelector('#maps #map3d');
@ -53,7 +33,37 @@ require_once 'assets/map/ajax.php';
} }
</script> </script>
<main>
<div id="boxjaune">
<div id="circle_l" class="circle"></div>
<div id="circle_r" class="circle"></div>
<div id="title_in_box">Carte de l'insa</div>
<div id="circle_l" class="circle"></div>
<div id="circle_r" class="circle"></div>
</div>
<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="assets/map/script_map3d.js" type="module"></script>
<div id="map" class="hidden">
<?php echo file_get_contents("assets/map/map2d.svg"); ?>
<canvas id="canvasID"></canvas>
</div>
</div>
<script type="text/javascript" src="assets/map/script_map2d.js"></script> <script type="text/javascript" src="assets/map/script_map2d.js"></script>
</section>
<p> <p>
Une petite note sur le numéro des salles : sur ton emploi du temps, le bâtiment est marqué en premier, et Une petite note sur le numéro des salles : sur ton emploi du temps, le bâtiment est marqué en premier, et
@ -62,9 +72,11 @@ require_once 'assets/map/ajax.php';
<p> <p>
Par exemple, GM 212, c'est au GM, deuxième étage. Par exemple, GM 212, c'est au GM, deuxième étage.
<br> <br>
Et si t'as Amphi 108, c'est au premier étage du STPI. En gros STPI=bâtiment des amphis. Et si t'as Amphi 108, c'est au premier étage du STPI(c'est ton département et c'est il y a les amphis).
</p> </p>
<p id="hint">Fond de carte issu du site <a href="https://www.openstreetmap.org/#map=17/43.57103/1.46591">Open Street
<p id="hint">
Fond de carte issu du site <a href="https://www.openstreetmap.org/#map=17/43.57103/1.46591">Open Street
Map</a>. Map</a>.
</p> </p>
</main> </main>