diff options
author | German Lashevich <german.lashevich@gmail.com> | 2018-04-30 02:13:23 +0300 |
---|---|---|
committer | German Lashevich <german.lashevich@gmail.com> | 2018-04-30 02:34:21 +0300 |
commit | bfa19be4a1a176529c9338f0d6b4af8aae2562b8 (patch) | |
tree | e4fd4167646aec2255794ae0872e0930f4050d0c | |
parent | 3fed277a4181869057588e440679bf53e639079c (diff) |
🎨 Format the code
-rw-r--r-- | static/css/hugo-easy-gallery.css | 82 |
1 files changed, 49 insertions, 33 deletions
diff --git a/static/css/hugo-easy-gallery.css b/static/css/hugo-easy-gallery.css index d78dfec..c0bfa98 100644 --- a/static/css/hugo-easy-gallery.css +++ b/static/css/hugo-easy-gallery.css @@ -3,49 +3,50 @@ Put this file in /static/css/hugo-easy-gallery.css Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/ */ +/* Grid Layout Styles */ -/* -Grid Layout Styles -*/ .gallery { overflow: hidden; margin: 10px; max-width: 768px; } + .gallery .box { float: left; position: relative; /* Default: 1 tile wide */ width: 100%; - padding-bottom: 100%; + padding-bottom: 100%; } -@media only screen and (min-width : 365px) { + +@media only screen and (min-width: 365px) { /* Tablet view: 2 tiles */ .gallery .box { width: 50%; padding-bottom: 50%; } } -@media only screen and (min-width : 480px) { + +@media only screen and (min-width: 480px) { /* Small desktop / ipad view: 3 tiles */ .gallery .box { width: 33.3%; - padding-bottom: 33.3%; /* */ + padding-bottom: 33.3%; } } -@media only screen and (min-width : 9999px) { - /* Medium desktop: 4 tiles */ - .box { - width: 25%; - padding-bottom: 25%; - } + +@media only screen and (min-width: 9999px) { + /* Medium desktop: 4 tiles */ + .box { + width: 25%; + padding-bottom: 25%; + } } -/* -Transition styles -*/ +/* Transition styles */ + .gallery.hover-transition figure, -.gallery.hover-effect-zoom .img, +.gallery.hover-effect-zoom .img, .gallery:not(.caption-effect-appear) figcaption, .fancy-figure:not(.caption-effect-appear) figcaption { -webkit-transition: all 0.3s ease-in-out; @@ -53,13 +54,15 @@ Transition styles -o-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; } -/* -figure styles -*/ + +/* Figure styles */ + figure { - position:relative; /* purely to allow absolution positioning of figcaption */ + position: relative; + /* purely to allow absolution positioning of figcaption */ overflow: hidden; } + .gallery figure { position: absolute; left: 5px; @@ -67,22 +70,24 @@ figure { top: 5px; bottom: 5px; } + .gallery.hover-effect-grow figure:hover { transform: scale(1.05); } + .gallery.hover-effect-shrink figure:hover { transform: scale(0.95); } + .gallery.hover-effect-slidedown figure:hover { transform: translateY(5px); } + .gallery.hover-effect-slideup figure:hover { transform: translateY(-5px); } -/* -img / a styles -*/ +/* img / a styles */ .gallery .img { position: absolute; @@ -94,12 +99,16 @@ img / a styles background-position: 50% 50%; background-repeat: no-repeat; } + .gallery.hover-effect-zoom figure:hover .img { transform: scale(1.05); } + .gallery img { - display: none; /* only show the img if not inside a gallery */ + display: none; + /* only show the img if not inside a gallery */ } + figure a { position: absolute; left: 0; @@ -108,9 +117,8 @@ figure a { bottom: 0; } -/* -figcaption styles -*/ +/* figcaption styles */ + .gallery figcaption, .fancy-figure figcaption { position: absolute; @@ -120,24 +128,29 @@ figcaption styles background: #000; color: #FFF; text-align: center; - font-size: 75%; /* change this if you want bigger text */ + font-size: 75%; + /* change this if you want bigger text */ background: rgba(0, 0, 0, 0.5); opacity: 1; cursor: pointer; } + .gallery.caption-position-none figcaption, -.fancy-figure.caption-position-none figcaption { +.fancy-figure.caption-position-none figcaption { display: none; } + .gallery.caption-position-center figcaption, .fancy-figure.caption-position-center figcaption { top: 0; padding: 40% 5px; } + .gallery.caption-position-bottom figcaption, .fancy-figure.caption-position-bottom figcaption { padding: 5px; } + .gallery.caption-effect-fade figure:not(:hover) figcaption, .gallery.caption-effect-appear figure:not(:hover) figcaption, .fancy-figure.caption-effect-fade figure:not(:hover) figcaption, @@ -145,15 +158,18 @@ figcaption styles background: rgba(0, 0, 0, 0); opacity: 0; } + .gallery.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption, .fancy-figure.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption { margin-bottom: -100%; } + .gallery.caption-effect-slide.caption-position-center figure:not(:hover) figcaption, -.fancy-figure.caption-effect-slide.caption-position-center figure:not(:hover) figcaption { +.fancy-figure.caption-effect-slide.caption-position-center figure:not(:hover) figcaption { top: 100%; } + figcaption p { - margin: auto; /* override style in theme */ + margin: auto; + /* override style in theme */ } - |