Skip to content

Commit

Permalink
Merge pull request #18 from chytanka/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rodzyk authored Aug 12, 2024
2 parents db00343 + b60a9e3 commit 5771099
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 83 deletions.
2 changes: 1 addition & 1 deletion src/app/link-parser/ui/footer/footer.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ made-in-ukraine, app-lang-toggle {

app-overlay {
position: absolute;
backdrop-filter: blur(1ch);
background: unset;
}
2 changes: 1 addition & 1 deletion src/app/link-parser/ui/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

app-overlay{
position: absolute;
backdrop-filter: blur(1ch);
background: unset;
}

app-lang-toggle {
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild, WritableSignal, inject, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild, WritableSignal, inject, signal } from '@angular/core';
import { LangService } from '../../data-access/lang.service';

@Component({
selector: 'app-dialog',
templateUrl: './dialog.component.html',
styleUrl: './dialog.component.scss'
styleUrl: './dialog.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DialogComponent {
lang = inject(LangService)
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/lang-toggle/lang-toggle.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, WritableSignal, inject, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, WritableSignal, inject, signal } from '@angular/core';
import { LangService } from '../../data-access/lang.service';
import { ViewModeOption } from '../../data-access';

Expand All @@ -7,7 +7,8 @@ import { ViewModeOption } from '../../data-access';
@Component({
selector: 'app-lang-toggle',
templateUrl: './lang-toggle.component.html',
styleUrl: './lang-toggle.component.scss'
styleUrl: './lang-toggle.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class LangToggleComponent {
lang = inject(LangService)
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/loading/loading.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, inject } from '@angular/core';
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { LangService } from '../../data-access/lang.service';

@Component({
Expand Down Expand Up @@ -32,7 +32,8 @@ import { LangService } from '../../data-access/lang.service';
to { transform: rotate(360deg); }
}
`
]
],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class LoadingComponent {
lang = inject(LangService)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'made-in-ukraine',
Expand Down Expand Up @@ -27,7 +27,8 @@ import { Component } from '@angular/core';
}
}
}
`]
`],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MadeInUkraineComponent {

Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/manga-page/manga-page-even.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'app-manga-page-even',
templateUrl: './manga-page-even.component.html',
styleUrl: './manga-page-even.component.scss'
styleUrl: './manga-page-even.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MangaPageEvenComponent {

Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/manga-page/manga-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'manga-page',
templateUrl: './manga-page.component.html',
styleUrl: './manga-page.component.scss'
styleUrl: './manga-page.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MangaPageComponent {

Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/nsfw-warning/nsfw-warning.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, EventEmitter, Output, Input } from '@angular/core';
import { Component, EventEmitter, Output, Input, ChangeDetectionStrategy } from '@angular/core';

@Component({
selector: 'app-nsfw-warning',
templateUrl: './nsfw-warning.component.html',
styleUrl: './nsfw-warning.component.scss'
styleUrl: './nsfw-warning.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class NsfwWarningComponent {
@Input() title: string = `⚠️🔞 NSFW Content`;
Expand Down
39 changes: 3 additions & 36 deletions src/app/shared/ui/overlay/overlay.component.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
:host {
--g: linear-gradient(#0000, #111);

display: flex;
gap: 1ch;
align-items: center;
Expand All @@ -10,53 +8,22 @@
left: 0;
width: 100%;
z-index: 1;
padding: 1ch 1rem;
padding: 1ch calc(1rem + .25ch) 1.25ch 1rem;
pointer-events: none;
transition: opacity var(--t) cubic-bezier(.4, 0, 1, 1);

font-size: 14px;
line-height: 1;
-webkit-font-smoothing: antialiased;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

&::before,
&::after {
content: '';
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
left: 0;
pointer-events: none;
}

&::before {
z-index: -2;
left: 0;
backdrop-filter: blur(1rem);
-webkit-mask-box-image: var(--g);
mask-border: var(--g);
}

&::after {
z-index: -1;
background-image: var(--g);
}
background: var(--surface);
background: oklch(from var(--surface) calc(l + .05) c h);

&.show {
opacity: 1;
pointer-events: unset;
}

&.top {
--g: linear-gradient(#111, #0000);
top: 0;
bottom: unset;

&::before,
&::after {
top: 0;
bottom: unset;
}
}
}
5 changes: 3 additions & 2 deletions src/app/shared/ui/overlay/overlay.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'app-overlay',
template: `<ng-content />`,
styleUrl: './overlay.component.scss'
styleUrl: './overlay.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class OverlayComponent {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
selector: 'app-pages-indicator',
templateUrl: './pages-indicator.component.html',
styleUrl: './pages-indicator.component.scss'
styleUrl: './pages-indicator.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PagesIndicatorComponent {
@Input() images: any;
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/separator/separator.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';

@Component({
selector: 'separator',
styles: [`:host{ user-select: none; opacity: .5;}`],
template: `{{separator}}`
template: `{{separator}}`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SeparatorComponent {
@Input() separator: string = '│'
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/text-embracer/text-embracer.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, Input, Signal, WritableSignal, computed, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, Signal, WritableSignal, computed, signal } from '@angular/core';

@Component({
selector: 'app-text-embracer',
templateUrl: './text-embracer.component.html',
styleUrl: './text-embracer.component.scss'
styleUrl: './text-embracer.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TextEmbracerComponent {

Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/title-card/title-card.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, inject } from '@angular/core';
import { LangService } from '../../data-access/lang.service';

@Component({
selector: 'app-title-card',
templateUrl: './title-card.component.html',
styleUrl: './title-card.component.scss'
styleUrl: './title-card.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TitleCardComponent {
@Input() value: any = {};
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/ui/view-mode-bar/view-mode-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { LangService } from '../../data-access/lang.service';

@Component({
selector: 'app-view-mode-bar',
templateUrl: './view-mode-bar.component.html',
styleUrl: './view-mode-bar.component.scss'
styleUrl: './view-mode-bar.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ViewModeBarComponent {
@Input() options: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<app-overlay class="top" [ngClass]="{'show': show}">
@if(!embedHelper.isEmbedded()){
<a class="button " [routerLink]="['/']">🏠</a>
<separator />

} @else {
<a title="Read on Chytanka" class="button open-chtnk-link" [href]="link()" target="_blank" rel="noopener noreferrer"></a>
}
<separator />
<button class="button tshadow " [title]="lang.ph().share" (click)="showShare()">📢</button>
<button class="button tshadow" [title]="'Download'" (click)="showDownload()">📥</button>
<!-- <button class="button tshadow" [title]="'Download'" (click)="showDownload()">📥</button> -->
<span class="title">{{episode?.title}}</span>
<app-view-mode-bar (valueChange)="setViewModeOption($event)" [options]="viewer.viewModeOptions"
[value]="viewer.viewModeOption().code" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,32 @@ progress {
}

app-view-mode-bar {
margin-left: auto;
margin-left: auto;
}

textarea {
padding: 1ch;
border-top-left-radius: var(--radius-2);
border-bottom-left-radius: var(--radius-2);
box-shadow: var(--flat-shadow-medium);
padding: 1ch;
border-top-left-radius: var(--radius-2);
border-bottom-left-radius: var(--radius-2);
box-shadow: var(--flat-shadow-medium);
}

.open-chtnk-link {
aspect-ratio: 1;
width: 2rem;

background-image: url('/assets/icons/icon-72x72.svg');
background-size: 150%;
overflow: hidden;
background-repeat: no-repeat;
background-position: center;

&::after {
content: unset;
}

img {
display: inline-block;
width: 1.5rem;
}
}
18 changes: 10 additions & 8 deletions src/app/shared/ui/viewer/viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class ViewerComponent {

}

this.showOverlay = false;
// this.showOverlay = false;
this.activeIndexs.set(activeIndxs);

this.embedHelper.postMessage({
Expand All @@ -117,7 +117,6 @@ export class ViewerComponent {
@HostListener('scroll', ['$event'])
onScroll(event: Event) {
this.initActiveIndexes()
this.showOverlay = false;
}

@HostListener('window:resize', ['$event'])
Expand Down Expand Up @@ -171,8 +170,6 @@ export class ViewerComponent {

if (event.deltaY !== 0 && !event.shiftKey) {
this.viewElement().scrollLeft += event.deltaY * revers > 0 ? scrollAmountX : -scrollAmountX;

this.showOverlay = false;
event.preventDefault();
}
}
Expand Down Expand Up @@ -204,10 +201,15 @@ export class ViewerComponent {

onAgree() {
this.showNsfw.set(true);
this.embedHelper.postMessage(true, 'nsfwchoice');
}

onDisagree() {
this.router.navigate(['/'])
this.showNsfw.set(false);
this.embedHelper.postMessage(false, 'nsfwchoice');

if (!this.embedHelper.isEmbedded())
this.router.navigate(['/'])
}

preloadIndexes: Signal<number[]> = computed(() => this.activeIndexs().map(item => item + 1));
Expand All @@ -216,9 +218,9 @@ export class ViewerComponent {
return (this.preloadIndexes()).includes((i))
}







//#region Inject

Expand All @@ -230,5 +232,5 @@ export class ViewerComponent {

//#endregion


}
5 changes: 3 additions & 2 deletions src/app/shared/ui/warm-control/warm-control.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { LangService } from '../../data-access/lang.service';

@Component({
selector: 'app-warm-control',
templateUrl: './warm-control.component.html',
styleUrl: './warm-control.component.scss'
styleUrl: './warm-control.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WarmControlComponent {

Expand Down
Loading

0 comments on commit 5771099

Please sign in to comment.