Skip to content

Commit

Permalink
「カードタイプ」の「大きなカード(先頭のみ)」の際に先頭のエントリーカードにec-big-card-firstクラスを入れるように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed Feb 16, 2024
1 parent 27b0379 commit aa7cafa
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion amp.css
Expand Up @@ -826,7 +826,7 @@ img.emoji {

.ect-tile-card,
.ect-big-card,
.ect-big-card-first .a-wrap:first-child {
.ec-big-card-first {
--card-ratio: auto;
}

Expand Down
4 changes: 2 additions & 2 deletions css/admin.css
Expand Up @@ -1349,7 +1349,7 @@ body.wp-admin {
}
.admin-settings .demo .ect-tile-card,
.admin-settings .demo .ect-big-card,
.admin-settings .demo .ect-big-card-first .a-wrap:first-child {
.admin-settings .demo .ec-big-card-first {
--card-ratio: auto;
}
.admin-settings .demo .blogcard-thumbnail img,
Expand Down Expand Up @@ -9697,7 +9697,7 @@ body.wp-admin {
}
.admin-settings .demo .ect-tile-card,
.admin-settings .demo .ect-big-card,
.admin-settings .demo .ect-big-card-first .a-wrap:first-child {
.admin-settings .demo .ec-big-card-first {
--card-ratio: auto;
}
.admin-settings .demo .blogcard-thumbnail img,
Expand Down
7 changes: 0 additions & 7 deletions lib/entry-card.php
Expand Up @@ -49,16 +49,9 @@ function get_entry_card_thumbnail_size($count){
switch (get_entry_card_type()) {
case 'big_card_first':
$thumbnail_size = get_big_card_first_thumbnail_size($count);
// if ($count == 1) {
// $thumbnail_size = 'large';
// } else {
// $thumbnail_size = THUMB320;
// }
// _v($thumbnail_size);
break;
case 'big_card':
$thumbnail_size = get_big_card_thumbnail_size();
// $thumbnail_size = 'large';
break;
case 'vertical_card_2':
$thumbnail_size = get_vertical_card_2_thumbnail_size();
Expand Down
15 changes: 15 additions & 0 deletions lib/page-settings/index-funcs.php
Expand Up @@ -122,6 +122,21 @@ function is_entry_card_type_entry_card(){
return get_entry_card_type() == 'entry_card';
}
endif;
if ( !function_exists( 'is_entry_card_type_big_card_first' ) ):
function is_entry_card_type_big_card_first(){
return get_entry_card_type() == 'big_card_first';
}
endif;
if ( !function_exists( 'is_entry_card_type_big_card' ) ):
function is_entry_card_type_big_card(){
return get_entry_card_type() == 'big_card';
}
endif;
if ( !function_exists( 'is_entry_card_type_big_card' ) ):
function is_entry_card_type_big_card(){
return get_entry_card_type() == 'big_card';
}
endif;
if ( !function_exists( 'is_entry_card_type_vertical_card_2' ) ):
function is_entry_card_type_vertical_card_2(){
return get_entry_card_type() == 'vertical_card_2';
Expand Down
2 changes: 1 addition & 1 deletion scss/_img.scss
Expand Up @@ -156,7 +156,7 @@ img.emoji {

.ect-tile-card,
.ect-big-card,
.ect-big-card-first .a-wrap:first-child{
.ec-big-card-first{
--card-ratio: auto;
}

Expand Down
2 changes: 1 addition & 1 deletion style.css
Expand Up @@ -851,7 +851,7 @@ img.emoji {

.ect-tile-card,
.ect-big-card,
.ect-big-card-first .a-wrap:first-child {
.ec-big-card-first {
--card-ratio: auto;
}

Expand Down
6 changes: 5 additions & 1 deletion tmp/entry-card.php
Expand Up @@ -10,9 +10,13 @@
if (is_front_page_type_index()) {
$article_id_attr = ' id="post-'.get_the_ID().'"';
}
$classes = '';
if (is_entry_card_type_big_card_first() && $count === 1) {
$classes = ' ec-big-card-first';
}
?>

<a href="<?php echo esc_url(get_the_permalink()); ?>" class="entry-card-wrap a-wrap border-element cf" title="<?php echo esc_attr(get_the_title()); ?>">
<a href="<?php echo esc_url(get_the_permalink()); ?>" class="entry-card-wrap a-wrap border-element<?php echo $classes; ?> cf" title="<?php echo esc_attr(get_the_title()); ?>">
<article<?php echo $article_id_attr; ?> <?php post_class( array('post-'.get_the_ID(), 'entry-card','e-card', 'cf') ); ?>>
<figure class="entry-card-thumb card-thumb e-card-thumb">
<?php
Expand Down

0 comments on commit aa7cafa

Please sign in to comment.