Commit c65521c0 by John Fox Woland

v Mobile styling

parent 70a7b04e
......@@ -5,6 +5,7 @@
header("Content-type: text/html; charset=utf-8");
$config = require('config.php');
$bgSize = Tools::imageGeometry(__DIR__ . '/img/bg1.png');
$faceSize = Tools::imageGeometry(__DIR__ . '/img/face.jpg');
?>
......@@ -34,6 +35,12 @@
<script src="https://use.fontawesome.com/2e3b6ecdb9.js"></script>
<?php Tools::css('styles.css.php'); ?>
<script language="javascript">
BGSIZE = {
w: <?=$bgSize['width']?>,
h: <?=$bgSize['height']?>
}
</script>
<?php Tools::js('main.js'); ?>
<link href="<?=Tools::res('img/favicon.ico')?>" rel="shortcut icon" type="image/vnd.microsoft.icon" />
</head>
......
......@@ -6,12 +6,24 @@ function blockResize ()
var h = $window.height();
$('.block').each(function () {
var $block = $(this);
var $block = $(this),
bh;
$block.height('auto');
if ($block.outerHeight() < h)
$block.outerHeight(h);
if ((bh = $block.outerHeight()) < h)
bh = h;
if (BGSIZE.w)
{
if ($window.width() / $window.height() > BGSIZE.w / BGSIZE.h)
$block.attr('style', 'background-size: 100% auto !important');
else
$block.attr('style', 'background-size: auto 100% !important');
}
if (bh == h)
$block.outerHeight(bh);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment