added lazy image loading for search page
This commit is contained in:
@@ -147,7 +147,7 @@ if(count($results["image"]) !== 0){
|
||||
|
||||
$right["image"] .=
|
||||
'<a class="image" href="' . htmlspecialchars($image["url"]) . '" rel="noreferrer nofollow" title="' . htmlspecialchars($image["title"]) . '" data-json="' . htmlspecialchars(json_encode($image["source"])) . '" tabindex="-1">' .
|
||||
'<img src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "square") . '" alt="thumb">';
|
||||
'<img loading="lazy" src="' . $frontend->htmlimage($image["source"][count($image["source"]) - 1]["url"], "square") . '" alt="thumb">';
|
||||
|
||||
if(
|
||||
$image["source"][0]["width"] !== null &&
|
||||
@@ -301,7 +301,7 @@ if(count($results["answer"]) !== 0){
|
||||
|
||||
$right["answer"] .=
|
||||
'<a href="' . htmlspecialchars($answer["thumb"]) . '" rel="noreferrer nofollow" class="photo">' .
|
||||
'<img src="' . $frontend->htmlimage($answer["thumb"], "cover") . '" alt="thumb" class="openimg">' .
|
||||
'<img loading="lazy" src="' . $frontend->htmlimage($answer["thumb"], "cover") . '" alt="thumb" class="openimg">' .
|
||||
'</a>';
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ if(count($results["answer"]) !== 0){
|
||||
|
||||
case "image":
|
||||
$right["answer"] .=
|
||||
'<a href="' . htmlspecialchars($description["url"]) . '" rel="noreferrer nofollow" tabindex="-1"><img src="' . $frontend->htmlimage($description["url"], "thumb") . '" alt="image" class="fullimg openimg"></a>';
|
||||
'<a href="' . htmlspecialchars($description["url"]) . '" rel="noreferrer nofollow" tabindex="-1"><img loading="lazy" src="' . $frontend->htmlimage($description["url"], "thumb") . '" alt="image" class="fullimg openimg"></a>';
|
||||
break;
|
||||
|
||||
case "audio":
|
||||
@@ -410,7 +410,7 @@ if(count($results["answer"]) !== 0){
|
||||
$right["answer"] .=
|
||||
'<a href="' . htmlspecialchars($url) . '" rel="noreferrer nofollow" tabindex="-1">' .
|
||||
'<div class="center">' .
|
||||
'<img src="/static/icon/' . $icon . '.png" alt="icon">' .
|
||||
'<img loading="lazy" src="/static/icon/' . $icon . '.png" alt="icon">' .
|
||||
'<div class="title">' . $website . '</div>' .
|
||||
'</div>' .
|
||||
'</a>';
|
||||
|
||||
Reference in New Issue
Block a user