Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. * {
  2. background-color: #ddd;
  3. box-sizing: border-box;
  4. }
  5.  
  6.  
  7. #gallery {
  8. display: grid;
  9.  
  10. grid-template: repeat(6, 1fr)/repeat(6, 1fr);
  11. grid-gap: 0.5em;
  12. }
  13. @media (max-width: 800px) {
  14. #gallery {
  15. display: flex;
  16. align-items: flex-start;
  17. flex-wrap: wrap;
  18.  
  19. }
  20. #gallery > div {
  21. width: 48%;
  22. margin: 1%;
  23. }
  24. }
  25. @media (max-width: 800px) and (max-width: 350px) {
  26. #gallery > div {
  27. width: 98%;
  28. }
  29. }
  30.  
  31. #gallery > div:nth-child(6n + 1) {
  32. grid-column: span 2;
  33. grid-row: span 2;
  34. }
  35. #gallery > div:nth-child(2) {
  36. grid-column: span 3;
  37. grid-row: span 3;
  38. }
  39. #gallery > div:nth-child(4) {
  40. grid-column: span 1;
  41. grid-row: span 2;
  42. }
  43. #gallery > div > a {
  44. opacity: 0;
  45. position: absolute;
  46. color: #000;
  47. background-color: #000;
  48. font: bold 2em "Helvetica";
  49. text-shadow: 0 -1px 5px #fff, -1px 0px 5px #fff, 0 1px 5px #fff, 1px 0px 5px #fff;
  50. padding: 2rem;
  51. mix-blend-mode: difference;
  52. width: 100%;
  53. height: 100%;
  54. transition: all ease 1s;
  55. cursor: default;
  56. }
  57. #gallery > div > img {
  58. width: 100%;
  59. min-height: 100%;
  60. transition: grid-row-start 300ms linear;
  61. transition: transform 300ms ease;
  62. transition: all 0.5s ease;
  63. }
  64. #gallery > div:hover img {
  65. transform: scale(1.0125);
  66. }
  67.  
  68. #gallery > div {
  69. overflow: hidden;
  70. position: relative;
  71. box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 20px 0 rgba(0, 0, 0, 0.19);
  72. }
  73. #gallery div,
  74. #gallery a {
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. text-decoration: none;
  79. border: 2px solid #999;
  80. border-radius: 4px;
  81.  
  82. }
  83.  
  84. [id^="lightbox-"] {
  85. position: fixed;
  86. top: 0;
  87. left: 0;
  88. width: 100vw;
  89. height: 100vh;
  90. background-color: rgba(0, 0, 0, 0.5);
  91. display: flex;
  92. opacity: 0;
  93. transition: opacity 450ms ease-in-out;
  94. align-items: center;
  95. justify-content: center;
  96. pointer-events: none;
  97. }
  98. [id^="lightbox-"]:target {
  99. opacity: 1;
  100. pointer-events: inherit;
  101. }
  102. [id^="lightbox-"]:target img {
  103. filter: blur(0);
  104. }
  105. [id^="lightbox-"] .content {
  106. max-width: 90%;
  107. position: relative;
  108. color: #fff;
  109.  
  110. }
  111. [id^="lightbox-"] .content:hover > a.close {
  112. opacity: 1;
  113. transform: scale(1, 1);
  114. }
  115. [id^="lightbox-"] .content:hover > .title {
  116. opacity: 1;
  117. transform: translateY(-3px);
  118. }
  119. [id^="lightbox-"] .content:hover > .title::after {
  120. opacity: 1;
  121. }
  122. [id^="lightbox-"] .content > * {
  123. transition: all 450ms ease-in-out;
  124. }
  125. [id^="lightbox-"] img {
  126. max-height: 90vh;
  127. max-width: 100%;
  128. margin: 0;
  129. padding: 0;
  130. filter: blur(50px);
  131. cursor: default;
  132. border: 2px solid #ddd;
  133. border-radius: 4px;
  134.  
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement