Skip to content

Commit

Permalink
fix #208 & fix #207 & close #193 & fix #187
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Jul 6, 2021
1 parent d81f767 commit 533871f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
9 changes: 8 additions & 1 deletion argontheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,14 @@ function lazyloadInit(){
if (argonConfig.lazyload.effect == "none"){
delete argonConfig.lazyload.effect;
}
$("article img.lazyload:not(.lazyload-loaded) , .post-thumbnail.lazyload:not(.lazyload-loaded) , .related-post-thumbnail.lazyload:not(.lazyload-loaded)").lazyload(Object.assign(argonConfig.lazyload, {load: function(){$(this).addClass("lazyload-loaded")}}));
$("article img.lazyload:not(.lazyload-loaded) , .post-thumbnail.lazyload:not(.lazyload-loaded) , .related-post-thumbnail.lazyload:not(.lazyload-loaded)").lazyload(
Object.assign(argonConfig.lazyload, {
load: function () {
$(this).addClass("lazyload-loaded")
$(this).parent().removeClass("lazyload-container-unload")
}
})
);
$(".comment-item-text .comment-sticker.lazyload").lazyload(Object.assign(argonConfig.lazyload, {load: function(){$(this).removeClass("lazyload")}}));
}
lazyloadInit();
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ function argon_lazyload($content){
function argon_fancybox($content){
if(!is_feed() && !is_robots() && !is_home()){
if (get_option('argon_enable_lazyload') != 'false'){
$content = preg_replace('/<img(.*?)data-original=[\'"](.*?)[\'"](.*?)((\/>)|>|(<\/img>))/i',"<div class='fancybox-wrapper' data-fancybox='post-images' href='$2'>$0</div>" , $content);
$content = preg_replace('/<img(.*?)data-original=[\'"](.*?)[\'"](.*?)((\/>)|>|(<\/img>))/i',"<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='$2'>$0</div>" , $content);
}else{
$content = preg_replace('/<img(.*?)src=[\'"](.*?)[\'"](.*?)((\/>)|>|(<\/img>))/i',"<div class='fancybox-wrapper' data-fancybox='post-images' href='$2'>$0</div>" , $content);
}
Expand Down
23 changes: 20 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ article .post-content a:before{
transform: scaleX(0);
backface-visibility: hidden;
}
article .post-content a[class*='button']:before{
display: none;
}
article .post-content a:hover:before{
transform: scaleX(1);
}
Expand Down Expand Up @@ -161,9 +164,19 @@ article .post-content kbd{
background-color: #333;
border-radius: 3px;
}
article .wp-embedded-content {
article .wp-embedded-content,
article .blocks-gallery-grid,
article .wp-block-gallery,
article .wp-block-media-text{
max-width: 100%;
}
article .wp-block-cover, article .wp-block-cover-image{
padding: 0;
}
article .wp-block-cover-image .wp-block-cover__inner-container,
article .wp-block-cover .wp-block-cover__inner-container{
position: absolute;
}
article table{
max-width: 100%;
word-break: break-word;
Expand Down Expand Up @@ -1513,8 +1526,8 @@ article.post-preview-layout-2 .post-title {
max-width: max-content;
}
article.post-preview-layout-2 .loading-css-animation {
position: absolute;
bottom: -8px;
position: absolute;
bottom: -8px;
}
/*Reference*/
sup.reference {
Expand Down Expand Up @@ -3111,6 +3124,10 @@ article img.lazyload[src^='data:image/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPg'
width: max-content;
max-width: 100%;
}
.fancybox-wrapper.lazyload-container-unload{
width: 100%;
}

.fancybox-wrapper > img{
cursor: pointer;
cursor: -webkit-zoom-in;
Expand Down

0 comments on commit 533871f

Please sign in to comment.