Skip to content

Commit

Permalink
Enforce a readable line length for Read More
Browse files Browse the repository at this point in the history
  • Loading branch information
heyhippari committed Dec 7, 2024
1 parent bcfb4a6 commit cdd60aa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h4 class="title mb-2">
</div>

<div class="mt-2 mb-3">
<app-read-more [text]="chapter.summary || ''" [maxLength]="utilityService.getActiveBreakpoint() >= Breakpoint.Desktop ? 585 : 250"></app-read-more>
<app-read-more [text]="chapter.summary || ''" [maxLength]="utilityService.getActiveBreakpoint() >= Breakpoint.Desktop ? 170 : 200"></app-read-more>
</div>

<div class="mt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h5 subtitle class="subtitle-with-actionables">{{t('item-count', {num: series.le
<div class="col-md-10 col-xs-8 col-sm-6 mt-2">
@if (summary.length > 0) {
<div class="mb-2">
<app-read-more [text]="summary" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 585 : 200"></app-read-more>
<app-read-more [text]="summary" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 170 : 200"></app-read-more>
</div>

@if (collectionTag.source !== ScrobbleProvider.Kavita) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ <h4 class="reading-list-years">


<!-- Summary row-->
<div class="row g-0 mt-2">
<app-read-more [text]="readingListSummary" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 585 : 200"></app-read-more>
<div class="row g-0 my-2">
<app-read-more [text]="readingListSummary" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 170 : 200"></app-read-more>
</div>

@if (characters$ | async; as characters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h4 class="title mb-2">
</div>

<div class="mt-2 mb-3">
<app-read-more [text]="seriesMetadata.summary || ''" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 585 : 200"></app-read-more>
<app-read-more [text]="seriesMetadata.summary || ''" [maxLength]="(utilityService.activeBreakpoint$ | async)! >= Breakpoint.Desktop ? 170 : 200"></app-read-more>
</div>

<div class="mt-2 upper-details">
Expand Down
7 changes: 7 additions & 0 deletions UI/Web/src/app/shared/read-more/read-more.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "../../../theme/variables";

.blur-text {
color: transparent;
text-shadow: 0 0 5px var(--body-text-color);
Expand All @@ -8,5 +10,10 @@

div {
word-break: break-word;
max-width: 75ch;

@media (max-width: $grid-breakpoints-sm) {
max-width: 50ch;
}
}
}
2 changes: 1 addition & 1 deletion UI/Web/src/app/volume-detail/volume-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h4 class="title mb-2">
</div>

<div class="mt-2 mb-3">
<app-read-more [text]="volume.chapters[0].summary || ''" [maxLength]="utilityService.getActiveBreakpoint() >= Breakpoint.Desktop ? 585 : 250"></app-read-more>
<app-read-more [text]="volume.chapters[0].summary || ''" [maxLength]="utilityService.getActiveBreakpoint() >= Breakpoint.Desktop ? 170 : 200"></app-read-more>
</div>

<div class="mt-2">
Expand Down

0 comments on commit cdd60aa

Please sign in to comment.