mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 08:10:45 +00:00
Low quality lazyload placeholder
This commit is contained in:
parent
6790081313
commit
f50789508c
|
@ -54,7 +54,10 @@ class CitizenHooks {
|
|||
|
||||
$attribs['data-src'] = $attribs['src'];
|
||||
|
||||
$attribs['src'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
||||
// Replace src with small size image
|
||||
$attribs['src'] = preg_replace('/\/+(\d+)px-/s', '/10px-', $attribs['src']);
|
||||
// $attribs['src'] = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
||||
|
||||
if (isset($attribs['srcset'])) {
|
||||
$attribs['data-srcset'] = $attribs['srcset'];
|
||||
unset($attribs['srcset']);
|
||||
|
|
|
@ -671,13 +671,29 @@ figcaption,
|
|||
}
|
||||
|
||||
.thumb {
|
||||
>.thumbinner>a.new {
|
||||
>.thumbinner {
|
||||
>a {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
||||
&.new {
|
||||
padding: @margin-side / 2;
|
||||
background-color: @base-80;
|
||||
font-size: @content-caption-size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.image img {
|
||||
filter: none;
|
||||
transition: @transition-filter;
|
||||
|
||||
&.lazy {
|
||||
background-color: @base-90;
|
||||
filter: blur(20px);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide edit button when user is not logged in
|
||||
.not-logged .mw-editsection {
|
||||
|
|
|
@ -13,6 +13,7 @@ if ("loading" in HTMLImageElement.prototype) {
|
|||
if (img.hasAttribute("data-srcset")) {
|
||||
img.setAttribute("srcset", img.getAttribute("data-srcset"));
|
||||
}
|
||||
img.classList.remove("lazy");
|
||||
});
|
||||
} else {
|
||||
// IntersectionObserver API
|
||||
|
@ -27,6 +28,7 @@ if ("loading" in HTMLImageElement.prototype) {
|
|||
if (change.target.hasAttribute("data-srcset")) {
|
||||
change.target.setAttribute("srcset", change.target.getAttribute("data-srcset"));
|
||||
}
|
||||
change.target.classList.remove("lazy");
|
||||
observer.unobserve(change.target);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
@transition-box-shadow: box-shadow 0.55s ease;
|
||||
@transition-box-shadow-quick: box-shadow 0.2s ease;
|
||||
@transition-border-color: border-color 0.55s ease;
|
||||
@transition-filter: filter 0.55s ease;
|
||||
|
||||
/*
|
||||
* Fonts
|
||||
|
|
Loading…
Reference in a new issue