_content.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. .content {
  2. display: flex;
  3. flex-wrap: wrap;
  4. padding: 50px 0 33px;
  5. width: 100%;
  6. min-height: calc(100% - 83px);
  7. -webkit-overflow-scrolling: touch;
  8. &::before {
  9. content: '';
  10. position: absolute;
  11. left: 0;
  12. width: 100%;
  13. height: 1px;
  14. background: white(.02);
  15. }
  16. &--sidebar {
  17. width: calc(100% - 300px);
  18. }
  19. // Animations -------------------------------------------------------------- //
  20. &.contentZoomIn .album,
  21. &.contentZoomIn .photo {
  22. animation-name: zoomIn;
  23. }
  24. &.contentZoomIn .divider {
  25. animation-name: fadeIn;
  26. }
  27. &.contentZoomOut .album,
  28. &.contentZoomOut .photo {
  29. animation-name: zoomOut;
  30. }
  31. &.contentZoomOut .divider {
  32. animation-name: fadeOut;
  33. }
  34. // Albums and Photos ------------------------------------------------------ //
  35. .album,
  36. .photo {
  37. position: relative;
  38. width: 202px;
  39. height: 202px;
  40. margin: 30px 0 0 30px;
  41. cursor: default;
  42. animation-duration: .2s;
  43. animation-fill-mode: forwards;
  44. animation-timing-function: $timing;
  45. img {
  46. position: absolute;
  47. width: 200px;
  48. height: 200px;
  49. background: #222;
  50. color: #222;
  51. box-shadow: 0 2px 5px black(.5);
  52. border: 1px solid white(.5);
  53. transition: opacity .3s ease-out, transform .3s ease-out, border-color .3s ease-out;
  54. }
  55. &:hover img,
  56. &.active img {
  57. border-color: $colorBlue;
  58. }
  59. &:active img {
  60. transition: none;
  61. border-color: darken($colorBlue, 15%);
  62. }
  63. }
  64. // Album -------------------------------------------------------------- //
  65. .album {
  66. img:first-child,
  67. img:nth-child(2) {
  68. transform: rotate(0) translateY(0) translateX(0);
  69. opacity: 0;
  70. }
  71. &:hover img:nth-child(1),
  72. &:hover img:nth-child(2) {
  73. opacity: 1;
  74. // Keep the composited layer created by the browser during the animation.
  75. // Makes the border of the transformed thumb look better.
  76. // See https://github.com/electerious/Lychee/pull/626 for more.
  77. will-change: transform;
  78. }
  79. &:hover img:nth-child(1) {
  80. transform: rotate(-2deg) translateY(10px) translateX(-12px);
  81. }
  82. &:hover img:nth-child(2) {
  83. transform: rotate(5deg) translateY(-8px) translateX(12px);
  84. }
  85. }
  86. // Overlay -------------------------------------------------------------- //
  87. .album .overlay,
  88. .photo .overlay {
  89. position: absolute;
  90. margin: 0 1px;
  91. width: 200px;
  92. background: linear-gradient(to bottom, black(0), black(.6));
  93. bottom: 1px;
  94. }
  95. // No overlay for empty albums
  96. .album img[data-overlay='false'] + .overlay {
  97. background: none;
  98. }
  99. .photo .overlay { opacity: 0; }
  100. .photo:hover .overlay,
  101. .photo.active .overlay {
  102. opacity: 1;
  103. }
  104. .album .overlay h1,
  105. .photo .overlay h1 {
  106. min-height: 19px;
  107. width: 180px;
  108. margin: 12px 0 5px 15px;
  109. color: #fff;
  110. text-shadow: 0 1px 3px black(.4);
  111. font-size: 16px;
  112. font-weight: bold;
  113. overflow: hidden;
  114. white-space: nowrap;
  115. text-overflow: ellipsis;
  116. }
  117. .album .overlay a,
  118. .photo .overlay a {
  119. display: block;
  120. margin: 0 0 12px 15px;
  121. font-size: 11px;
  122. color: #ccc;
  123. text-shadow: 0 1px 3px black(.4);
  124. }
  125. .photo .overlay a .iconic {
  126. fill: #ccc;
  127. margin: 0 5px 0 0;
  128. width: 8px;
  129. height: 8px;
  130. }
  131. .album img[data-overlay='false'] + .overlay h1,
  132. .album img[data-overlay='false'] + .overlay a {
  133. text-shadow: none;
  134. }
  135. // Badge -------------------------------------------------------------- //
  136. .album .badges,
  137. .photo .badges {
  138. position: relative;
  139. margin: -1px 0 0 6px;
  140. }
  141. .album .badge,
  142. .photo .badge {
  143. display: none;
  144. margin: 0 0 0 6px;
  145. padding: 12px 8px 6px;
  146. width: 18px;
  147. background: $colorRed;
  148. box-shadow: 0 0 2px black(.6);
  149. border-radius: 0 0 5px 5px;
  150. border: 1px solid #fff;
  151. border-top: none;
  152. color: #fff;
  153. text-align: center;
  154. text-shadow: 0 1px 0 black(.4);
  155. opacity: .9;
  156. &--visible {
  157. display: inline-block;
  158. }
  159. .iconic {
  160. fill: #fff;
  161. width: 16px;
  162. height: 16px;
  163. }
  164. }
  165. // Divider -------------------------------------------------------------- //
  166. .divider {
  167. margin: 50px 0 0;
  168. padding: 10px 0 0;
  169. width: 100%;
  170. opacity: 0;
  171. border-top: 1px solid white(.02);
  172. box-shadow: $shadow;
  173. animation-duration: .2s;
  174. animation-fill-mode: forwards;
  175. animation-timing-function: $timing;
  176. &:first-child {
  177. margin-top: 10px;
  178. border-top: 0;
  179. box-shadow: none;
  180. }
  181. h1 {
  182. margin: 0 0 0 30px;
  183. color: white(.6);
  184. font-size: 14px;
  185. font-weight: bold;
  186. }
  187. }
  188. }
  189. // No content -------------------------------------------------------------- //
  190. .no_content {
  191. position: absolute;
  192. top: 50%;
  193. left: 50%;
  194. padding-top: 20px;
  195. color: white(.35);
  196. text-align: center;
  197. transform: translateX(-50%) translateY(-50%);
  198. .iconic {
  199. fill: white(.3);
  200. margin: 0 0 10px;
  201. width: 50px;
  202. height: 50px;
  203. }
  204. p {
  205. font-size: 16px;
  206. font-weight: bold;
  207. }
  208. }