Skip to content
Snippets Groups Projects
Commit 8ceb1978 authored by Gaus Surahman's avatar Gaus Surahman
Browse files

Minor fixes.

parent bbc26600
No related branches found
No related tags found
No related merge requests found
Pipeline #19272 passed
/**
* @file
* Provides loading indicator animation, not used when using blur.
*/
/* Credit: https://github.com/tobiasahlin/SpinKit */
......@@ -41,14 +42,10 @@
/* Hide for non-js users. */
.is-b-loading::before {
z-index: -1;
display: none;
}
/* Core drupal.init.js provides this .js class for free as long as loaded. */
.js .is-b-loading:not(.is-b-loaded)::before {
display: block;
}
/* Prevents costly double animations when Blur is enabled.
CSSLint vs. Stylelint complain conflicting problems at different CSS specs.
@see https://caniuse.com/css-not-sel-list
......@@ -57,7 +54,6 @@ CSSLint vs. Stylelint complain conflicting problems at different CSS specs.
.is-b-loading:not(.is-b-loaded)::before,
.is-b-loading:not([data-animation])::before {
position: absolute;
z-index: 22;
top: 50%;
left: 50%;
width: 30px;
......@@ -71,6 +67,8 @@ CSSLint vs. Stylelint complain conflicting problems at different CSS specs.
}
.is-b-loading.is-b-visible:not(.is-b-loaded)::before {
z-index: 22;
display: block;
-webkit-animation: rotateplane 1.2s infinite ease-in-out;
animation: rotateplane 1.2s infinite ease-in-out;
}
......@@ -403,7 +403,7 @@ class BlazyDefault {
*/
public static function dyComponents(): array {
$deps = ['blazy/compat'];
$common = ['minified' => TRUE, 'weight' => -1];
$common = ['minified' => TRUE, 'weight' => -1.8];
$libs = [];
foreach (['instagram', 'pinterest'] as $key) {
......
......@@ -157,7 +157,7 @@ class Placeholder {
// Provides image effect if so configured unless being sandboxed.
// Slick/ Splide lazy loads won't work, needs Blazy to make animation.
if ($blazies->is('blazy') && $fx = $blazies->get('fx')) {
if ($fx = $blazies->get('fx')) {
$attributes['class'][] = 'media--fx';
$attributes[Attributes::data($blazies, 'animation')] = $fx;
}
......@@ -195,7 +195,7 @@ class Placeholder {
*/
private static function dataImage(array &$settings, $uri, $tn_uri, $tn_url, $style): void {
$blazies = $settings['blazies'];
if (!$blazies->is('blazy') || !$blazies->use('blur')) {
if (!$blazies->use('blur')) {
return;
}
......
......@@ -338,6 +338,7 @@ class Lightbox {
if ($has_dim && !empty($json['paddingHack'])) {
$pad = round((($json['height'] / $json['width']) * 100), 2);
$style .= 'width:' . $json['width'] . 'px; padding-bottom: ' . $pad . '%;';
$hattrs['data-b-ratio'] = $pad;
}
// Currently only audio with background cover.
......
......@@ -194,7 +194,7 @@ class CheckItem {
// @todo better logic to support loader as required, must decouple loader.
// @todo $lazy = $blazies->get('image.loading') == 'lazy';
// @todo $lazy = $blazies->is('blazy') && ($blazies->get('libs.compat') || $lazy);
// @todo $lazy = $blazies->get('libs.compat') || $lazy;
// Redefines some since this can be fed by anyone, including custom works.
$blazies->set('is.fluid', $is_fluid)
->set('is.blur', $is_blur)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment