spoilerを画像にだけ適用するように変更
This commit is contained in:
parent
9f565798c0
commit
5e9fa05be5
6
resources/assets/js/app.js
vendored
6
resources/assets/js/app.js
vendored
@ -96,9 +96,11 @@ $(() => {
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.card-spoiler-overlay', function (event) {
|
||||
$(document).on('click', '.card-spoiler-wrap', function (event) {
|
||||
const $this = $(this);
|
||||
$this.siblings(".card-link").removeClass("card-spoiler");
|
||||
const $card = $this.siblings(".card-link");
|
||||
$card.removeClass("card-spoiler");
|
||||
$card.find('.card-img-spoiler-overlay').remove();
|
||||
$this.remove();
|
||||
});
|
||||
});
|
||||
|
23
resources/assets/sass/components/_link-card.scss
vendored
23
resources/assets/sass/components/_link-card.scss
vendored
@ -31,15 +31,25 @@
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.card-spoiler-overlay {
|
||||
.card-spoiler-wrap {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.card-spoiler img{
|
||||
z-index: 1;
|
||||
filter: blur(15px) grayscale(100%);
|
||||
}
|
||||
|
||||
.card-img-spoiler-overlay {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.warning-text {
|
||||
padding: 10px;
|
||||
@ -48,9 +58,4 @@
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-spoiler {
|
||||
z-index: 1;
|
||||
filter: blur(15px) grayscale(100%);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
<div class="card link-card mb-2 px-0 col-12 d-none" style="font-size: small;">
|
||||
@if ($is_too_sensitive)
|
||||
<div class="card-spoiler-overlay">
|
||||
<span class="warning-text">クリックまたはタップで表示</span>
|
||||
</div>
|
||||
<div class="card-spoiler-wrap"> </div>
|
||||
@endif
|
||||
<a class="text-dark card-link {{ $is_too_sensitive ? 'card-spoiler' : '' }}" href="{{ $link }}" target="_blank" rel="noopener">
|
||||
<div class="row no-gutters">
|
||||
<div class="col-12 col-md-6 justify-content-center align-items-center">
|
||||
@if ($is_too_sensitive)
|
||||
<div class="card-img-spoiler-overlay">
|
||||
<span class="warning-text">クリックまたはタップで表示</span>
|
||||
</div>
|
||||
@endif
|
||||
<img src="" alt="Thumbnail" class="w-100 bg-secondary">
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
|
Loading…
Reference in New Issue
Block a user