-
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.
- Loading branch information
Leonardo
committed
Mar 21, 2023
1 parent
19a2f58
commit 1ea88c7
Showing
11 changed files
with
539 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"origin": ["*"], | ||
"responseHeaders": ["Content-Type"], | ||
"method": ["GET"], | ||
"maxAgeSeconds": 3600 | ||
} | ||
] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- Clips List --> | ||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4"> | ||
<a *ngFor="let clip of clipService.pagesClips" [routerLink]="['/','clip', clip.docID]" | ||
class="mt-6 rounded-tl-2xl rounded-br-2xl shadow-xl bg-secondary transform hover:-translate-y-2 hover:shadow-2xl transition duration-300"> | ||
|
||
<!-- Image --> | ||
<img class="card-img-top rounded-tl-2xl w-full" [src]="clip.screenshotURl" crossorigin> | ||
|
||
<!-- Shape --> | ||
<div class="relative"> | ||
<div class="absolute pointer-events-none bottom-full w-full bg-secondary text-white"> | ||
<div class="absolute bottom-full w-full pb-5 overflow-hidden"> | ||
<svg viewBox="0 0 100 50" preserveAspectRatio="none" class="absolute bottom-0 w-full h-full tranform" | ||
style="transform-origin: top center; transform: scale(2);"> | ||
<path d="M0 25h25L75 0h25v50H0z" fill="#283046"></path> | ||
</svg> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Body --> | ||
<div class="p-8"> | ||
|
||
<!-- Heading --> | ||
<h2 class="text-3xl mb-2"> | ||
{{clip.title}} | ||
</h2> | ||
|
||
<!-- Name & Date --> | ||
<p class="mb-0"> | ||
{{clip.displayName}} · | ||
<span class="text-gray-400">{{clip.timestamp | fbTimestamp}}</span> | ||
</p> | ||
|
||
</div> | ||
|
||
</a> | ||
</div> |
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,36 @@ | ||
import { Component, OnDestroy, OnInit, Input } from '@angular/core'; | ||
import { ClipService } from '../services/clip.service'; | ||
import { DatePipe } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-clip-list', | ||
templateUrl: './clip-list.component.html', | ||
styleUrls: ['./clip-list.component.css'], | ||
providers: [DatePipe], | ||
}) | ||
export class ClipListComponent implements OnInit, OnDestroy { | ||
@Input() scrollable = true; | ||
constructor(public clipService: ClipService) { | ||
this.clipService.getClips(); | ||
} | ||
ngOnInit(): void { | ||
if (this.scrollable) window.addEventListener('scroll', this.handleScroll); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
if (this.scrollable) | ||
window.removeEventListener('scroll', this.handleScroll); | ||
|
||
this.clipService.pagesClips = []; | ||
} | ||
handleScroll = () => { | ||
const { scrollTop, offsetHeight } = document.documentElement; | ||
const { innerHeight } = window; | ||
const bottomOfWindows = | ||
Math.round(scrollTop) + innerHeight === offsetHeight; | ||
|
||
if (bottomOfWindows) { | ||
this, this.clipService.getClips(); | ||
} | ||
}; | ||
} |
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.