-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from chytanka/develop
- Loading branch information
Showing
51 changed files
with
575 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { CommonReadComponent } from './ui/common-read/common-read.component'; | ||
import { SharedModule } from '../../shared/shared.module'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
CommonReadComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
SharedModule | ||
], | ||
exports: [ | ||
CommonReadComponent | ||
] | ||
}) | ||
export class CommonReadModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './common-read.module' | ||
export * from './utils' | ||
export * from './ui' |
21 changes: 21 additions & 0 deletions
21
src/app/common/common-read/ui/common-read/common-read.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@if(episode$ | async; as episode){ | ||
<app-viewer [episode]="episode"><ng-content/></app-viewer> | ||
} | ||
|
||
@if(error$ | async; as error){ | ||
<div style="padding: 1rem; margin: auto;"> | ||
<div class="error-message"> | ||
<h1>🤨</h1> | ||
<p>{{ error }}</p> | ||
<footer> | ||
<a class="button mediun" [routerLink]="'/'">🏠</a> | ||
<button autofocus class="button large primary" (click)="onRefreshData()">{{lang.phrases.tryAgain}}</button> | ||
</footer> | ||
</div> | ||
</div> | ||
} | ||
|
||
@if(loading$ | async; as loading){ | ||
<div style="display: grid; place-items: center; width: min(50vw, 50vh); margin: auto; aspect-ratio: 1;">⏳ loading... | ||
</div> | ||
} |
75 changes: 75 additions & 0 deletions
75
src/app/common/common-read/ui/common-read/common-read.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
:host { | ||
display: grid; | ||
min-height: 100dvh; | ||
} | ||
|
||
:host:has(.error-message) { | ||
background-image: radial-gradient(circle, rgba(0, 0, 0, 0) 40%, rgba(207, 19, 82, .1) 100%); | ||
} | ||
|
||
.error-message { | ||
display: grid; | ||
place-items: center; | ||
gap: 2ch; | ||
min-width: min(50vw, 50vh); | ||
margin: auto; | ||
// aspect-ratio: 3/4; | ||
border-radius: 1ch; | ||
margin-inline: auto; | ||
padding: 2rem; | ||
text-wrap: balance; | ||
text-align: center; | ||
border: 1px solid; | ||
border-color: rgba(207, 19, 82, .4); | ||
background-color: rgba(207, 19, 82, .05); | ||
|
||
p { | ||
margin: 0; | ||
font-size: clamp(1rem, 1.5vw, 2rem); | ||
} | ||
|
||
footer { | ||
display: flex; | ||
place-items: center; | ||
gap: 1.5ch; | ||
} | ||
} | ||
|
||
.button { | ||
--q: 1; | ||
|
||
user-select: none; | ||
border: 0; | ||
font: inherit; | ||
color: inherit; | ||
padding-inline: calc(var(--q) * 1ch); | ||
padding-block: calc(var(--q) * 1ch); | ||
border-radius: .5ch; | ||
cursor: pointer; | ||
background: hsl(203.44 8% 16%); | ||
transition: all .25s ; | ||
text-wrap: balance; | ||
-webkit-tap-highlight-color: transparent; | ||
box-shadow: 0 .1ch .2ch #0004; | ||
|
||
&.mediun { | ||
--q: 1.5 | ||
} | ||
|
||
&.large { | ||
--q: 2 | ||
} | ||
|
||
&.primary { | ||
background: #166496; | ||
} | ||
|
||
&:hover { | ||
background-color: #166496; | ||
color: #ffd60a; | ||
} | ||
|
||
&:active { | ||
background-color: rgba(0, 15, 30, 1); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/app/common/common-read/ui/common-read/common-read.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component, EventEmitter, Input, Output, inject, input } from '@angular/core'; | ||
import { LangService } from '../../../../shared/data-access/lang.service'; | ||
import { BehaviorSubject, Observable, of } from 'rxjs'; | ||
import { CompositionEpisode } from '../../utils'; | ||
|
||
@Component({ | ||
selector: 'app-common-read', | ||
templateUrl: './common-read.component.html', | ||
styleUrl: './common-read.component.scss' | ||
}) | ||
export class CommonReadComponent { | ||
public lang: LangService = inject(LangService); | ||
|
||
@Input({ required: true }) error$!: BehaviorSubject<string | null>; | ||
@Input({ required: true }) loading$!: BehaviorSubject<boolean>; | ||
@Input({ required: true }) episode$!: Observable<CompositionEpisode | null>; | ||
|
||
@Output() refreshData: EventEmitter<any> = new EventEmitter<any>(); | ||
|
||
onRefreshData() { | ||
this.refreshData.emit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './common-read/common-read.component' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './composition'; | ||
export * from './read-base-component' |
2 changes: 1 addition & 1 deletion
2
src/app/shared/utils/read-base-component.ts → .../common-read/utils/read-base-component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
191 changes: 16 additions & 175 deletions
191
src/app/link-parser/link-parser/link-parser.component.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LinkParser } from "./link-parser"; | ||
|
||
export class RedditLinkParser extends LinkParser { | ||
override regex = /reddit\.com\/[ur]\/\w+(?:\/comments\/)([a-zA-Z0-9]+)(?=[\/?]|$)/; | ||
override site = 'reddit'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.