A few css adjustments to the gallery component.

This commit is contained in:
mateuswetah 2022-03-18 15:21:32 -03:00
parent daf2606533
commit 2641608f81
5 changed files with 40 additions and 20 deletions

View File

@ -366,28 +366,28 @@
justify-content: center; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image {
width: 100%;
height: calc(100% - 44px);
height: calc(100% - 60px);
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 44px;
margin-top: 22px;
margin-bottom: 22px; }
padding: 60px;
margin-top: 30px;
margin-bottom: 30px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image > iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
height: calc(100vh - 120px);
border: none;
margin: 44px;
margin: 60px;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .pswp__zoom-wrap > iframe#iframePDF {
width: 90vw;
height: 90vh;
height: calc(100vh - 120px);
border: none;
margin: 44px auto;
margin: 60px auto;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
@ -418,6 +418,8 @@
max-width: calc((90vh * 9) / 16); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-2 {
max-width: calc((90vh * 1) / 2); }
.tainacan-photoswipe-layer .pswp__container .pswp__content > .tainacan-content-embed:not(.attachment-without-image) {
margin-top: 60px; }
.tainacan-photoswipe-layer .pswp__container a:first-of-type,
.tainacan-photoswipe-layer .pswp__container p:first-of-type,
.tainacan-photoswipe-layer .pswp__container article:first-of-type {
@ -435,5 +437,7 @@
.tainacan-photoswipe-layer .pswp__container video {
min-height: 56px;
max-width: 80%; }
.tainacan-photoswipe-layer .pswp__container iframe {
border: none; }
/*# sourceMappingURL=tainacan-gutenberg-block-item-gallery.css.map */

File diff suppressed because one or more lines are too long

View File

@ -1249,7 +1249,12 @@ class Theme_Helper {
sprintf('<span class="tainacan-item-file-download">%s</span>', tainacan_the_item_document_download_link($item_id))
: ''),
'media_content' => tainacan_get_the_document($item_id),
'media_content_full' => $open_lightbox_on_click ? ( $document_type === 'attachment' ? tainacan_get_the_document($item_id, 'full') : sprintf('<div class="attachment-without-image">%s</div>', tainacan_get_the_document($item_id, 'full')) ) : '',
'media_content_full' => $open_lightbox_on_click ?
(
$document_type === 'attachment' ?
tainacan_get_the_document($item_id, 'full') :
sprintf('<div class="attachment-without-image">%s</div>', tainacan_get_the_document($item_id, 'full'))
) : '',
'media_title' => $document_type === 'attachment' ? get_the_title(tainacan_get_the_document_raw($item_id)) : '',
'media_description' => $document_type === 'attachment' ? $document_description : '',
'media_caption' => $document_type === 'attachment' ? wp_get_attachment_caption(tainacan_get_the_document_raw($item_id)) : '',
@ -1268,7 +1273,12 @@ class Theme_Helper {
sprintf('<span class="tainacan-item-file-download">%s</span>', tainacan_the_item_attachment_download_link($attachment->ID))
: ''),
'media_content' => tainacan_get_attachment_as_html($attachment->ID, $item_id),
'media_content_full' => $open_lightbox_on_click ? ( $is_attachment_an_image ? wp_get_attachment_image( $attachment->ID, 'full', false) : sprintf('<div class="attachment-without-image tainacan-embed-container"><iframe id="tainacan-attachment-iframe--%s" src="%s"></iframe></div>', $block_id, tainacan_get_attachment_html_url($attachment->ID)) ) : '',
'media_content_full' => $open_lightbox_on_click ?
(
$is_attachment_an_image ?
wp_get_attachment_image( $attachment->ID, 'full', false) :
sprintf('<div class="attachment-without-image tainacan-embed-container"><iframe id="tainacan-attachment-iframe--%s" src="%s"></iframe></div>', $block_id, tainacan_get_attachment_html_url($attachment->ID))
) : '',
'media_title' => $attachment->post_title,
'media_description' => $attachment->post_content,
'media_caption' => $attachment->post_excerpt,

View File

@ -477,20 +477,20 @@
.attachment-without-image {
width: 100%;
height: calc(100% - 44px);
height: calc(100% - 60px);
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 44px;
margin-top: 22px;
margin-bottom: 22px;
padding: 60px;
margin-top: 30px;
margin-bottom: 30px;
&>iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
height: calc(100vh - 120px);
border: none;
margin: 44px;
margin: 60px;
display: block;
background-image: url('../images/preloader.gif');
background-repeat: no-repeat;
@ -500,9 +500,9 @@
// PDFs file that come from document instead of attachments
.pswp__zoom-wrap>iframe#iframePDF {
width: 90vw;
height: 90vh;
height: calc(100vh - 120px);
border: none;
margin: 44px auto;
margin: 60px auto;
display: block;
background-image: url('../images/preloader.gif');
background-repeat: no-repeat;
@ -545,6 +545,9 @@
max-width: calc((90vh * 1) / 2);
}
}
.pswp__content>.tainacan-content-embed:not(.attachment-without-image) {
margin-top: 60px;
}
a:first-of-type,
p:first-of-type ,
article:first-of-type {
@ -565,5 +568,8 @@
min-height: 56px;
max-width: 80%;
}
iframe {
border: none;
}
}
}

View File

@ -232,7 +232,7 @@ tainacan_plugin.classes.TainacanMediaGallery = class TainacanMediaGallery {
!self.options.hide_media_name
)
innerHTML += item.title.name.innerHTML;
el.innerHTML += innerHTML;
el.innerHTML = innerHTML;
});
}
});