hugo-easy-gallery.css 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. Put this file in /static/css/hugo-easy-gallery.css
  3. Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
  4. */
  5. /*
  6. Grid Layout Styles
  7. */
  8. .gallery {
  9. overflow: hidden;
  10. margin: 10px;
  11. max-width: 768px;
  12. }
  13. .gallery .box {
  14. float: left;
  15. position: relative;
  16. /* Default: 1 tile wide */
  17. width: 100%;
  18. padding-bottom: 100%;
  19. }
  20. @media only screen and (min-width : 365px) {
  21. /* Tablet view: 2 tiles */
  22. .gallery .box {
  23. width: 50%;
  24. padding-bottom: 50%;
  25. }
  26. }
  27. @media only screen and (min-width : 480px) {
  28. /* Small desktop / ipad view: 3 tiles */
  29. .gallery .box {
  30. width: 33.3%;
  31. padding-bottom: 33.3%; /* */
  32. }
  33. }
  34. @media only screen and (min-width : 9999px) {
  35. /* Medium desktop: 4 tiles */
  36. .box {
  37. width: 25%;
  38. padding-bottom: 25%;
  39. }
  40. }
  41. /*
  42. Transition styles
  43. */
  44. .gallery.hover-transition figure,
  45. .gallery.hover-effect-zoom .img,
  46. .gallery:not(.caption-effect-appear) figcaption,
  47. .fancy-figure:not(.caption-effect-appear) figcaption {
  48. -webkit-transition: all 0.3s ease-in-out;
  49. -moz-transition: all 0.3s ease-in-out;
  50. -o-transition: all 0.3s ease-in-out;
  51. transition: all 0.3s ease-in-out;
  52. }
  53. /*
  54. figure styles
  55. */
  56. figure {
  57. position:relative; /* purely to allow absolution positioning of figcaption */
  58. overflow: hidden;
  59. }
  60. .gallery figure {
  61. position: absolute;
  62. left: 5px;
  63. right: 5px;
  64. top: 5px;
  65. bottom: 5px;
  66. }
  67. .gallery.hover-effect-grow figure:hover {
  68. transform: scale(1.05);
  69. }
  70. .gallery.hover-effect-shrink figure:hover {
  71. transform: scale(0.95);
  72. }
  73. .gallery.hover-effect-slidedown figure:hover {
  74. transform: translateY(5px);
  75. }
  76. .gallery.hover-effect-slideup figure:hover {
  77. transform: translateY(-5px);
  78. }
  79. /*
  80. img / a styles
  81. */
  82. .gallery .img {
  83. position: absolute;
  84. left: 0;
  85. right: 0;
  86. top: 0;
  87. bottom: 0;
  88. background-size: cover;
  89. background-position: 50% 50%;
  90. background-repeat: no-repeat;
  91. }
  92. .gallery.hover-effect-zoom figure:hover .img {
  93. transform: scale(1.05);
  94. }
  95. .gallery img {
  96. display: none; /* only show the img if not inside a gallery */
  97. }
  98. figure a {
  99. position: absolute;
  100. left: 0;
  101. right: 0;
  102. top: 0;
  103. bottom: 0;
  104. }
  105. /*
  106. figcaption styles
  107. */
  108. .gallery figcaption,
  109. .fancy-figure figcaption {
  110. position: absolute;
  111. bottom: 0;
  112. left: 0;
  113. right: 0;
  114. background: #000;
  115. color: #FFF;
  116. text-align: center;
  117. font-size: 75%; /* change this if you want bigger text */
  118. background: rgba(0, 0, 0, 0.5);
  119. opacity: 1;
  120. cursor: pointer;
  121. }
  122. .gallery.caption-position-none figcaption,
  123. .fancy-figure.caption-position-none figcaption {
  124. display: none;
  125. }
  126. .gallery.caption-position-center figcaption,
  127. .fancy-figure.caption-position-center figcaption {
  128. top: 0;
  129. padding: 40% 5px;
  130. }
  131. .gallery.caption-position-bottom figcaption,
  132. .fancy-figure.caption-position-bottom figcaption {
  133. padding: 5px;
  134. }
  135. .gallery.caption-effect-fade figure:not(:hover) figcaption,
  136. .gallery.caption-effect-appear figure:not(:hover) figcaption,
  137. .fancy-figure.caption-effect-fade figure:not(:hover) figcaption,
  138. .fancy-figure.caption-effect-appear figure:not(:hover) figcaption {
  139. background: rgba(0, 0, 0, 0);
  140. opacity: 0;
  141. }
  142. .gallery.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption,
  143. .fancy-figure.caption-effect-slide.caption-position-bottom figure:not(:hover) figcaption {
  144. margin-bottom: -100%;
  145. }
  146. .gallery.caption-effect-slide.caption-position-center figure:not(:hover) figcaption,
  147. .fancy-figure.caption-effect-slide.caption-position-center figure:not(:hover) figcaption {
  148. top: 100%;
  149. }
  150. figcaption p {
  151. margin: auto; /* override style in theme */
  152. }