-
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
Showing
23 changed files
with
201 additions
and
56 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div class="bg-dark"> | ||
<div class="bg-dark-app"> | ||
<router-outlet></router-outlet> | ||
<app-info></app-info> | ||
</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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
.bg-dark { | ||
$m-01: #071426; | ||
$m-02: #546c8c; | ||
|
||
|
||
.bg-dark-app { | ||
max-width: 100vw; | ||
min-height: 100vh; | ||
padding: 3rem 2rem; | ||
background-color: black; | ||
background-color: $m-01; | ||
background-image: radial-gradient(white, rgba(255, 255, 255, .1) 2px, transparent 20px), | ||
radial-gradient(white, rgba(255, 255, 255, .08) 1px, transparent 25px), | ||
radial-gradient(white, rgba(255, 255, 255, .05) 2px, transparent 30px), | ||
radial-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .02) 2px, transparent 35px); | ||
background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px; | ||
background-position: 0 0, 40px 60px, 130px 270px, 70px 100px; | ||
} | ||
|
||
|
||
.bg-dark-blue { | ||
background-color: $m-02 !important; | ||
} |
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 |
---|---|---|
@@ -1 +1,13 @@ | ||
<div class="container"></div> | ||
<div class="container content-center text-center"> | ||
<h1 class="display-2">NASA API</h1> | ||
<div class="row row-cols-auto justify-content-center"> | ||
<div class="card m-3 p-3 text-center" style="width: 18rem;" [routerLink]="['/apod']"> | ||
<h3 class="text-dark">APOD</h3> | ||
<p class="text-muted mb-0">Astronomy Picture of the Day</p> | ||
</div> | ||
<div class="card m-3 p-3 text-center" style="width: 18rem;" [routerLink]="['/epic']"> | ||
<h3 class="text-dark">EPIC</h3> | ||
<p class="text-muted mb-0">Earth Polychromatic Imaging Camera</p> | ||
</div> | ||
</div> | ||
</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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
<p-toast></p-toast> | ||
|
||
<app-search [title]="title" [searchType]="false" (response)="searchNasaData($event)"></app-search> | ||
|
||
<div *ngIf="nasaResponse" class="container"> | ||
<div class="content text-center"> | ||
<h1 class="display-4">{{nasaResponse?.title}}</h1> | ||
<p>{{title}}</p> | ||
<div class="d-flex justify-content-center"> | ||
<p-image *ngIf="nasaResponse?.media_type === 'image'" | ||
src="{{nasaResponse?.hdurl}}" alt="Image" width="100%" [preview]="true"></p-image> | ||
<video *ngIf="nasaResponse?.media_type === 'video'" | ||
autoplay="true" name="media"> | ||
<source src="{{nasaResponse?.url}}" type="video/mp4"> | ||
</video> | ||
<p-image *ngIf="nasaResponse?.media_type === 'image'" width="250" | ||
src="{{nasaResponse?.hdurl}}" alt="" [preview]="true"></p-image> | ||
<iframe *ngIf="nasaResponse?.media_type === 'video'" | ||
[src]="nasaResponse?.url | safe" width="400" height="300"></iframe> | ||
</div> | ||
<p class="description mt-3">{{nasaResponse?.explanation}}</p> | ||
<p class="description mt-3" style="font-style: italic; | ||
color: #bebebe">Copyright: {{nasaResponse?.copyright || 'Not found'}}</p> | ||
<h1 class="display-5">{{ nasaResponse?.title }}</h1> | ||
<p class="description mt-3 text-justify">{{ nasaResponse?.explanation }}</p> | ||
<p *ngIf="nasaResponse?.copyright" class="description mt-3" style="font-style: italic; | ||
color: #bebebe">Copyright: {{ nasaResponse?.copyright || 'Not found' }}</p> | ||
</div> | ||
</div> | ||
|
||
<app-loading *ngIf="loading"></app-loading> |
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
2 changes: 1 addition & 1 deletion
2
src/app/models/NasaResponse.ts → src/app/models/ApodResponse.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export class NasaResponse { | ||
export class ApodResponse { | ||
title: string; | ||
explanation: string; | ||
media_type: string; | ||
|
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,59 @@ | ||
export class EpicResponse { | ||
identifier: string; | ||
caption: string; | ||
image: string; | ||
version: string; | ||
centroid_coordinates: { | ||
lat: number; | ||
lon: number; | ||
}; | ||
dscovr_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
lunar_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
sun_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
attitude_quaternions: { | ||
q0: number; | ||
q1: number; | ||
q2: number; | ||
q3: number; | ||
}; | ||
date: string; | ||
coords: { | ||
centroid_coordinates: { | ||
lat: number; | ||
lon: number; | ||
}; | ||
dscovr_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
lunar_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
sun_j2000_position: { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
attitude_quaternions: { | ||
q0: number; | ||
q1: number; | ||
q2: number; | ||
q3: number; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export enum EnumsNasa { | ||
nasaApod = 'Astronomy Picture of the Day (APOD)' | ||
nasaApod = 'Astronomy Picture of the Day (APOD)', | ||
nasaEpic = 'Earth Polychromatic Imaging Camera (EPIC)', | ||
} |
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.
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
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,16 @@ | ||
import {Pipe, PipeTransform} from "@angular/core"; | ||
import {DomSanitizer} from "@angular/platform-browser"; | ||
|
||
@Pipe({ | ||
name: 'safe' | ||
}) | ||
export class SafePipe implements PipeTransform { | ||
|
||
constructor(private sanitizer: DomSanitizer) { } | ||
transform(url: any) { | ||
console.log(url) | ||
console.log(this.sanitizer.bypassSecurityTrustResourceUrl(url)) | ||
return this.sanitizer.bypassSecurityTrustResourceUrl(url); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.