mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-28 16:21:11 +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['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'])) {
|
if (isset($attribs['srcset'])) {
|
||||||
$attribs['data-srcset'] = $attribs['srcset'];
|
$attribs['data-srcset'] = $attribs['srcset'];
|
||||||
unset($attribs['srcset']);
|
unset($attribs['srcset']);
|
||||||
|
|
|
@ -523,7 +523,7 @@ a {
|
||||||
|
|
||||||
// Namespace button
|
// Namespace button
|
||||||
#p-namespaces {
|
#p-namespaces {
|
||||||
position: relative;
|
position: relative;
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0 @negative-margin;
|
margin: 0 @negative-margin;
|
||||||
padding: @margin-side;
|
padding: @margin-side;
|
||||||
|
@ -671,17 +671,33 @@ figcaption,
|
||||||
}
|
}
|
||||||
|
|
||||||
.thumb {
|
.thumb {
|
||||||
>.thumbinner>a.new {
|
>.thumbinner {
|
||||||
display: block;
|
>a {
|
||||||
padding: @margin-side / 2;
|
display: block;
|
||||||
background-color: @base-80;
|
overflow: hidden;
|
||||||
font-size: @content-caption-size;
|
|
||||||
|
&.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
|
// Hide edit button when user is not logged in
|
||||||
.not-logged .mw-editsection {
|
.not-logged .mw-editsection {
|
||||||
display: none!important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: @screen0) {
|
@media only screen and (max-width: @screen0) {
|
||||||
|
|
|
@ -13,6 +13,7 @@ if ("loading" in HTMLImageElement.prototype) {
|
||||||
if (img.hasAttribute("data-srcset")) {
|
if (img.hasAttribute("data-srcset")) {
|
||||||
img.setAttribute("srcset", img.getAttribute("data-srcset"));
|
img.setAttribute("srcset", img.getAttribute("data-srcset"));
|
||||||
}
|
}
|
||||||
|
img.classList.remove("lazy");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// IntersectionObserver API
|
// IntersectionObserver API
|
||||||
|
@ -27,6 +28,7 @@ if ("loading" in HTMLImageElement.prototype) {
|
||||||
if (change.target.hasAttribute("data-srcset")) {
|
if (change.target.hasAttribute("data-srcset")) {
|
||||||
change.target.setAttribute("srcset", change.target.getAttribute("data-srcset"));
|
change.target.setAttribute("srcset", change.target.getAttribute("data-srcset"));
|
||||||
}
|
}
|
||||||
|
change.target.classList.remove("lazy");
|
||||||
observer.unobserve(change.target);
|
observer.unobserve(change.target);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
@transition-box-shadow: box-shadow 0.55s ease;
|
@transition-box-shadow: box-shadow 0.55s ease;
|
||||||
@transition-box-shadow-quick: box-shadow 0.2s ease;
|
@transition-box-shadow-quick: box-shadow 0.2s ease;
|
||||||
@transition-border-color: border-color 0.55s ease;
|
@transition-border-color: border-color 0.55s ease;
|
||||||
|
@transition-filter: filter 0.55s ease;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fonts
|
* Fonts
|
||||||
|
|
Loading…
Reference in a new issue