forked from rebillar/site-accueil-insa
testing random background
This commit is contained in:
parent
51102ed581
commit
224fdbf687
3 changed files with 5721 additions and 1 deletions
5694
assets/img/obelix.svg
Normal file
5694
assets/img/obelix.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 820 KiB After Width: | Height: | Size: 820 KiB |
|
@ -20,9 +20,9 @@ header("Cache-Control: no-cache, must-revalidate");
|
||||||
<link rel="stylesheet" type="text/css" href="<?= $relativepath ?>assets/css/template.css" />
|
<link rel="stylesheet" type="text/css" href="<?= $relativepath ?>assets/css/template.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="<?= $relativepath ?>assets/css/queries.css" />
|
<link rel="stylesheet" type="text/css" href="<?= $relativepath ?>assets/css/queries.css" />
|
||||||
|
|
||||||
|
<!-- Icone du site, logo de la promo-->
|
||||||
<link rel = "shortcut icon" href = "<?= $relativepath ?>assets/img/ico_promo_60.ico" >
|
<link rel = "shortcut icon" href = "<?= $relativepath ?>assets/img/ico_promo_60.ico" >
|
||||||
|
|
||||||
|
|
||||||
<title><?= $pagetitle ?> | INSAT Accueil</title>
|
<title><?= $pagetitle ?> | INSAT Accueil</title>
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +103,33 @@ header("Cache-Control: no-cache, must-revalidate");
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- chargement du fond d'écran random -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var mobile_backgrounds = ['assets/img/asterix.svg', 'assets/img/adrenaline.svg', 'assets/img/obelix.svg', 'assets/img/assurancetourix.svg'];
|
||||||
|
var pc_backgrounds = ['pc_background.svg'];
|
||||||
|
|
||||||
|
var background = "";
|
||||||
|
|
||||||
|
// détecte les petits écrans (frigo connectés, 3DS ...)
|
||||||
|
//
|
||||||
|
if (window.innerWidth <= 800){
|
||||||
|
background = mobile_backgrounds[Math.floor(Math.random() * mobile_backgrounds.length)]
|
||||||
|
}else{
|
||||||
|
background = pc_backgrounds[Math.floor(Math.random() * pc_backgrounds.length)]
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementsByTagName('body')[0].style.backgroundImage = 'url(' + background + ')';
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($pagescript)) {
|
if (isset($pagescript)) {
|
||||||
echo $pagescript; //ici on appelle les scripts de la page (s'il y en a)
|
echo $pagescript; //ici on appelle les scripts de la page (s'il y en a)
|
||||||
|
|
Loading…
Reference in a new issue