From 316a185c6fb21d5296b9d6323b35cb1e6cbc2976 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Sun, 9 Mar 2025 15:03:13 +0100 Subject: [PATCH 1/4] modif name --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 3c6dff3..d67d74a 100644 --- a/src/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - Angular + Angular Covid -- 2.45.3 From 63e74a83033627d11f6124ab47a8172a0a03ff0c Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 31 Mar 2025 19:43:59 +0200 Subject: [PATCH 2/4] Add service, move component --- src/app/app-routing.module.ts | 15 ++--- src/app/app.module.ts | 40 +++++++++--- src/app/blog/blog.component.html | 1 - src/app/blog/blog.component.ts | 11 ---- .../blogs/blogs.component.css} | 0 src/app/component/blogs/blogs.component.html | 1 + .../blogs/blogs.component.spec.ts} | 12 ++-- src/app/component/blogs/blogs.component.ts | 11 ++++ .../contact/contact.component.css | 0 .../contact/contact.component.html | 0 .../contact/contact.component.spec.ts | 0 .../contact/contact.component.ts | 0 .../essential}/footer/footer.component.css | 0 .../essential}/footer/footer.component.html | 0 .../footer/footer.component.spec.ts | 0 .../essential}/footer/footer.component.ts | 0 .../essential}/nav-bar/nav-bar.component.css | 0 .../essential}/nav-bar/nav-bar.component.html | 21 +++---- .../nav-bar/nav-bar.component.spec.ts | 0 .../essential}/nav-bar/nav-bar.component.ts | 2 +- .../home-accueil/home-accueil.component.css} | 0 .../home-accueil/home-accueil.component.html | 10 +++ .../home-accueil.component.spec.ts | 23 +++++++ .../home-accueil/home-accueil.component.ts | 11 ++++ .../home-symptoms.component.css} | 0 .../home-symptoms.component.html | 18 ++++++ .../home-symptoms.component.spec.ts | 23 +++++++ .../home-symptoms/home-symptoms.component.ts | 17 +++++ src/app/component/home/home.component.css | 0 src/app/component/home/home.component.html | 4 ++ .../home/home.component.spec.ts | 0 .../{ => component}/home/home.component.ts | 0 .../component/symptoms/symptoms.component.css | 0 .../symptoms/symptoms.component.html | 1 + .../symptoms/symptoms.component.spec.ts} | 12 ++-- .../component/symptoms/symptoms.component.ts | 11 ++++ src/app/home/home.component.html | 63 ------------------- .../all/address/address.service.spec.ts | 16 +++++ .../service/all/address/address.service.ts | 19 ++++++ src/app/service/all/blog/blog.service.spec.ts | 16 +++++ src/app/service/all/blog/blog.service.ts | 19 ++++++ .../all/symptom/symptom.service.spec.ts | 16 +++++ .../service/all/symptom/symptom.service.ts | 19 ++++++ src/app/service/data.service.spec.ts | 16 +++++ src/app/service/data.service.ts | 29 +++++++++ src/app/symptome/symptome.component.html | 1 - src/app/symptome/symptome.component.ts | 11 ---- tsconfig.json | 6 +- 48 files changed, 346 insertions(+), 129 deletions(-) delete mode 100644 src/app/blog/blog.component.html delete mode 100644 src/app/blog/blog.component.ts rename src/app/{blog/blog.component.css => component/blogs/blogs.component.css} (100%) create mode 100644 src/app/component/blogs/blogs.component.html rename src/app/{blog/blog.component.spec.ts => component/blogs/blogs.component.spec.ts} (55%) create mode 100644 src/app/component/blogs/blogs.component.ts rename src/app/{ => component}/contact/contact.component.css (100%) rename src/app/{ => component}/contact/contact.component.html (100%) rename src/app/{ => component}/contact/contact.component.spec.ts (100%) rename src/app/{ => component}/contact/contact.component.ts (100%) rename src/app/{ => component/essential}/footer/footer.component.css (100%) rename src/app/{ => component/essential}/footer/footer.component.html (100%) rename src/app/{ => component/essential}/footer/footer.component.spec.ts (100%) rename src/app/{ => component/essential}/footer/footer.component.ts (100%) rename src/app/{ => component/essential}/nav-bar/nav-bar.component.css (100%) rename src/app/{ => component/essential}/nav-bar/nav-bar.component.html (53%) rename src/app/{ => component/essential}/nav-bar/nav-bar.component.spec.ts (100%) rename src/app/{ => component/essential}/nav-bar/nav-bar.component.ts (99%) rename src/app/{home/home.component.css => component/home/all/home-accueil/home-accueil.component.css} (100%) create mode 100644 src/app/component/home/all/home-accueil/home-accueil.component.html create mode 100644 src/app/component/home/all/home-accueil/home-accueil.component.spec.ts create mode 100644 src/app/component/home/all/home-accueil/home-accueil.component.ts rename src/app/{symptome/symptome.component.css => component/home/all/home-symptoms/home-symptoms.component.css} (100%) create mode 100644 src/app/component/home/all/home-symptoms/home-symptoms.component.html create mode 100644 src/app/component/home/all/home-symptoms/home-symptoms.component.spec.ts create mode 100644 src/app/component/home/all/home-symptoms/home-symptoms.component.ts create mode 100644 src/app/component/home/home.component.css create mode 100644 src/app/component/home/home.component.html rename src/app/{ => component}/home/home.component.spec.ts (100%) rename src/app/{ => component}/home/home.component.ts (100%) create mode 100644 src/app/component/symptoms/symptoms.component.css create mode 100644 src/app/component/symptoms/symptoms.component.html rename src/app/{symptome/symptome.component.spec.ts => component/symptoms/symptoms.component.spec.ts} (53%) create mode 100644 src/app/component/symptoms/symptoms.component.ts delete mode 100644 src/app/home/home.component.html create mode 100644 src/app/service/all/address/address.service.spec.ts create mode 100644 src/app/service/all/address/address.service.ts create mode 100644 src/app/service/all/blog/blog.service.spec.ts create mode 100644 src/app/service/all/blog/blog.service.ts create mode 100644 src/app/service/all/symptom/symptom.service.spec.ts create mode 100644 src/app/service/all/symptom/symptom.service.ts create mode 100644 src/app/service/data.service.spec.ts create mode 100644 src/app/service/data.service.ts delete mode 100644 src/app/symptome/symptome.component.html delete mode 100644 src/app/symptome/symptome.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f185c47..53c95df 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,16 +1,17 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { HomeComponent } from './home/home.component'; -import { ContactComponent } from './contact/contact.component'; -import { SymptomeComponent } from './symptome/symptome.component'; -import { BlogComponent } from './blog/blog.component'; + +import { HomeComponent } from './component/home/home.component'; +import { SymptomsComponent } from './component/symptoms/symptoms.component'; +import { BlogsComponent } from './component/blogs/blogs.component'; +import { ContactComponent } from './component/contact/contact.component'; const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'home', component: HomeComponent }, - { path: 'contacts', component: ContactComponent }, - { path: 'symptômes', component: SymptomeComponent }, - { path: 'blog', component: BlogComponent }, + { path: 'symptoms', component: SymptomsComponent }, + { path: 'blogs', component: BlogsComponent }, + { path: 'contact', component: ContactComponent }, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 70b0e22..d878e3d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,23 +4,43 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NavBarComponent } from './nav-bar/nav-bar.component'; -import { HomeComponent } from './home/home.component'; -import { FooterComponent } from './footer/footer.component'; -import { SymptomeComponent } from './symptome/symptome.component'; -import { ContactComponent } from './contact/contact.component'; -import { BlogComponent } from './blog/blog.component'; + +/* Essential */ +import { NavBarComponent } from './component/essential/nav-bar/nav-bar.component'; +import { FooterComponent } from './component/essential/footer/footer.component'; + +/* Home */ +import { HomeComponent } from './component/home/home.component'; +import { HomeAccueilComponent } from './component/home/all/home-accueil/home-accueil.component'; +import { HomeSymptomsComponent } from './component/home/all/home-symptoms/home-symptoms.component'; + +/* Symptoms */ +import { SymptomsComponent } from './component/symptoms/symptoms.component'; + +/* Blogs */ +import { BlogsComponent } from './component/blogs/blogs.component'; + +/* Contact */ +import { ContactComponent } from './component/contact/contact.component'; + @NgModule({ declarations: [ AppComponent, + /* Essential */ NavBarComponent, - HomeComponent, FooterComponent, - SymptomeComponent, - ContactComponent, - BlogComponent + /* Home */ + HomeComponent, + HomeAccueilComponent, + HomeSymptomsComponent, + /* Symptoms */ + SymptomsComponent, + /* Blogs */ + BlogsComponent, + /* Contact */ + ContactComponent ], imports: [ BrowserModule, diff --git a/src/app/blog/blog.component.html b/src/app/blog/blog.component.html deleted file mode 100644 index ff0c151..0000000 --- a/src/app/blog/blog.component.html +++ /dev/null @@ -1 +0,0 @@ -

blog works!

diff --git a/src/app/blog/blog.component.ts b/src/app/blog/blog.component.ts deleted file mode 100644 index 65310b0..0000000 --- a/src/app/blog/blog.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-blog', - standalone: false, - templateUrl: './blog.component.html', - styleUrl: './blog.component.css' -}) -export class BlogComponent { - -} diff --git a/src/app/blog/blog.component.css b/src/app/component/blogs/blogs.component.css similarity index 100% rename from src/app/blog/blog.component.css rename to src/app/component/blogs/blogs.component.css diff --git a/src/app/component/blogs/blogs.component.html b/src/app/component/blogs/blogs.component.html new file mode 100644 index 0000000..11235a6 --- /dev/null +++ b/src/app/component/blogs/blogs.component.html @@ -0,0 +1 @@ +

blogs works!

diff --git a/src/app/blog/blog.component.spec.ts b/src/app/component/blogs/blogs.component.spec.ts similarity index 55% rename from src/app/blog/blog.component.spec.ts rename to src/app/component/blogs/blogs.component.spec.ts index ac14310..86eb3a5 100644 --- a/src/app/blog/blog.component.spec.ts +++ b/src/app/component/blogs/blogs.component.spec.ts @@ -1,18 +1,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BlogComponent } from './blog.component'; +import { BlogsComponent } from './blogs.component'; -describe('BlogComponent', () => { - let component: BlogComponent; - let fixture: ComponentFixture; +describe('BlogsComponent', () => { + let component: BlogsComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [BlogComponent] + declarations: [BlogsComponent] }) .compileComponents(); - fixture = TestBed.createComponent(BlogComponent); + fixture = TestBed.createComponent(BlogsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/component/blogs/blogs.component.ts b/src/app/component/blogs/blogs.component.ts new file mode 100644 index 0000000..779af6a --- /dev/null +++ b/src/app/component/blogs/blogs.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-blogs', + standalone: false, + templateUrl: './blogs.component.html', + styleUrl: './blogs.component.css' +}) +export class BlogsComponent { + +} diff --git a/src/app/contact/contact.component.css b/src/app/component/contact/contact.component.css similarity index 100% rename from src/app/contact/contact.component.css rename to src/app/component/contact/contact.component.css diff --git a/src/app/contact/contact.component.html b/src/app/component/contact/contact.component.html similarity index 100% rename from src/app/contact/contact.component.html rename to src/app/component/contact/contact.component.html diff --git a/src/app/contact/contact.component.spec.ts b/src/app/component/contact/contact.component.spec.ts similarity index 100% rename from src/app/contact/contact.component.spec.ts rename to src/app/component/contact/contact.component.spec.ts diff --git a/src/app/contact/contact.component.ts b/src/app/component/contact/contact.component.ts similarity index 100% rename from src/app/contact/contact.component.ts rename to src/app/component/contact/contact.component.ts diff --git a/src/app/footer/footer.component.css b/src/app/component/essential/footer/footer.component.css similarity index 100% rename from src/app/footer/footer.component.css rename to src/app/component/essential/footer/footer.component.css diff --git a/src/app/footer/footer.component.html b/src/app/component/essential/footer/footer.component.html similarity index 100% rename from src/app/footer/footer.component.html rename to src/app/component/essential/footer/footer.component.html diff --git a/src/app/footer/footer.component.spec.ts b/src/app/component/essential/footer/footer.component.spec.ts similarity index 100% rename from src/app/footer/footer.component.spec.ts rename to src/app/component/essential/footer/footer.component.spec.ts diff --git a/src/app/footer/footer.component.ts b/src/app/component/essential/footer/footer.component.ts similarity index 100% rename from src/app/footer/footer.component.ts rename to src/app/component/essential/footer/footer.component.ts diff --git a/src/app/nav-bar/nav-bar.component.css b/src/app/component/essential/nav-bar/nav-bar.component.css similarity index 100% rename from src/app/nav-bar/nav-bar.component.css rename to src/app/component/essential/nav-bar/nav-bar.component.css diff --git a/src/app/nav-bar/nav-bar.component.html b/src/app/component/essential/nav-bar/nav-bar.component.html similarity index 53% rename from src/app/nav-bar/nav-bar.component.html rename to src/app/component/essential/nav-bar/nav-bar.component.html index b0488a8..08409f1 100644 --- a/src/app/nav-bar/nav-bar.component.html +++ b/src/app/component/essential/nav-bar/nav-bar.component.html @@ -8,23 +8,22 @@ diff --git a/src/app/nav-bar/nav-bar.component.spec.ts b/src/app/component/essential/nav-bar/nav-bar.component.spec.ts similarity index 100% rename from src/app/nav-bar/nav-bar.component.spec.ts rename to src/app/component/essential/nav-bar/nav-bar.component.spec.ts diff --git a/src/app/nav-bar/nav-bar.component.ts b/src/app/component/essential/nav-bar/nav-bar.component.ts similarity index 99% rename from src/app/nav-bar/nav-bar.component.ts rename to src/app/component/essential/nav-bar/nav-bar.component.ts index a1e7892..b480d74 100644 --- a/src/app/nav-bar/nav-bar.component.ts +++ b/src/app/component/essential/nav-bar/nav-bar.component.ts @@ -13,7 +13,7 @@ export class NavBarComponent { isHomeActive(): boolean { return this.router.url === '/' || this.router.url === '/home'; } - + isHomeActiveBool(): boolean { if (this.router.url != '/home') { return true diff --git a/src/app/home/home.component.css b/src/app/component/home/all/home-accueil/home-accueil.component.css similarity index 100% rename from src/app/home/home.component.css rename to src/app/component/home/all/home-accueil/home-accueil.component.css diff --git a/src/app/component/home/all/home-accueil/home-accueil.component.html b/src/app/component/home/all/home-accueil/home-accueil.component.html new file mode 100644 index 0000000..bede297 --- /dev/null +++ b/src/app/component/home/all/home-accueil/home-accueil.component.html @@ -0,0 +1,10 @@ +
+
+

Ensemble. Luttons.

+

Lorem, ipsum dolor, sit amet consectetur adipisicing elit...

+ +
+
+ Illustration Covid +
+
\ No newline at end of file diff --git a/src/app/component/home/all/home-accueil/home-accueil.component.spec.ts b/src/app/component/home/all/home-accueil/home-accueil.component.spec.ts new file mode 100644 index 0000000..fd36295 --- /dev/null +++ b/src/app/component/home/all/home-accueil/home-accueil.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeAccueilComponent } from './home-accueil.component'; + +describe('HomeAccueilComponent', () => { + let component: HomeAccueilComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [HomeAccueilComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HomeAccueilComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/component/home/all/home-accueil/home-accueil.component.ts b/src/app/component/home/all/home-accueil/home-accueil.component.ts new file mode 100644 index 0000000..64792e1 --- /dev/null +++ b/src/app/component/home/all/home-accueil/home-accueil.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-home-accueil', + standalone: false, + templateUrl: './home-accueil.component.html', + styleUrl: './home-accueil.component.css' +}) +export class HomeAccueilComponent { + +} diff --git a/src/app/symptome/symptome.component.css b/src/app/component/home/all/home-symptoms/home-symptoms.component.css similarity index 100% rename from src/app/symptome/symptome.component.css rename to src/app/component/home/all/home-symptoms/home-symptoms.component.css diff --git a/src/app/component/home/all/home-symptoms/home-symptoms.component.html b/src/app/component/home/all/home-symptoms/home-symptoms.component.html new file mode 100644 index 0000000..775870f --- /dev/null +++ b/src/app/component/home/all/home-symptoms/home-symptoms.component.html @@ -0,0 +1,18 @@ +
+

Symptôme du Coronavirus

+

Lorem, ipsum dolor sit amet consectetur...

+
+ +
+
+
+
+ +
+
{{ symptom.title }}
+

{{ symptom.description }}

+
+
+
+
+
\ No newline at end of file diff --git a/src/app/component/home/all/home-symptoms/home-symptoms.component.spec.ts b/src/app/component/home/all/home-symptoms/home-symptoms.component.spec.ts new file mode 100644 index 0000000..6171b5a --- /dev/null +++ b/src/app/component/home/all/home-symptoms/home-symptoms.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeSymptomsComponent } from './home-symptoms.component'; + +describe('HomeSymptomsComponent', () => { + let component: HomeSymptomsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [HomeSymptomsComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HomeSymptomsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/component/home/all/home-symptoms/home-symptoms.component.ts b/src/app/component/home/all/home-symptoms/home-symptoms.component.ts new file mode 100644 index 0000000..e4b0871 --- /dev/null +++ b/src/app/component/home/all/home-symptoms/home-symptoms.component.ts @@ -0,0 +1,17 @@ +import { Component } from '@angular/core'; + +import { DataService } from '@services/data.service'; + +@Component({ + selector: 'app-home-symptoms', + standalone: false, + templateUrl: './home-symptoms.component.html', + styleUrl: './home-symptoms.component.css' +}) +export class HomeSymptomsComponent { + constructor(private dataService: DataService) {} + + get symptoms() { + return this.dataService.getSymptoms(); + } +} diff --git a/src/app/component/home/home.component.css b/src/app/component/home/home.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/component/home/home.component.html b/src/app/component/home/home.component.html new file mode 100644 index 0000000..0696d1b --- /dev/null +++ b/src/app/component/home/home.component.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/src/app/home/home.component.spec.ts b/src/app/component/home/home.component.spec.ts similarity index 100% rename from src/app/home/home.component.spec.ts rename to src/app/component/home/home.component.spec.ts diff --git a/src/app/home/home.component.ts b/src/app/component/home/home.component.ts similarity index 100% rename from src/app/home/home.component.ts rename to src/app/component/home/home.component.ts diff --git a/src/app/component/symptoms/symptoms.component.css b/src/app/component/symptoms/symptoms.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/component/symptoms/symptoms.component.html b/src/app/component/symptoms/symptoms.component.html new file mode 100644 index 0000000..639f503 --- /dev/null +++ b/src/app/component/symptoms/symptoms.component.html @@ -0,0 +1 @@ +

symptoms works!

diff --git a/src/app/symptome/symptome.component.spec.ts b/src/app/component/symptoms/symptoms.component.spec.ts similarity index 53% rename from src/app/symptome/symptome.component.spec.ts rename to src/app/component/symptoms/symptoms.component.spec.ts index d1e0d3e..8c0faa0 100644 --- a/src/app/symptome/symptome.component.spec.ts +++ b/src/app/component/symptoms/symptoms.component.spec.ts @@ -1,18 +1,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { SymptomeComponent } from './symptome.component'; +import { SymptomsComponent } from './symptoms.component'; -describe('SymptomeComponent', () => { - let component: SymptomeComponent; - let fixture: ComponentFixture; +describe('SymptomsComponent', () => { + let component: SymptomsComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [SymptomeComponent] + declarations: [SymptomsComponent] }) .compileComponents(); - fixture = TestBed.createComponent(SymptomeComponent); + fixture = TestBed.createComponent(SymptomsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/component/symptoms/symptoms.component.ts b/src/app/component/symptoms/symptoms.component.ts new file mode 100644 index 0000000..4edac18 --- /dev/null +++ b/src/app/component/symptoms/symptoms.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-symptoms', + standalone: false, + templateUrl: './symptoms.component.html', + styleUrl: './symptoms.component.css' +}) +export class SymptomsComponent { + +} diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html deleted file mode 100644 index 559963e..0000000 --- a/src/app/home/home.component.html +++ /dev/null @@ -1,63 +0,0 @@ -
-
-
-

Ensemble. Luttons.

-

Lorem, ipsum dolor, sit amet consectetur adipisicing elit...

- -
-
- Illustration Covid -
-
- -
-

Symptôme du Coronavirus

-

Lorem, ipsum dolor sit amet consectetur...

-
- -
-
-
-
- Forte fièvre -
-
Forte fièvre
-

Lorem ipsum dolor sit amet...

-
-
-
-
-
-
-
- Toux -
-
Toux
-

Lorem ipsum dolor sit amet...

-
-
-
-
-
-
-
- Gorge irritée -
-
Gorge irritée
-

Lorem ipsum dolor sit amet...

-
-
-
-
-
-
-
- Migraine -
-
Migraine
-

Lorem ipsum dolor sit amet...

-
-
-
-
-
\ No newline at end of file diff --git a/src/app/service/all/address/address.service.spec.ts b/src/app/service/all/address/address.service.spec.ts new file mode 100644 index 0000000..f0cd890 --- /dev/null +++ b/src/app/service/all/address/address.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AddressService } from './address.service'; + +describe('AddressService', () => { + let service: AddressService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(AddressService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/service/all/address/address.service.ts b/src/app/service/all/address/address.service.ts new file mode 100644 index 0000000..615fdb9 --- /dev/null +++ b/src/app/service/all/address/address.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class AddressService { + constructor() { } + + private addresses = [ + { title: "Adresse 1", type: "Dépistage", address: "39 Rue Albert 75013 Paris" }, + { title: "Adresse 2", type: "Vaccination", address: "10 Rue de la Huchette 75005 Paris" }, + { title: "Adresse 3", type: "Dépistage", address: "29 Rue de Caumartin 75009 Paris" }, + { title: "Adresse 4", type: "Dépistage & Vaccination", address: "4 Villa Monceau 75017 Paris" } + ]; + + getAddresses() { + return this.addresses; + } +} diff --git a/src/app/service/all/blog/blog.service.spec.ts b/src/app/service/all/blog/blog.service.spec.ts new file mode 100644 index 0000000..64866b7 --- /dev/null +++ b/src/app/service/all/blog/blog.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { BlogService } from './blog.service'; + +describe('BlogService', () => { + let service: BlogService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(BlogService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/service/all/blog/blog.service.ts b/src/app/service/all/blog/blog.service.ts new file mode 100644 index 0000000..589e94b --- /dev/null +++ b/src/app/service/all/blog/blog.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class BlogService { + constructor() { } + + private blogs = [ + { title: "Blog 1", date: "2022-03-19", text: "Contenu..." }, + { title: "Blog 2", date: "2022-12-14", text: "Contenu..." }, + { title: "Blog 3", date: "2022-05-16", text: "Contenu..." }, + { title: "Blog 4", date: "2022-05-04", text: "Contenu..." } + ]; + + getBlogs() { + return this.blogs; + } +} diff --git a/src/app/service/all/symptom/symptom.service.spec.ts b/src/app/service/all/symptom/symptom.service.spec.ts new file mode 100644 index 0000000..ea676e9 --- /dev/null +++ b/src/app/service/all/symptom/symptom.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { SymptomService } from './symptom.service'; + +describe('SymptomService', () => { + let service: SymptomService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(SymptomService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/service/all/symptom/symptom.service.ts b/src/app/service/all/symptom/symptom.service.ts new file mode 100644 index 0000000..52ca34b --- /dev/null +++ b/src/app/service/all/symptom/symptom.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class SymptomService { + constructor() { } + + private symptoms = [ + { title: "Toux", imageName: "/assets/toux.png", description: "Lorem ipsum dolor sit amet..." }, + { title: "Fièvre", imageName: "/assets/fievre.png", description: "Lorem ipsum dolor sit amet..." }, + { title: "Migraine", imageName: "/assets/migraine.png", description: "Lorem ipsum dolor sit amet..." }, + { title: "Mal de gorge", imageName: "/assets/gorge.png", description: "Lorem ipsum dolor sit amet..." } + ]; + + getSymptoms() { + return this.symptoms; + } +} diff --git a/src/app/service/data.service.spec.ts b/src/app/service/data.service.spec.ts new file mode 100644 index 0000000..38e8d9e --- /dev/null +++ b/src/app/service/data.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { DataService } from './data.service'; + +describe('DataService', () => { + let service: DataService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(DataService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/service/data.service.ts b/src/app/service/data.service.ts new file mode 100644 index 0000000..f35d00a --- /dev/null +++ b/src/app/service/data.service.ts @@ -0,0 +1,29 @@ +import { Injectable } from '@angular/core'; + +import { SymptomService } from './all/symptom/symptom.service'; +import { BlogService } from './all/blog/blog.service'; +import { AddressService } from './all/address/address.service'; + +@Injectable({ + providedIn: 'root' +}) +export class DataService { + + constructor( + private symptomService: SymptomService, + private blogService: BlogService, + private addressService: AddressService + ) {} + + getSymptoms() { + return this.symptomService.getSymptoms(); + } + + getBlogs() { + return this.blogService.getBlogs(); + } + + getAddresses() { + return this.addressService.getAddresses(); + } +} diff --git a/src/app/symptome/symptome.component.html b/src/app/symptome/symptome.component.html deleted file mode 100644 index 1e0558d..0000000 --- a/src/app/symptome/symptome.component.html +++ /dev/null @@ -1 +0,0 @@ -

symptome works!

diff --git a/src/app/symptome/symptome.component.ts b/src/app/symptome/symptome.component.ts deleted file mode 100644 index c8e9850..0000000 --- a/src/app/symptome/symptome.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-symptome', - standalone: false, - templateUrl: './symptome.component.html', - styleUrl: './symptome.component.css' -}) -export class SymptomeComponent { - -} diff --git a/tsconfig.json b/tsconfig.json index 5525117..1686a50 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,11 @@ "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022" + "module": "ES2022", + "baseUrl": "./src", + "paths": { + "@services/*": ["app/service/*"] + } }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, -- 2.45.3 From 1f5890b4ff40631667417c878ada4d13fecbe0ce Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Mon, 31 Mar 2025 21:58:44 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Add=20donn=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/component/blogs/blogs.component.ts | 6 +++ .../component/contact/contact.component.ts | 8 +++- .../home-symptoms.component.html | 4 +- .../symptoms/symptoms.component.html | 19 +++++++- .../component/symptoms/symptoms.component.ts | 6 +++ .../service/all/address/address.service.ts | 8 ++-- src/app/service/all/blog/blog.service.ts | 24 ++++++++-- .../service/all/symptom/symptom.service.ts | 44 ++++++++++++++++-- src/assets/what.avif | Bin 0 -> 12835 bytes 9 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 src/assets/what.avif diff --git a/src/app/component/blogs/blogs.component.ts b/src/app/component/blogs/blogs.component.ts index 779af6a..7c77df9 100644 --- a/src/app/component/blogs/blogs.component.ts +++ b/src/app/component/blogs/blogs.component.ts @@ -1,5 +1,7 @@ import { Component } from '@angular/core'; +import { DataService } from '@services/data.service'; + @Component({ selector: 'app-blogs', standalone: false, @@ -7,5 +9,9 @@ import { Component } from '@angular/core'; styleUrl: './blogs.component.css' }) export class BlogsComponent { + constructor(private dataService: DataService) {} + get blogs() { + return this.dataService.getBlogs(); + } } diff --git a/src/app/component/contact/contact.component.ts b/src/app/component/contact/contact.component.ts index 4a8c27e..13a545d 100644 --- a/src/app/component/contact/contact.component.ts +++ b/src/app/component/contact/contact.component.ts @@ -1,5 +1,7 @@ import { Component } from '@angular/core'; +import { DataService } from '@services/data.service'; + @Component({ selector: 'app-contact', standalone: false, @@ -7,5 +9,9 @@ import { Component } from '@angular/core'; styleUrl: './contact.component.css' }) export class ContactComponent { - + constructor(private dataService: DataService) {} + + get addresses() { + return this.dataService.getAddresses(); + } } diff --git a/src/app/component/home/all/home-symptoms/home-symptoms.component.html b/src/app/component/home/all/home-symptoms/home-symptoms.component.html index 775870f..28830f8 100644 --- a/src/app/component/home/all/home-symptoms/home-symptoms.component.html +++ b/src/app/component/home/all/home-symptoms/home-symptoms.component.html @@ -4,10 +4,10 @@
-
+
- +
{{ symptom.title }}

{{ symptom.description }}

diff --git a/src/app/component/symptoms/symptoms.component.html b/src/app/component/symptoms/symptoms.component.html index 639f503..70cc473 100644 --- a/src/app/component/symptoms/symptoms.component.html +++ b/src/app/component/symptoms/symptoms.component.html @@ -1 +1,18 @@ -

symptoms works!

+
+

Symptôme du Coronavirus

+

Lorem, ipsum dolor sit amet consectetur...

+
+ +
+
+
+
+ +
+
{{ symptom.title }}
+

{{ symptom.description }}

+
+
+
+
+
\ No newline at end of file diff --git a/src/app/component/symptoms/symptoms.component.ts b/src/app/component/symptoms/symptoms.component.ts index 4edac18..bfcd0f1 100644 --- a/src/app/component/symptoms/symptoms.component.ts +++ b/src/app/component/symptoms/symptoms.component.ts @@ -1,5 +1,7 @@ import { Component } from '@angular/core'; +import { DataService } from '@services/data.service'; + @Component({ selector: 'app-symptoms', standalone: false, @@ -7,5 +9,9 @@ import { Component } from '@angular/core'; styleUrl: './symptoms.component.css' }) export class SymptomsComponent { + constructor(private dataService: DataService) {} + get symptoms() { + return this.dataService.getSymptoms(); + } } diff --git a/src/app/service/all/address/address.service.ts b/src/app/service/all/address/address.service.ts index 615fdb9..f0c77d9 100644 --- a/src/app/service/all/address/address.service.ts +++ b/src/app/service/all/address/address.service.ts @@ -7,10 +7,10 @@ export class AddressService { constructor() { } private addresses = [ - { title: "Adresse 1", type: "Dépistage", address: "39 Rue Albert 75013 Paris" }, - { title: "Adresse 2", type: "Vaccination", address: "10 Rue de la Huchette 75005 Paris" }, - { title: "Adresse 3", type: "Dépistage", address: "29 Rue de Caumartin 75009 Paris" }, - { title: "Adresse 4", type: "Dépistage & Vaccination", address: "4 Villa Monceau 75017 Paris" } + { title: "Centre de Dépistage - Laboratoire Biomédical", type: "Dépistage", address: "15 Rue de la Colombette, 31000 Toulouse" }, + { title: "Centre de Vaccination Municipal Toulouse La Daurade", type: "Vaccination", address: "17 Place de la Daurade, 31000 Toulouse" }, + { title: "Pharmacie des Pyrénées", type: "Dépistage", address: "77 Boulevard de Strasbourg, 31000 Toulouse" }, + { title: "Centre de Vaccination - CHU Toulouse Purpan", type: "Dépistage & Vaccination", address: "1 Place du Docteur Joseph Baylac, 31300 Toulouse" } ]; getAddresses() { diff --git a/src/app/service/all/blog/blog.service.ts b/src/app/service/all/blog/blog.service.ts index 589e94b..961ab60 100644 --- a/src/app/service/all/blog/blog.service.ts +++ b/src/app/service/all/blog/blog.service.ts @@ -7,10 +7,26 @@ export class BlogService { constructor() { } private blogs = [ - { title: "Blog 1", date: "2022-03-19", text: "Contenu..." }, - { title: "Blog 2", date: "2022-12-14", text: "Contenu..." }, - { title: "Blog 3", date: "2022-05-16", text: "Contenu..." }, - { title: "Blog 4", date: "2022-05-04", text: "Contenu..." } + { + title: "Déclaration de la pandémie par l'OMS", + date: "2020-03-11", + text: "L'Organisation mondiale de la santé (OMS) a déclaré le COVID-19 comme une pandémie mondiale, soulignant la gravité et la rapidité de la propagation du virus." + }, + { + title: "Premier confinement en France", + date: "2020-03-17", + text: "La France a instauré un confinement national strict pour limiter la propagation du virus, entraînant la fermeture des écoles, des commerces non essentiels et des restrictions de déplacement." + }, + { + title: "Début de la campagne de vaccination en France", + date: "2020-12-27", + text: "La France a lancé sa campagne de vaccination contre le COVID-19, en commençant par les populations les plus vulnérables." + }, + { + title: "Levée progressive des restrictions sanitaires", + date: "2021-06-09", + text: "La France a entamé une levée progressive des restrictions, avec la réouverture des restaurants, des lieux culturels et l'assouplissement du couvre-feu." + } ]; getBlogs() { diff --git a/src/app/service/all/symptom/symptom.service.ts b/src/app/service/all/symptom/symptom.service.ts index 52ca34b..3fa1656 100644 --- a/src/app/service/all/symptom/symptom.service.ts +++ b/src/app/service/all/symptom/symptom.service.ts @@ -7,10 +7,46 @@ export class SymptomService { constructor() { } private symptoms = [ - { title: "Toux", imageName: "/assets/toux.png", description: "Lorem ipsum dolor sit amet..." }, - { title: "Fièvre", imageName: "/assets/fievre.png", description: "Lorem ipsum dolor sit amet..." }, - { title: "Migraine", imageName: "/assets/migraine.png", description: "Lorem ipsum dolor sit amet..." }, - { title: "Mal de gorge", imageName: "/assets/gorge.png", description: "Lorem ipsum dolor sit amet..." } + { + title: "Toux", + imageName: "/assets/toux.png", + description: "Une toux sèche et persistante est l'un des premiers symptômes du COVID-19. Elle peut être accompagnée de difficultés respiratoires." + }, + { + title: "Fièvre", + imageName: "/assets/fievre.png", + description: "Une fièvre supérieure à 38°C est un symptôme courant du COVID-19, indiquant que le corps combat une infection." + }, + { + title: "Fatigue", + imageName: "/assets/what.avif", + description: "Un état de fatigue intense, même sans activité physique, est fréquemment observé chez les personnes atteintes du virus." + }, + { + title: "Perte du goût et de l'odorat", + imageName: "/assets/what.avif", + description: "L'anosmie (perte de l'odorat) et l'agueusie (perte du goût) sont des symptômes spécifiques souvent signalés par les patients atteints du COVID-19." + }, + { + title: "Difficultés respiratoires", + imageName: "/assets/what.avif", + description: "Une sensation d'essoufflement ou une difficulté à respirer peut indiquer une forme plus grave de l'infection nécessitant une prise en charge médicale." + }, + { + title: "Maux de gorge", + imageName: "/assets/gorge.png", + description: "Un mal de gorge accompagné d'une sensation de brûlure ou de picotements peut être un signe d'infection par le virus." + }, + { + title: "Maux de tête", + imageName: "/assets/migraine.png", + description: "Des céphalées intenses et persistantes sont rapportées par de nombreux patients atteints du COVID-19." + }, + { + title: "Douleurs musculaires", + imageName: "/assets/what.avif", + description: "Des douleurs musculaires généralisées peuvent accompagner l'infection, similaires à celles observées lors d'une grippe." + } ]; getSymptoms() { diff --git a/src/assets/what.avif b/src/assets/what.avif new file mode 100644 index 0000000000000000000000000000000000000000..703664aebdcd980ec8c0fb97a22676f9815c3578 GIT binary patch literal 12835 zcmXwcV{j%+({*gywr$(Cv9YaQ+WpS} z|GP=7Y#mJhb7De3!2ixa03-Z=1_EM6|7S_9tnB~S^nWS(KVt^+zq0?vU}FAHT3b0f zJN{!?D@Rj@e~fDCVC!seYU}y$2|N%)z`qF2*qvE45E$;C1VXcNaWwl+{Oe^21Oy`a zParv3d0PFKfI>k*{Ub~(N4x*~(!aUDfP+B6{tbk0_siH71qcQP%f$A96%33G2Z<%b z1X&0e3`tn1$)M{1yAGpC%E@z&(Q_`l``+A0_KKu4S=PDjCnrZ`jvBR9nv1HFbuYS} zNE_avh&by*KURa~9;O|ND6I^x{Cmq%8`?v~YhvK$0NY3asz!Wja9e-MJ^s zF}U%W9Y3faG+o%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e1LfuYYw9if{ zK?%JZ7i*a+b-J*@e$kQtWdDKj#cjL5KoH28I`av(;T(3w^5;~+Y}|T)m9Xh-uOPv` z39#lIM{AkYrn35qNv{GTWz+y^&70LM@);k@h%y1PN?EGAG$*av%)J#w`+O@y2+8nX z*M(ctVUBM%5V^m#`ufJV*+Gsb;g)v&LgHD4Y8F2#^EDI9;3I zQ#%9Nv6*PwLnsG!j*!~k$?-_MU_daL1i;ER#amitF}E)w`SVWvz&riKYR`$xFaeJk z%p`)cC))fJe^Oo+@UomJV+D*e3iRK)IyQ1^Oaei!6VpM|9~eJaL~?+?ko@L@ zJoR(hlksyfJm&Y;A#WMbhUJ1@gd{Ns!u}#tzb#qt;Ev}%=z=}lSJAvxD{P(OGCZ1y cvk|r+PZx_LyV}JBvq990P)k^Qw+H?Fe@!-d4*&oF literal 0 HcmV?d00001 -- 2.45.3 From f0fd146c547723d5d5923433a34f8132eb147287 Mon Sep 17 00:00:00 2001 From: ExostFlash Date: Tue, 1 Apr 2025 15:11:17 +0200 Subject: [PATCH 4/4] Add API, and object Article for api --- package-lock.json | 7 ++ package.json | 1 + src/app/app.module.ts | 9 ++- src/app/component/blogs/blogs.component.css | 58 +++++++++++++++ src/app/component/blogs/blogs.component.html | 17 ++++- src/app/component/blogs/blogs.component.ts | 13 ++-- .../component/contact/contact.component.css | 32 +++++++++ .../component/contact/contact.component.html | 71 ++++++++++++++++++- .../essential/footer/footer.component.html | 4 +- .../all/home-actu/home-actu.component.css | 54 ++++++++++++++ .../all/home-actu/home-actu.component.html | 41 +++++++++++ .../all/home-actu/home-actu.component.spec.ts | 23 ++++++ .../home/all/home-actu/home-actu.component.ts | 22 ++++++ src/app/component/home/home.component.html | 1 + src/app/interface/news.ts | 21 ++++++ src/app/service/all/news/news.service.spec.ts | 16 +++++ src/app/service/all/news/news.service.ts | 44 ++++++++++++ src/app/service/data.service.ts | 8 ++- tsconfig.json | 3 +- 19 files changed, 432 insertions(+), 13 deletions(-) create mode 100644 src/app/component/home/all/home-actu/home-actu.component.css create mode 100644 src/app/component/home/all/home-actu/home-actu.component.html create mode 100644 src/app/component/home/all/home-actu/home-actu.component.spec.ts create mode 100644 src/app/component/home/all/home-actu/home-actu.component.ts create mode 100644 src/app/interface/news.ts create mode 100644 src/app/service/all/news/news.service.spec.ts create mode 100644 src/app/service/all/news/news.service.ts diff --git a/package-lock.json b/package-lock.json index f89f351..0aabb3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@angular/router": "^19.2.0", "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", + "file-saver": "^2.0.5", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" @@ -7737,6 +7738,12 @@ "node": ">=0.8.0" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", diff --git a/package.json b/package.json index 6408a0c..9f33136 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@angular/router": "^19.2.0", "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", + "file-saver": "^2.0.5", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.15.0" diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d878e3d..45ea6c1 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,6 +4,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { HttpClientModule } from '@angular/common/http'; /* Essential */ import { NavBarComponent } from './component/essential/nav-bar/nav-bar.component'; @@ -11,6 +12,7 @@ import { FooterComponent } from './component/essential/footer/footer.component'; /* Home */ import { HomeComponent } from './component/home/home.component'; +import { HomeActuComponent } from './component/home/all/home-actu/home-actu.component'; import { HomeAccueilComponent } from './component/home/all/home-accueil/home-accueil.component'; import { HomeSymptomsComponent } from './component/home/all/home-symptoms/home-symptoms.component'; @@ -24,7 +26,6 @@ import { BlogsComponent } from './component/blogs/blogs.component'; import { ContactComponent } from './component/contact/contact.component'; - @NgModule({ declarations: [ AppComponent, @@ -33,6 +34,7 @@ import { ContactComponent } from './component/contact/contact.component'; FooterComponent, /* Home */ HomeComponent, + HomeActuComponent, HomeAccueilComponent, HomeSymptomsComponent, /* Symptoms */ @@ -40,13 +42,14 @@ import { ContactComponent } from './component/contact/contact.component'; /* Blogs */ BlogsComponent, /* Contact */ - ContactComponent + ContactComponent ], imports: [ BrowserModule, AppRoutingModule, FormsModule, - ReactiveFormsModule + ReactiveFormsModule, + HttpClientModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/component/blogs/blogs.component.css b/src/app/component/blogs/blogs.component.css index e69de29..eefda9f 100644 --- a/src/app/component/blogs/blogs.component.css +++ b/src/app/component/blogs/blogs.component.css @@ -0,0 +1,58 @@ +/* Card Image */ +.card-img-top { + height: 200px; + object-fit: cover; + width: 100%; + } + + /* Assurer une taille uniforme pour les cards */ + .card { + display: flex; + flex-direction: column; + height: 100%; + } + + /* Body de la card pour avoir une hauteur fixe et uniforme */ + .card-body { + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 1.25rem; + height: 100%; + } + + /* Titre de la card (limiter la taille du texte si trop long) */ + .card-title { + font-size: 1.2rem; + font-weight: bold; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + max-height: 2.5em; /* Limite la hauteur du titre */ + margin-bottom: 1rem; + } + + /* Description de la card (maximiser l'espace disponible pour la description) */ + .card-text { + font-size: 0.9rem; + color: #6c757d; + flex-grow: 1; /* Permet à la description de prendre l'espace restant */ + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + margin-bottom: 1.5rem; /* Espacement entre la description et le bouton */ + } + + /* Bouton */ + .btn-primary { + background-color: #007bff; + border-color: #007bff; + text-align: center; + } + + .btn-primary:hover { + background-color: #0056b3; + border-color: #0056b3; + } + \ No newline at end of file diff --git a/src/app/component/blogs/blogs.component.html b/src/app/component/blogs/blogs.component.html index 11235a6..626840e 100644 --- a/src/app/component/blogs/blogs.component.html +++ b/src/app/component/blogs/blogs.component.html @@ -1 +1,16 @@ -

blogs works!

+
+
+
+ Article image +
+
{{ article.title }}
+

{{ article.description }}

+ Lire l'article +
+
+
+
+ + \ No newline at end of file diff --git a/src/app/component/blogs/blogs.component.ts b/src/app/component/blogs/blogs.component.ts index 7c77df9..27dc0f4 100644 --- a/src/app/component/blogs/blogs.component.ts +++ b/src/app/component/blogs/blogs.component.ts @@ -1,6 +1,7 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { DataService } from '@services/data.service'; +import { Article } from '@interface/news'; @Component({ selector: 'app-blogs', @@ -8,10 +9,14 @@ import { DataService } from '@services/data.service'; templateUrl: './blogs.component.html', styleUrl: './blogs.component.css' }) -export class BlogsComponent { +export class BlogsComponent implements OnInit { + articles: Article[] = []; + constructor(private dataService: DataService) {} - get blogs() { - return this.dataService.getBlogs(); + ngOnInit(): void { + this.dataService.getNews().subscribe((response) => { + this.articles = response.articles; + }); } } diff --git a/src/app/component/contact/contact.component.css b/src/app/component/contact/contact.component.css index e69de29..ea16378 100644 --- a/src/app/component/contact/contact.component.css +++ b/src/app/component/contact/contact.component.css @@ -0,0 +1,32 @@ +/* Amélioration du formulaire */ +.custom-input { + border: 1px solid #ced4da; + border-radius: 8px; + padding: 10px; + transition: border-color 0.3s ease-in-out, box-shadow 0.2s ease-in-out; +} + +.custom-input:focus { + border-color: #007bff; + box-shadow: 0 0 5px rgba(0, 123, 255, 0.2); + outline: none; +} + +/* Bouton amélioré */ +.btn-primary { + background-color: #007bff; + border: none; + font-weight: 500; + transition: background 0.3s ease, transform 0.2s ease-in-out; +} + +.btn-primary:hover { + background-color: #0056b3; + transform: scale(1.02); +} + +/* Liste des centres */ +.contact-card { + background: #f8f9fa; + border-radius: 10px; +} diff --git a/src/app/component/contact/contact.component.html b/src/app/component/contact/contact.component.html index 9cae746..4b2fb60 100644 --- a/src/app/component/contact/contact.component.html +++ b/src/app/component/contact/contact.component.html @@ -1 +1,70 @@ -

contact works!

+
+
+

Contactez-nous

+

Vous avez une question ? Contactez-nous via le formulaire ou rendez-vous dans l'un de nos centres.

+
+ +
+ +
+
+
+

Nos Centres

+
    +
  • + +
    +
    {{ address.title }}
    +

    Type : {{ address.type }}

    +

    Adresse : {{ address.address }}

    +
    +
  • +
+
+
+
+ + +
+
+
+

Laissez-nous un message

+
+
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ + +
+ + +
+
+
+
+
+
diff --git a/src/app/component/essential/footer/footer.component.html b/src/app/component/essential/footer/footer.component.html index 8f79ba5..8853338 100644 --- a/src/app/component/essential/footer/footer.component.html +++ b/src/app/component/essential/footer/footer.component.html @@ -19,8 +19,8 @@ Mentions légales Cookies Accessibilité - Nous contacter - Presse + Nous contacter + Presse
diff --git a/src/app/component/home/all/home-actu/home-actu.component.css b/src/app/component/home/all/home-actu/home-actu.component.css new file mode 100644 index 0000000..4d0ecd9 --- /dev/null +++ b/src/app/component/home/all/home-actu/home-actu.component.css @@ -0,0 +1,54 @@ +#newsCarousel { + position: relative; + } + + .carousel-item img { + width: 100%; + height: 350px; /* Ajuste la hauteur de l'image pour avoir une vue cohérente */ + object-fit: cover; + border-radius: 10px; + } + + .carousel-caption { + position: absolute; + bottom: 20px; + background-color: rgba(13, 110, 253, 0.7); /* Légère transparence pour le fond */ + padding: 15px; + border-radius: 5px; + color: white; + } + + .carousel-caption h5 { + font-size: 1.5rem; + font-weight: bold; + } + + .carousel-caption p { + font-size: 1rem; + margin-top: 10px; + } + + .carousel-caption .btn { + margin-top: 10px; + } + + .carousel-control-prev, + .carousel-control-next { + background-color: transparent; /* Pas de fond sombre */ + border-radius: 50%; /* Forme ronde */ + border: none; /* Retirer la bordure */ + } + + .carousel-control-prev:hover, + .carousel-control-next:hover { + background-color: transparent; /* Pas de changement de fond au survol */ + } + + .carousel-control-next-icon-new svg { + transform: rotate(180deg); /* Rotation de 180° */ + } + + .carousel-control-prev-icon-new svg, + .carousel-control-next-icon-new svg { + fill: #0d95fd; /* Couleur de l'icône */ + } \ No newline at end of file diff --git a/src/app/component/home/all/home-actu/home-actu.component.html b/src/app/component/home/all/home-actu/home-actu.component.html new file mode 100644 index 0000000..745189e --- /dev/null +++ b/src/app/component/home/all/home-actu/home-actu.component.html @@ -0,0 +1,41 @@ + + \ No newline at end of file diff --git a/src/app/component/home/all/home-actu/home-actu.component.spec.ts b/src/app/component/home/all/home-actu/home-actu.component.spec.ts new file mode 100644 index 0000000..4097df3 --- /dev/null +++ b/src/app/component/home/all/home-actu/home-actu.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeActuComponent } from './home-actu.component'; + +describe('HomeActuComponent', () => { + let component: HomeActuComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [HomeActuComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HomeActuComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/component/home/all/home-actu/home-actu.component.ts b/src/app/component/home/all/home-actu/home-actu.component.ts new file mode 100644 index 0000000..dea9ee0 --- /dev/null +++ b/src/app/component/home/all/home-actu/home-actu.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; + +import { DataService } from '@services/data.service'; +import { Article } from '@interface/news'; + +@Component({ + selector: 'app-home-actu', + standalone: false, + templateUrl: './home-actu.component.html', + styleUrls: ['./home-actu.component.css'] // Correction ici : styleUrls (pluriel) +}) +export class HomeActuComponent implements OnInit { + articles: Article[] = []; + + constructor(private dataService: DataService) {} + + ngOnInit(): void { + this.dataService.getNews().subscribe((response) => { + this.articles = response.articles.slice(0, 5); + }); + } +} diff --git a/src/app/component/home/home.component.html b/src/app/component/home/home.component.html index 0696d1b..bb4d98d 100644 --- a/src/app/component/home/home.component.html +++ b/src/app/component/home/home.component.html @@ -1,4 +1,5 @@
+
\ No newline at end of file diff --git a/src/app/interface/news.ts b/src/app/interface/news.ts new file mode 100644 index 0000000..faf1ef8 --- /dev/null +++ b/src/app/interface/news.ts @@ -0,0 +1,21 @@ +export interface Source { + id: string | null; + name: string; +} + +export interface Article { + source: Source; + author: string; + title: string; + description: string; + url: string; + urlToImage: string; + publishedAt: string; + content: string; +} + +export interface NewsResponse { + status: string; + totalResults: number; + articles: Article[]; +} \ No newline at end of file diff --git a/src/app/service/all/news/news.service.spec.ts b/src/app/service/all/news/news.service.spec.ts new file mode 100644 index 0000000..d129c15 --- /dev/null +++ b/src/app/service/all/news/news.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { NewsService } from './news.service'; + +describe('NewsService', () => { + let service: NewsService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(NewsService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/service/all/news/news.service.ts b/src/app/service/all/news/news.service.ts new file mode 100644 index 0000000..a666e80 --- /dev/null +++ b/src/app/service/all/news/news.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { NewsResponse } from '@interface/news'; // Assure-toi que le chemin est correct +import { tap } from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class NewsService { + private apiKey: string = 'e9bb2770d3374edea421bcadbecdca5c'; + private apiUrl: string = `https://newsapi.org/v2/everything?q=covid&language=fr&apiKey=${this.apiKey}`; + private storageKey: string = 'newsData'; // Clé utilisée pour le localStorage + private lastUpdateKey: string = 'lastUpdate'; // Clé pour stocker la date de la dernière mise à jour + private cacheDuration: number = 60 * 60 * 1000; // Durée en millisecondes (par exemple, 1 heure) + + constructor(private http: HttpClient) {} + + // Méthode pour récupérer les articles de l'API ou du localStorage + getNews(): Observable { + const storedData = localStorage.getItem(this.storageKey); + const lastUpdate = localStorage.getItem(this.lastUpdateKey); + + // Vérifie si les données existent et si elles sont encore valides + const currentTime = new Date().getTime(); + + if (storedData && lastUpdate && (currentTime - Number(lastUpdate)) < this.cacheDuration) { + // Si les données sont présentes et récentes (moins de 1 heure par exemple), on les retourne + return new Observable(observer => { + observer.next(JSON.parse(storedData)); // On envoie les données stockées + observer.complete(); + }); + } else { + // Sinon, on effectue la requête à l'API + return this.http.get(this.apiUrl).pipe( + tap(response => { + // On stocke la réponse dans le localStorage et la date de mise à jour + localStorage.setItem(this.storageKey, JSON.stringify(response)); + localStorage.setItem(this.lastUpdateKey, currentTime.toString()); // On enregistre l'heure de la mise à jour + }) + ); + } + } +} \ No newline at end of file diff --git a/src/app/service/data.service.ts b/src/app/service/data.service.ts index f35d00a..3ff8296 100644 --- a/src/app/service/data.service.ts +++ b/src/app/service/data.service.ts @@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; import { SymptomService } from './all/symptom/symptom.service'; import { BlogService } from './all/blog/blog.service'; import { AddressService } from './all/address/address.service'; +import { NewsService } from './all/news/news.service'; @Injectable({ providedIn: 'root' @@ -12,7 +13,8 @@ export class DataService { constructor( private symptomService: SymptomService, private blogService: BlogService, - private addressService: AddressService + private addressService: AddressService, + private newsService: NewsService ) {} getSymptoms() { @@ -26,4 +28,8 @@ export class DataService { getAddresses() { return this.addressService.getAddresses(); } + + getNews() { + return this.newsService.getNews(); + } } diff --git a/tsconfig.json b/tsconfig.json index 1686a50..8fdd6ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "module": "ES2022", "baseUrl": "./src", "paths": { - "@services/*": ["app/service/*"] + "@services/*": ["app/service/*"], + "@interface/*": ["app/interface/*"] } }, "angularCompilerOptions": { -- 2.45.3