Compare commits
2 Commits
546bc6fc10
...
ab98f80740
| Author | SHA1 | Date |
|---|---|---|
|
|
ab98f80740 | |
|
|
a312b4a2a2 |
|
|
@ -1,6 +0,0 @@
|
|||
main {
|
||||
width: 100%;
|
||||
margin: 2rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
||||
|
||||
<!-- Contenu principal de la page (router-outlet) -->
|
||||
<div class="drawer-content flex flex-col">
|
||||
<main class="flex-grow p-4">
|
||||
<div class="drawer-content max-w-full overflow-hidden flex flex-col">
|
||||
<main class="flex-grow m-0 p-4">
|
||||
<router-outlet></router-outlet>
|
||||
</main>
|
||||
</div>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<!-- Sidebar -->
|
||||
<div class="drawer-side is-drawer-close:overflow-visible">
|
||||
<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">
|
||||
<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">
|
||||
<app-sidebar [userEmail]="connectedUserEmail()" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
@if(isLoading()){
|
||||
<div class="spinner">
|
||||
<span class="loading loading-spinner loading-xl"></span>
|
||||
<p>Chargement ...</p>
|
||||
</div>
|
||||
}
|
||||
@if(!isLoading() && nasaPOTD()){
|
||||
@if(nasaPOTD()?.media_type=="image"){
|
||||
<div class="hero bg-base-200 min-h-screen">
|
||||
<div class="hero-content flex-col lg:flex-col">
|
||||
<img
|
||||
src={{nasaPOTD()?.url}}
|
||||
class="max-w-mid rounded-lg shadow-2xl"
|
||||
alt="{{nasaPOTD()?.explanation}}"
|
||||
/>
|
||||
<img src={{nasaPOTD()?.url}} class="max-w-mid rounded-lg shadow-2xl" alt="{{nasaPOTD()?.explanation}}" />
|
||||
<div>
|
||||
<h1 class="text-5xl font-bold">{{nasaPOTD()?.title}}</h1>
|
||||
<p class="text-2x2 font-semibold">{{nasaPOTD()?.copyright}}</p>
|
||||
|
|
@ -14,3 +18,16 @@
|
|||
</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, inject, signal } from '@angular/core';
|
||||
import { Component, OnInit, inject, signal } from '@angular/core';
|
||||
import { NAPOD } from '../../services/napod';
|
||||
import { Picture } from '../../interfaces/picture';
|
||||
|
||||
|
|
@ -8,19 +8,22 @@ import { Picture } from '../../interfaces/picture';
|
|||
templateUrl: './potd.html',
|
||||
styleUrl: './potd.css'
|
||||
})
|
||||
export class POTD {
|
||||
export class POTD implements OnInit{
|
||||
|
||||
private readonly nasaApi = inject(NAPOD)
|
||||
nasaPOTD = signal< Picture | null >(null)
|
||||
isLoading = signal<boolean>(true);
|
||||
|
||||
constructor(){
|
||||
ngOnInit(){
|
||||
this.nasaApi.getPicOfToday().subscribe({
|
||||
next: (data)=>{
|
||||
console.log(data)
|
||||
this.nasaPOTD.set(data)
|
||||
this.isLoading.set(false);
|
||||
},
|
||||
error: error =>{
|
||||
console.log(error);
|
||||
this.isLoading.set(false);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
}
|
||||
|
||||
@if(searchResults()!==null && searchResults()!.collection.items.length!==0){
|
||||
<div class="resultsContainer">
|
||||
<ul class="list bg-base-100 rounded-box shadow-md">
|
||||
|
||||
<div class="flex justify-center resultsContainer w-full">
|
||||
<ul class="flex max-w-6xl list bg-base-100 rounded-box shadow-md">
|
||||
<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){
|
||||
<li class="list-row">
|
||||
|
|
@ -25,7 +24,6 @@
|
|||
</button>
|
||||
</li>
|
||||
}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, inject, signal } from '@angular/core';
|
||||
import { Component, OnInit, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Collection } from '../../interfaces/nasa-api';
|
||||
import { NAPOD } from '../../services/napod';
|
||||
|
|
@ -11,7 +11,7 @@ import { NAPOD } from '../../services/napod';
|
|||
templateUrl: './video.html',
|
||||
styleUrl: './video.css'
|
||||
})
|
||||
export class Video {
|
||||
export class Video implements OnInit {
|
||||
private readonly route = inject(ActivatedRoute)
|
||||
asset=signal<Collection|null>(null);
|
||||
//TODO: nom nul pour le service a changer
|
||||
|
|
|
|||
|
|
@ -1,17 +1,3 @@
|
|||
<!--
|
||||
<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">
|
||||
<li>
|
||||
<a routerLink="/" class="is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Homepage">
|
||||
|
|
|
|||
Loading…
Reference in New Issue