Compare commits
No commits in common. "ab98f80740883a0cfbc12616c407f70aa1dbde91" and "546bc6fc1008d8cb040e85e87c897d77f7dc4d0d" have entirely different histories.
ab98f80740
...
546bc6fc10
|
|
@ -0,0 +1,6 @@
|
||||||
|
main {
|
||||||
|
width: 100%;
|
||||||
|
margin: 2rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
||||||
|
|
||||||
<!-- Contenu principal de la page (router-outlet) -->
|
<!-- Contenu principal de la page (router-outlet) -->
|
||||||
<div class="drawer-content max-w-full overflow-hidden flex flex-col">
|
<div class="drawer-content flex flex-col">
|
||||||
<main class="flex-grow m-0 p-4">
|
<main class="flex-grow p-4">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<div class="drawer-side is-drawer-close:overflow-visible">
|
<div class="drawer-side is-drawer-close:overflow-visible">
|
||||||
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
|
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
|
||||||
<div class="flex min-h-full flex-col items-start bg-base-200 is-drawer-close:w-14 is-drawer-open:w-64 mt-16 lg:mt-0">
|
<div class="flex min-h-full flex-col items-start bg-base-200 is-drawer-close:w-14 is-drawer-open:w-64">
|
||||||
<app-sidebar [userEmail]="connectedUserEmail()" />
|
<app-sidebar [userEmail]="connectedUserEmail()" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,16 @@
|
||||||
@if(isLoading()){
|
<div class="hero bg-base-200 min-h-screen">
|
||||||
<div class="spinner">
|
<div class="hero-content flex-col lg:flex-col">
|
||||||
<span class="loading loading-spinner loading-xl"></span>
|
<img
|
||||||
<p>Chargement ...</p>
|
src={{nasaPOTD()?.url}}
|
||||||
</div>
|
class="max-w-mid rounded-lg shadow-2xl"
|
||||||
}
|
alt="{{nasaPOTD()?.explanation}}"
|
||||||
@if(!isLoading() && nasaPOTD()){
|
/>
|
||||||
@if(nasaPOTD()?.media_type=="image"){
|
<div>
|
||||||
<div class="hero bg-base-200 min-h-screen">
|
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
||||||
<div class="hero-content flex-col lg:flex-col">
|
<p class="text-2x2 font-semibold">{{nasaPOTD()?.copyright}}</p>
|
||||||
<img src={{nasaPOTD()?.url}} class="max-w-mid rounded-lg shadow-2xl" alt="{{nasaPOTD()?.explanation}}" />
|
<p class="py-6">
|
||||||
<div>
|
{{nasaPOTD()?.explanation}}
|
||||||
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
</p>
|
||||||
<p class="text-2x2 font-semibold">{{nasaPOTD()?.copyright}}</p>
|
|
||||||
<p class="py-6">
|
|
||||||
{{nasaPOTD()?.explanation}}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
@if(nasaPOTD()?.media_type==="video"){
|
|
||||||
<div class="videocontainer flex justify-center w-full mt-20">
|
|
||||||
<video class="rounded-md" controls>
|
|
||||||
<source src="{{nasaPOTD()!.url}}" type="video/mp4">
|
|
||||||
</video>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@if(!isLoading() && !nasaPOTD()){
|
|
||||||
<p>Impossible de charger la vidéo.</p>
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit, inject, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { NAPOD } from '../../services/napod';
|
import { NAPOD } from '../../services/napod';
|
||||||
import { Picture } from '../../interfaces/picture';
|
import { Picture } from '../../interfaces/picture';
|
||||||
|
|
||||||
|
|
@ -8,22 +8,19 @@ import { Picture } from '../../interfaces/picture';
|
||||||
templateUrl: './potd.html',
|
templateUrl: './potd.html',
|
||||||
styleUrl: './potd.css'
|
styleUrl: './potd.css'
|
||||||
})
|
})
|
||||||
export class POTD implements OnInit{
|
export class POTD {
|
||||||
|
|
||||||
private readonly nasaApi = inject(NAPOD)
|
private readonly nasaApi = inject(NAPOD)
|
||||||
nasaPOTD = signal< Picture | null >(null)
|
nasaPOTD = signal< Picture | null >(null)
|
||||||
isLoading = signal<boolean>(true);
|
|
||||||
|
|
||||||
ngOnInit(){
|
constructor(){
|
||||||
this.nasaApi.getPicOfToday().subscribe({
|
this.nasaApi.getPicOfToday().subscribe({
|
||||||
next: (data)=>{
|
next: (data)=>{
|
||||||
console.log(data)
|
console.log(data)
|
||||||
this.nasaPOTD.set(data)
|
this.nasaPOTD.set(data)
|
||||||
this.isLoading.set(false);
|
|
||||||
},
|
},
|
||||||
error: error =>{
|
error: error =>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
this.isLoading.set(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@if(searchResults()!==null && searchResults()!.collection.items.length!==0){
|
@if(searchResults()!==null && searchResults()!.collection.items.length!==0){
|
||||||
<div class="flex justify-center resultsContainer w-full">
|
<div class="resultsContainer">
|
||||||
<ul class="flex max-w-6xl list bg-base-100 rounded-box shadow-md">
|
<ul class="list bg-base-100 rounded-box shadow-md">
|
||||||
|
|
||||||
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide">Results</li>
|
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide">Results</li>
|
||||||
@for(el of searchResults()!.collection.items; track el.data[0].nasa_id){
|
@for(el of searchResults()!.collection.items; track el.data[0].nasa_id){
|
||||||
<li class="list-row">
|
<li class="list-row">
|
||||||
|
|
@ -24,6 +25,7 @@
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit, inject, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Collection } from '../../interfaces/nasa-api';
|
import { Collection } from '../../interfaces/nasa-api';
|
||||||
import { NAPOD } from '../../services/napod';
|
import { NAPOD } from '../../services/napod';
|
||||||
|
|
@ -11,7 +11,7 @@ import { NAPOD } from '../../services/napod';
|
||||||
templateUrl: './video.html',
|
templateUrl: './video.html',
|
||||||
styleUrl: './video.css'
|
styleUrl: './video.css'
|
||||||
})
|
})
|
||||||
export class Video implements OnInit {
|
export class Video {
|
||||||
private readonly route = inject(ActivatedRoute)
|
private readonly route = inject(ActivatedRoute)
|
||||||
asset=signal<Collection|null>(null);
|
asset=signal<Collection|null>(null);
|
||||||
//TODO: nom nul pour le service a changer
|
//TODO: nom nul pour le service a changer
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,17 @@
|
||||||
|
<!--
|
||||||
|
<div class="menu bg-base-100 shadow-sm" >
|
||||||
|
<div><a class="btn btn-ghost text-xl" routerLink="/home">Home</a></div>
|
||||||
|
<div><a class="btn btn-ghost text-xl" routerLink="/potd">Picture of the day</a></div>
|
||||||
|
<div><a class="btn btn-ghost text-xl" routerLink="/search">Search</a></div>
|
||||||
|
@if(isLoggedIn()){
|
||||||
|
<div><a class="btn btn-ghost text-xl" (click)="logout()">Logout</a></div>
|
||||||
|
}
|
||||||
|
@if(!isLoggedIn()){
|
||||||
|
<div ><a class="btn btn-ghost text-xl" routerLink="/login">Login</a></div>
|
||||||
|
<div ><a class="btn btn-ghost text-xl" routerLink="/register">Register</a></div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
<ul class="menu w-full grow">
|
<ul class="menu w-full grow">
|
||||||
<li>
|
<li>
|
||||||
<a routerLink="/" class="is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Homepage">
|
<a routerLink="/" class="is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Homepage">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue