Mercurial > hg > mgallery
changeset 20:12916fcdb8b8
Improve the non-tabled mode.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 Sep 2015 12:59:54 +0300 |
parents | 59075f5e7a62 |
children | 1597dc762f14 |
files | basic.css mgallery.php |
diffstat | 2 files changed, 18 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/basic.css Mon Sep 14 12:49:56 2015 +0300 +++ b/basic.css Mon Sep 14 12:59:54 2015 +0300 @@ -62,17 +62,17 @@ font-size: 1.25em; } -table { +.galleryTable { width: 100%; } -td { +.galleryEntry { width: 15%; padding: 0.5em; text-align: center; } -table.albumTable { +.albumTable { background: #454; border-radius: 0.5em; border-top: 1px solid #343; @@ -81,22 +81,26 @@ border-right: 1px solid #787; } -table.imageTable td { +.imageTable .galleryEntry { } -table a, table a:visited { +.galleryTable a, .galleryTable a:visited { text-decoration: none; color: white; outline: 0; } -table a:hover, table a:active, table a:focus { +.galleryTable a:hover, .galleryTable a:active, .galleryTable a:focus { text-shadow: 1px 1px 2px #000; text-decoration: underline; color: #f00; } +div.galleryTable div.galleryEntry { + display: inline-block; + vertical-align: middle; +} /*
--- a/mgallery.php Mon Sep 14 12:49:56 2015 +0300 +++ b/mgallery.php Mon Sep 14 12:59:54 2015 +0300 @@ -138,7 +138,9 @@ $n = 0; if ($galUseTables) - echo "<table class=\"".$class."\">\n"; + echo "<table class=\"galleryTable ".$class."\">\n"; + else + echo "<div class=\"galleryTable ".$class."\">\n"; for ($index = $start; $index < $end; $index++) { @@ -148,9 +150,9 @@ if ($galUseTables && $n == 0) echo " <tr>\n"; if ($galUseTables) - echo " <td id=\"cd".$data["base"]."\">\n"; + echo " <td class=\"galleryEntry\" id=\"cd".$data["base"]."\">\n"; else - echo " <div class=\"albumEntry\">\n"; + echo " <div class=\"galleryEntry\">\n"; if ($data["type"] == 0) { @@ -208,6 +210,9 @@ } echo "</table>\n"; } + else + echo "</div>\n"; + return $index; }