You are here

blazy.css in Blazy 8.2

Same filename and directory in other branches
  1. 7 css/blazy.css

File

css/blazy.css
View source
  1. /**
  2. * @file
  3. */
  4. .blazy,
  5. .blazy *,
  6. .blazy *::before,
  7. .blazy *::after {
  8. box-sizing: border-box;
  9. }
  10. /* The lazyloaded element: IMG, IFRAME, DIV. */
  11. .b-lazy,
  12. .b-responsive {
  13. display: block;
  14. height: auto;
  15. min-height: 1px;
  16. opacity: 0;
  17. transition: opacity 500ms ease-in;
  18. }
  19. /* Needed to display preloader with CSS BG image, otherwise hidden. */
  20. .b-loaded,
  21. .b-error,
  22. /* @todo deprecated and removed media--loading for is-b-loading to make sense outside media. */
  23. .b-bg.media--loading,
  24. .b-bg.is-b-loading {
  25. opacity: 1;
  26. }
  27. .b-bg {
  28. background-size: cover;
  29. background-position: center center;
  30. background-repeat: no-repeat;
  31. display: block;
  32. }
  33. /* The .blazy container is not always preset such at lightboxes. */
  34. .litebox,
  35. .blazy iframe,
  36. .media iframe {
  37. border: 0;
  38. display: block;
  39. max-width: 100%;
  40. }
  41. .media-wrapper--inline {
  42. max-width: 100%;
  43. }
  44. /** Fix for conflict with Bootstrap CSS if not using aspect ratio. */
  45. .blazy .media {
  46. display: block;
  47. position: relative;
  48. }
  49. /**
  50. * Non-js element. Supports both BG, or inline media.
  51. * Makes generic animation contaitner, either blur, or other animate.css.
  52. */
  53. .media--fx {
  54. /* Hide extra blur edges. */
  55. overflow: hidden;
  56. /* Dup for BlazyFilter which has no .blazy container. */
  57. position: relative;
  58. }
  59. .media--fx img {
  60. /* Prevents unwanted alt text from showing. */
  61. color: transparent;
  62. display: block;
  63. /* Prevents blinking. */
  64. opacity: 1;
  65. /* Prevents collapsing thumbnail image if Aspect ratio is disabled. */
  66. width: 100%;
  67. }
  68. /* Aspect ratio element: IMG, IFRAME, DIV. */
  69. .media--ratio .media__element,
  70. .media--fx .b-blur {
  71. bottom: 0;
  72. height: 100%;
  73. left: 0;
  74. min-height: 1px;
  75. position: absolute;
  76. right: 0;
  77. top: 0;
  78. width: 100%;
  79. z-index: 0;
  80. /** Temp fix, also to fix the VIDEO element to max width, not only IMG. */
  81. object-fit: cover;
  82. }
  83. /**
  84. * The blur image, to support various usages: native, BG and regular IMG.
  85. * The native lazy load swaps placeholders for real images, makes it impossible
  86. * to have blur effect, that is why we put it into another IMG.
  87. */
  88. .media--fx .b-blur {
  89. color: transparent;
  90. /* < 980: The less the more artifacts. The more the slower. */
  91. filter: blur(3px);
  92. opacity: .9;
  93. /* Longer than animation timing to let the actual image surface better. */
  94. transition: opacity 1.2s;
  95. /* Avoid overlaying, this causes unwanted dark shadow and more artifacts. */
  96. /* z-index: 1; */
  97. }
  98. .media--fx-lg .b-blur {
  99. /* > 980: The less the more artifacts. The more the slower. */
  100. filter: blur(6px);
  101. /* Reduces artifacts due to being large. */
  102. opacity: .8;
  103. }
  104. .animated img {
  105. opacity: 1;
  106. }
  107. /* Be sure to add width to the container accordingly, otherwise collapsed. */
  108. .field[data-blazy] {
  109. min-width: 50%;
  110. }