Merge branch 'master' into add-pin

home
Alexis Feron 5 months ago
commit 5f1205a1a1

@ -49,7 +49,13 @@
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
@ -86,5 +92,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

@ -1,4 +1,4 @@
<app-navbar></app-navbar>
<app-leaflet-map></app-leaflet-map>
<!-- <app-leaflet-map></app-leaflet-map> -->
<router-outlet />

@ -1,11 +1,10 @@
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { LeafletMapComponent } from './components/leaflet-map/leaflet-map.component';
import { NavbarComponent } from './components/navbar/navbar.component';
@Component({
selector: 'app-root',
imports: [RouterOutlet, NavbarComponent, LeafletMapComponent],
imports: [RouterOutlet, NavbarComponent],
templateUrl: './app.component.html',
})
export class AppComponent {

@ -1,3 +1,8 @@
import { Routes } from '@angular/router';
import { HomePageComponent } from './components/home-page/home-page.component';
import { LeafletMapComponent } from './components/leaflet-map/leaflet-map.component';
export const routes: Routes = [];
export const routes: Routes = [
{path: '', component: HomePageComponent},
{path: 'map', component: LeafletMapComponent}
];

@ -0,0 +1,58 @@
<img src="/home.jpg" alt="image carte du monde" style="width: 100%">
<hr class="h-3 bg-yellow-50 border-0 brown">
<div style="display: flex; gap: 20px; padding: 20px; justify-content: center; align-items: stretch;">
<section class="bg-white dark:bg-gray-900" style="border-radius: 15px; flex: 1 ; padding: 20px; display: flex; flex-direction: column; justify-content: space-between;">
<div style="display: flex; flex: 3; flex-direction: row;" class="gap-8 items-center py-8 px-4 mx-auto max-w-screen-xl xl:gap-16 md:grid md:grid-cols-2 sm:py-16 lg:px-6">
<div>
<img src="/logo.png" alt="Équipe Memory sombre" >
</div>
<div class="mt-4 md:mt-0">
<h2 class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white">
Bienvenue sur Memory Map
</h2>
<p class="mb-6 font-light text-gray-500 md:text-lg dark:text-gray-400">
Plongez dans un voyage interactif à travers vos souvenirs avec
<strong>Memory Map</strong>, l'application qui transforme vos aventures
en une carte unique et personnalisée.
</p>
<p class="mb-6 font-light text-gray-500 md:text-lg dark:text-gray-400">
Enrichissez vos marqueurs avec des photos, des légendes, des notes personnelles, et même des amis
identifiés pour revivre chaque moment important.
</p>
<button routerLink="/map" class="inline-flex items-center text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:focus:ring-blue-800">
Commencez votre aventure
<svg class="ml-2 -mr-1 w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path>
</svg>
</button>
</div>
</div>
</section>
<section class="bg-white dark:bg-gray-900" style="border-radius: 15px; flex: 1 ; padding: 20px; display: flex; flex-direction: column; justify-content: space-between;">
<div style="display: flex; flex: 3; flex-direction: row;" class="gap-8 items-center py-8 px-4 mx-auto max-w-screen-xl xl:gap-16 md:grid md:grid-cols-2 sm:py-16 lg:px-6">
<div class="mt-4 md:mt-0" >
<h2 class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900 dark:text-white">
L'équipe Memory
</h2>
<p class="mb-6 font-light text-gray-500 md:text-lg dark:text-gray-400">
Toute l'équipe de <strong>Memory</strong> est fière de vous présenter
<strong>Memory Map</strong>, une application conçue avec passion et créativité pour vous permettre
de revivre vos meilleurs souvenirs et d'en découvrir de nouveaux.
</p>
<p class="mb-6 font-light text-gray-500 md:text-lg dark:text-gray-400">
Nous vous remercions de nous accompagner dans cette belle aventure, et nous avons hâte de voir les
magnifiques cartes que vous allez créer !
</p>
<p class="font-medium text-lg text-center text-gray-900 dark:text-gray-100">
Bonne année 2025 à tous, remplie de souvenirs inoubliables 🌍✨
</p>
</div>
<div>
<img src="/logo.png" alt="Équipe Memory sombre" >
</div>
</div>
</section>
</div>

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomePageComponent } from './home-page.component';
describe('HomePageComponent', () => {
let component: HomePageComponent;
let fixture: ComponentFixture<HomePageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HomePageComponent]
})
.compileComponents();
fixture = TestBed.createComponent(HomePageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,13 @@
import { Component } from '@angular/core';
import { RouterLink } from '@angular/router';
@Component({
selector: 'app-home-page',
imports: [RouterLink],
templateUrl: './home-page.component.html',
styleUrl: './home-page.component.css'
})
export class HomePageComponent {
}

@ -19,7 +19,14 @@ export class LeafletMapComponent implements OnInit {
private initializeMap(): void {
// Initialize the map
this.map = L.map('map').setView([46.603354, 1.888334], 6);
this.map = L.map('map', {
maxBounds: L.latLngBounds(
L.latLng(-90, -180), // South-West
L.latLng(90, 180) // North-East
),
maxBoundsViscosity: 1.0, // Prevent dragging the map out of bounds
minZoom: 2, // Prevent zooming out too much
}).setView([46.603354, 1.888334], 6);
// Add OpenStreetMap tiles
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {

@ -9,7 +9,7 @@
>Memory Map</span
>
</a>
<div class="flex lg:order-2">
<div *ngIf="!isHomePage" class="flex lg:order-2">
<button
type="button"
data-collapse-toggle="navbar-search"
@ -121,30 +121,45 @@
<ul
class="flex flex-col p-4 lg:p-0 mt-4 font-medium border border-gray-100 rounded-lg bg-gray-50 lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 lg:bg-white dark:bg-gray-800 lg:dark:bg-gray-900 dark:border-gray-700"
>
<li class="flex items-center space-x-2">
<li class="flex items-center space-x-2" *ngIf="!isHomePage">
<a
href="#"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
aria-current="page"
>Home</a
>
>Home
</a>
</li>
<li class="flex items-center space-x-2">
<li class="flex items-center space-x-2" *ngIf="isHomePage">
<a
href="#"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Quests</a
>
aria-current="page"
>Connexion
</a>
</li>
<li class="flex items-center space-x-2" *ngIf="!isHomePage">
<a
href="#"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Quests
</a>
</li>
<li class="flex items-center space-x-2" *ngIf="isHomePage">
<a
href="#"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Inscription
</a>
</li>
<li class="flex items-center space-x-2">
<li class="flex items-center space-x-2" *ngIf="!isHomePage">
<app-add-pin-popup></app-add-pin-popup>
</li>
<li class="flex items-center space-x-2">
<li class="flex items-center space-x-2" *ngIf="!isHomePage">
<a
href="#"
class="block py-2 text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300"
>Friends</a
>
>Friends
</a>
</li>
</ul>
</div>

@ -1,9 +1,24 @@
import { Component } from '@angular/core';
import { NgIf } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { AddPinPopupComponent } from '../add-pin-popup/add-pin-popup.component';
@Component({
selector: 'app-navbar',
imports: [AddPinPopupComponent],
imports: [AddPinPopupComponent, NgIf],
templateUrl: './navbar.component.html',
})
export class NavbarComponent {}
export class NavbarComponent implements OnInit {
isHomePage: boolean = false;
constructor(private router: Router) {}
ngOnInit(): void {
this.isHomePage = this.router.url === '/';
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
this.isHomePage = event.url === '/';
}
});
}
}

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { LoginService } from './login.service';
describe('LoginService', () => {
let service: LoginService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(LoginService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

@ -0,0 +1,22 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class LoginService {
private apiUrl = environment.apiURL;
constructor(private http: HttpClient) {}
login(username: string, password: string): Observable<any> {
return this.http.get(this.apiUrl + '/login', {
params: {
username: username,
password: password,
},
});
}
}

@ -0,0 +1,4 @@
export const environment = {
production: false,
apiURL: 'https://api.memorymap.fr/api/v1',
};

@ -0,0 +1,4 @@
export const environment = {
production: true,
apiURL: 'https://api.memorymap.fr/api/v1',
};
Loading…
Cancel
Save