diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-08-22 07:57:55 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-08-22 07:57:55 -0400 |
commit | df1bd4612692dbf0d37e26022e19515ab1097b54 (patch) | |
tree | 6a7eb1321de8acdbdd4c72f7f65fcd3772416534 /app/views/index.view.php | |
parent | 347281626b0ccde16ac9d7042c55d51677c9f2ee (diff) | |
download | thedroneely.com-df1bd4612692dbf0d37e26022e19515ab1097b54.tar.gz thedroneely.com-df1bd4612692dbf0d37e26022e19515ab1097b54.tar.bz2 thedroneely.com-df1bd4612692dbf0d37e26022e19515ab1097b54.zip |
public/css: Prevent responsive image reflow
Diffstat (limited to 'app/views/index.view.php')
-rw-r--r-- | app/views/index.view.php | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/app/views/index.view.php b/app/views/index.view.php index 7955fb7..f62a47d 100644 --- a/app/views/index.view.php +++ b/app/views/index.view.php @@ -23,13 +23,22 @@ In it for the long haul </h2> - <img data-image-zoom alt="Mountains" src="/images/mountains.jpg" - width="<?php echo getimagesize( - $_SERVER['DOCUMENT_ROOT'] . '/images/mountains.jpg' - )[0]; ?>" - height="<?php echo getimagesize( - $_SERVER['DOCUMENT_ROOT'] . '/images/mountains.jpg' - )[1]; ?>" > + <?php + $width = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/images/mountains.jpg')[0]; + $height = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/images/mountains.jpg')[1]; + $ratio = ((($height / $width) * 100) > 100) ? $height . 'px' : $height / $width * 100 . '%'; + ?> + + <figure> + <a href="/images/mountains.jpg" onclick="return false;"> + <div style="<?php echo 'padding-bottom:' . $ratio . ';'; ?>"> + <img data-image-zoom alt="Mountains" src="/images/mountains.jpg" + width="<?php echo $width; ?>" + height="<?php echo $height; ?>" + > + </div> + </a> + </figure> <div class="content"> |