Displays attachment download link when inside documents section.

This commit is contained in:
mateuswetah 2020-05-01 12:38:58 -03:00
parent 8f876a8f32
commit 3b2aa319ca
5 changed files with 62 additions and 50 deletions

View File

@ -485,13 +485,56 @@
clear: both;
content: "";
}
&.single-item-collection{
&.single-item-collection {
min-height: 10vh;
position: relative;
.tainacan-item-file-download {
position: absolute;
opacity: 0;
transform: scale(0);
border-radius: 24px;
width: 36px;
height: 36px;
bottom: -18px;
right: calc(50% - 18px);
cursor: pointer;
font-size: 0;
background-color: #298596;
color: white;
transition: opacity 0.3s ease, transform 0.3s ease, font-size 0.3s ease;
a {
height: 38px;
width: 38px;
display: block;
position: relative;
z-index: 99;
}
&::after {
position: relative;
top: -38px;
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: 1.25rem !important;
line-height: 2.25rem;
text-rendering: auto;
vertical-align: middle;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 1.25em;
text-transform: none !important;
letter-spacing: normal !important;
content: 'download';
display: flex;
justify-content: center;
align-items: center;
}
}
.single-item-collection--document {
&:hover {
.tainacan-item-document-download {
.tainacan-item-file-download {
opacity: 1;
transform: scale(1);
}
@ -532,49 +575,6 @@
bottom: 0;
}
}
.tainacan-item-document-download {
position: absolute;
opacity: 0;
transform: scale(0);
border-radius: 24px;
width: 36px;
height: 36px;
bottom: -18px;
right: calc(50% - 18px);
cursor: pointer;
font-size: 0;
background-color: #298596;
color: white;
transition: opacity 0.3s ease, transform 0.3s ease, font-size 0.3s ease;
a {
height: 38px;
width: 38px;
display: block;
position: relative;
z-index: 99;
}
&::after {
position: relative;
top: -38px;
display: inline-block;
font: normal normal normal 20px/1 "TainacanIcons";
font-size: 1.25rem !important;
line-height: 2.25rem;
text-rendering: auto;
vertical-align: middle;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 1.25em;
text-transform: none !important;
letter-spacing: normal !important;
content: 'download';
display: flex;
justify-content: center;
align-items: center;
}
}
}
.single-item-collection--gallery {
margin-bottom: 24px;
@ -612,6 +612,14 @@
border-bottom: 4px solid #298596;
}
}
.single-item-collection--attachments-file {
&:hover {
.tainacan-item-file-download {
opacity: 1;
transform: scale(1);
}
}
}
.single-item-collection--gallery-items,
.single-item-collection--attachments {
.single-item-collection--attachments-file {
@ -682,7 +690,8 @@
visibility: hidden;
}
}
.single-item-collection--attachments-prev, .single-item-collection--attachments-next {
.single-item-collection--attachments-prev,
.single-item-collection--attachments-next {
position: absolute;
display: block;
height: 33px;

View File

@ -1491,7 +1491,7 @@ function tainacan_get_color_scheme_css( $colors ) {
}
/* Document download button */
.tainacan-single-post article .tainacan-content.single-item-collection .single-item-collection--document .tainacan-item-document-download {
.tainacan-single-post article .tainacan-content.single-item-collection .single-item-collection--document .tainacan-item-file-download {
background-color: {$colors['tainacan_link_color']} !important;
}

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
<?php
tainacan_the_document();
if ( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && function_exists('tainacan_the_item_document_download_link') && tainacan_the_item_document_download_link() != '' ) {
echo '<span class="tainacan-item-document-download">' . tainacan_the_item_document_download_link() . '</span>';
echo '<span class="tainacan-item-file-download">' . tainacan_the_item_document_download_link() . '</span>';
}
?>
</div>
@ -52,6 +52,9 @@
if ( function_exists('tainacan_get_single_attachment_as_html') ) {
tainacan_get_single_attachment_as_html($attachment->ID);
}
if ( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && function_exists('tainacan_the_item_attachment_download_link') && tainacan_the_item_attachment_download_link($attachment->ID) != '' ) {
echo '<span class="tainacan-item-file-download">' . tainacan_the_item_attachment_download_link($attachment->ID) . '</span>';
}
?>
</div>
</section>

View File

@ -10,7 +10,7 @@
<?php
tainacan_the_document();
if( !get_theme_mod( 'tainacan_single_item_hide_download_document', false ) && function_exists('tainacan_the_item_document_download_link') && tainacan_the_item_document_download_link() != '' ) {
echo '<span class="tainacan-item-document-download">' . tainacan_the_item_document_download_link() . '</span>';
echo '<span class="tainacan-item-file-download">' . tainacan_the_item_document_download_link() . '</span>';
}
?>
</div>