diff --git a/assets/css/pages/gallery.scss b/assets/css/pages/gallery.scss index 8e0d5ab..cda8aa8 100644 --- a/assets/css/pages/gallery.scss +++ b/assets/css/pages/gallery.scss @@ -1,32 +1,37 @@ -div.gallery { - margin-bottom: 25px; - border: 1px solid #ccc; - min-width: 230px; - max-width: 320px; -} +.gallery-grid { + .gallery { + margin-bottom: 25px; + border: 1px solid #ccc; + width: 250px; -div.gallery:hover { - border: 1px solid #777; -} + &:hover { + border: 1px solid #777; + } -div.gallery img { - width: 100%; - height: auto; - margin-top: -20px; -} + a { + position: relative; + display: block; -div.gallery img:hover { - background: #0f1c33; - opacity: 0.35; -} + img { + width: 100%; + height: auto; -div.gallery span.flag-icon{ - float: right; - margin-top: 5px; - margin-right: 5px; -} + &:hover { + background: #0f1c33; + opacity: 0.35; + } + } + + .flag-icon{ + position: absolute; + top: 5px; + right: 5px; + } + } + } -div.desc { - padding: 15px; - text-align: center; + .desc { + padding: 15px; + text-align: center; + } } diff --git a/assets/js/app.js b/assets/js/app.js index 7ff5bfb..87eda17 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -18,3 +18,4 @@ window.moment = moment; })(jQuery); import './pages/landing.js'; +import './pages/gallery'; diff --git a/assets/js/pages/gallery.js b/assets/js/pages/gallery.js new file mode 100644 index 0000000..a89dbe5 --- /dev/null +++ b/assets/js/pages/gallery.js @@ -0,0 +1,10 @@ +import jQuery from 'jquery'; +import Masonry from 'masonry-layout'; + +jQuery(document).ready(function() { + const gallery = new Masonry('.gallery-grid', { + itemSelector: '.gallery', + columnWidth: 250, + gutter: 25 + }); +}); diff --git a/package.json b/package.json index 6b2c097..df55c2c 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "flag-icon-css": "^3.0.0", "font-awesome": "^4.7.0", "jquery": "^3.3.1", + "masonry-layout": "^4.2.1", "moment": "^2.22.2", "node-sass": "^4.9.0", "popper.js": "^1.14.3", diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 6d3e5bd..5740bc1 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -157,10 +157,10 @@ private function resizeImage(SplFileInfo $file, $destinationName) $imagick->resizeImage(453,640, 0, 1, true); - $imageWidth = $imagick->getImageWidth(); + /*$imageWidth = $imagick->getImageWidth(); if($imagick->getImageHeight() > $imageWidth * 1.5) { $imagick->cropImage($imageWidth,$imageWidth * 1.5,0,0); - } + }*/ if(is_writable(dirname($destinationName))) { return $imagick->writeImage($destinationName); diff --git a/templates/gallery/components/content.html.twig b/templates/gallery/components/content.html.twig index 5b0e90e..b1cc6e3 100644 --- a/templates/gallery/components/content.html.twig +++ b/templates/gallery/components/content.html.twig @@ -6,7 +6,7 @@ {% trans %}gallery_title{% endtrans %}
-
+