GlisWeb framework
test02.php
Vai alla documentazione di questo file.
1 <?php
2 
3  // inclusione del framework
4  require '../../../_src/_config.php';
5 
6  // test
7  $tx = '<!DOCTYPE HTML>';
8  $tx .= '<html>';
9  $tx .= '<head>';
10  $tx .= '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">';
11  $tx .= '<meta name="viewport" content="width=device-width">';
12  $tx .= '</head>';
13  $tx .= '<h3>immagine responsiva <span id="dimensions"></span></h3>';
14  $tx .= '<picture style="width: 100%;">';
15  foreach( $ct['img']['formats']['l'] as $w => $h ) {
16  $tx .= '<source srcset="../../../var/immagini/' . $w . 'l/slide03.jpg" media="(orientation: landscape) and (max-width: ' . $w . 'px)">';
17  }
18  foreach( $ct['img']['formats']['p'] as $w => $h ) {
19  $tx .= '<source srcset="../../../var/immagini/' . $w . 'p/slide03.jpg" media="(orientation: portrait) and (max-width: ' . $w . 'px)">';
20  }
21  $tx .= '<img class="img-fluid" src="../../../var/immagini/slide03.jpg" alt="prova slide 03">';
22  $tx .= '</picture>';
23  $tx .= '<script>';
24  $tx .= 'window.onresize = displayWindowSize;';
25  $tx .= 'window.onload = displayWindowSize;';
26  $tx .= 'function displayWindowSize() {';
27  $tx .= 'myWidth = window.innerWidth;';
28  $tx .= 'myHeight = window.innerHeight;';
29  $tx .= ' document.getElementById("dimensions").innerHTML = myWidth + "x" + myHeight;';
30  $tx .= '};';
31  $tx .= '</script>';
32  $tx .= '</html>';
33 
34  // output
36 
37 ?>
if(isset( $cx['contatti'])) if(isset( $cf['site']['contatti'])) $ct['contatti']
Definition: _035.common.php:24
const MIME_TEXT_HTML
build( $content, $type=MIME_TEXT_PLAIN, $encoding=ENCODING_UTF8, $headers=array())
$tx
Definition: test02.php:7