cardのレイアウトを横向きに

This commit is contained in:
eai04191 2019-02-28 00:00:23 +09:00
parent 579bd3e31f
commit 0ff253cbfb
3 changed files with 28 additions and 7 deletions

12
public/css/tissue.css vendored
View File

@ -84,4 +84,16 @@
#navbarAccountDropdownSp {
max-width: calc(100vw - 5em);
}
.card-img-left {
width: 100%;
border-top-left-radius: calc(.25rem - 1px);
border-bottom-left-radius: calc(.25rem - 1px);
}
.card-img-right {
width: 100%;
border-top-right-radius: calc(.25rem - 1px);
border-bottom-right-radius: calc(.25rem - 1px);
}

7
public/js/tissue.js vendored
View File

@ -17,9 +17,11 @@
url: $this.find('a').attr('href')
}
}).then(function (data) {
var $metaColumn = $this.find('.col-12:last-of-type');
var $imageColumn = $this.find('.col-12:first-of-type');
var $title = $this.find('.card-title');
var $desc = $this.find('.card-text');
var $image = $this.find('img');
var $image = $imageColumn.find('img');
if (data.title === '') {
$title.hide();
@ -34,7 +36,8 @@
}
if (data.image === '') {
$image.hide();
$imageColumn.hide();
$metaColumn.removeClass('col-md-6');
} else {
$image.attr('src', data.image);
}

View File

@ -1,9 +1,15 @@
<div class="card link-card mb-2 px-0 col-12 col-md-6 d-none" style="font-size: small;">
<div class="card link-card mb-2 px-0 col-12 d-none" style="font-size: small;">
<a class="text-dark card-link" href="{{ $link }}" target="_blank" rel="noopener">
<img src="" alt="Thumbnail" class="card-img-top bg-secondary">
<div class="card-body">
<h6 class="card-title font-weight-bold">タイトル</h6>
<p class="card-text">コンテンツの説明文</p>
<div class="row no-gutters">
<div class="col-12 col-md-6">
<img src="" alt="Thumbnail" class="card-img-left bg-secondary">
</div>
<div class="col-12 col-md-6">
<div class="card-body">
<h6 class="card-title font-weight-bold">タイトル</h6>
<p class="card-text">コンテンツの説明文</p>
</div>
</div>
</div>
</a>
</div>