-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from rotirk20/development
Updates of homepage, locations UI and mockup data
- Loading branch information
Showing
22 changed files
with
319 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
<div class="bg-white shadow-lg py-4 border-t-[1px] border-gray-100"> | ||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center"> | ||
Copyright 2024 Smetovi.ba | ||
<footer class="w-full py-14"> | ||
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"> | ||
<div class="max-w-3xl mx-auto"> | ||
<ul | ||
class="text-lg flex items-center justify-center flex-col gap-7 md:flex-row md:gap-12 transition-all duration-500 py-8 mb-8 border-b border-gray-200"> | ||
<li><a routerLink="/" class="text-gray-800 hover:text-gray-900">Početna</a></li> | ||
<li><a routerLink="/lokacije" class=" text-gray-800 hover:text-gray-900">Lokacije</a></li> | ||
<li><a routerLink="/kontakt" class=" text-gray-800 hover:text-gray-900">Kontakt</a></li> | ||
</ul> | ||
<div class="flex space-x-10 justify-center items-center mb-8"> | ||
<a href="#" class="block text-gray-900 transition-all duration-500 hover:text-indigo-600 "> | ||
<svg class="w-[0.938rem] h-[1.625rem]" viewBox="0 0 15 26" fill="none" | ||
xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M13.7926 14.4697L14.5174 9.86889H10.0528V6.87836C10.0528 5.62033 10.6761 4.39105 12.6692 4.39105H14.7275V0.473179C13.5289 0.282204 12.3177 0.178886 11.1037 0.164062C7.42917 0.164062 5.0302 2.37101 5.0302 6.36077V9.86889H0.957031V14.4697H5.0302V25.5979H10.0528V14.4697H13.7926Z" | ||
fill="currentColor" /> | ||
</svg> | ||
|
||
</a> | ||
</div> | ||
<span class="text-lg text-gray-500 text-center block">©<a href="https://smetovi.ba/">smetovi.ba</a> 2024, | ||
All rights reserved.</span> | ||
</div> | ||
</div> | ||
</div> | ||
</footer> |
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
29 changes: 29 additions & 0 deletions
29
frontend/src/app/components/item-list/item-list.component.html
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,29 @@ | ||
<div class="bg-white py-12"> | ||
<div class="container mx-auto px-4 mt-24"> | ||
<h2 | ||
class="text-4xl mb-8 font-bold uppercase text-left relative inline-block after:content-[''] after:block after:w-32 after:h-1 after:bg-blue-500 after:mt-4"> | ||
{{title}} | ||
</h2> | ||
|
||
<div *ngIf="data.length > 0; else noData" | ||
class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-8"> | ||
<article *ngFor="let item of data" | ||
class="relative isolate flex flex-col justify-end overflow-hidden rounded-2xl px-8 pb-8 pt-40 w-full mx-auto cursor-pointer shadow-lg"> | ||
<img src="{{item.image}}" alt="{{item.name}}" class="absolute inset-0 h-full w-full object-cover"> | ||
<div class="absolute inset-0 bg-gradient-to-t from-gray-900 via-gray-900/40"></div> | ||
<h3 class="z-10 mt-3 text-2xl font-bold text-white">{{item.name}}</h3> | ||
</article> | ||
</div> | ||
|
||
<!-- Template for no data --> | ||
<ng-template #noData> | ||
<div class="mt-8"> | ||
<p class="bg-zinc-50 text-gray-700 p-4 rounded-lg text-center font-semibold"> | ||
Nema podataka. | ||
</p> | ||
</div> | ||
</ng-template> | ||
|
||
|
||
</div> | ||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
frontend/src/app/components/item-list/item-list.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ItemListComponent } from './item-list.component'; | ||
|
||
describe('ItemListComponent', () => { | ||
let component: ItemListComponent; | ||
let fixture: ComponentFixture<ItemListComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ItemListComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ItemListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
frontend/src/app/components/item-list/item-list.component.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NgFor, NgIf } from '@angular/common'; | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { Location } from 'src/app/shared/models/location.model'; | ||
|
||
type ItemType = Location; // Union type for flexibility | ||
|
||
@Component({ | ||
selector: 'item-list', | ||
standalone: true, | ||
imports: [NgFor, NgIf], | ||
templateUrl: './item-list.component.html', | ||
styleUrls: ['./item-list.component.scss'] | ||
}) | ||
export class ItemListComponent { | ||
@Input() data!: ItemType[]; // decorate the property with @Input() | ||
@Input() title!: string; | ||
constructor() {} | ||
|
||
} |
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 @@ | ||
<p>weather works!</p> |
Empty file.
23 changes: 23 additions & 0 deletions
23
frontend/src/app/components/weather/weather.component.spec.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { WeatherComponent } from './weather.component'; | ||
|
||
describe('WeatherComponent', () => { | ||
let component: WeatherComponent; | ||
let fixture: ComponentFixture<WeatherComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [WeatherComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(WeatherComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,36 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { WeatherService } from 'src/app/shared/services/weather.service'; | ||
|
||
@Component({ | ||
selector: 'app-weather', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './weather.component.html', | ||
styleUrls: ['./weather.component.scss'] | ||
}) | ||
export class WeatherComponent implements OnInit { | ||
weatherData: any; | ||
city: string = 'Zenica'; // Default city, you can make this dynamic | ||
|
||
constructor(private weatherService: WeatherService) {} | ||
|
||
ngOnInit() { | ||
this.getWeather(this.city); | ||
} | ||
|
||
getWeather(city: string) { | ||
this.weatherService.getWeather(city).subscribe({ | ||
next: (data) => { | ||
this.weatherData = data; | ||
console.log(this.weatherData) | ||
}, | ||
error: (error) => { | ||
console.error('Error fetching weather data:', error); | ||
}, | ||
complete: () => { | ||
console.log('Weather data fetching complete'); | ||
} | ||
}); | ||
} | ||
|
||
} |
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,13 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { RouterLink } from '@angular/router'; | ||
import { ItemListComponent } from 'src/app/components/item-list/item-list.component'; | ||
import { WeatherComponent } from 'src/app/components/weather/weather.component'; | ||
import { Location } from 'src/app/shared/models/location.model'; | ||
import { LocationService } from 'src/app/shared/services/location.service'; | ||
|
||
@Component({ | ||
selector: 'app-home', | ||
standalone: true, | ||
templateUrl: './home.component.html', | ||
styleUrls: ['./home.component.scss'], | ||
imports: [RouterLink] | ||
imports: [RouterLink, HttpClientModule, ItemListComponent, WeatherComponent] | ||
}) | ||
export class HomeComponent { | ||
export class HomeComponent implements OnInit { | ||
locations: Location[] = []; | ||
constructor(private locationService: LocationService) {} | ||
|
||
ngOnInit() { | ||
this.locationService.getLocations().subscribe(data => { | ||
this.locations = data.locations; // Assuming 'locations' is the key in your JSON | ||
}); | ||
} | ||
} |
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,5 @@ | ||
.marker-info { | ||
max-width: 300px; | ||
img { | ||
max-width: 300px; | ||
max-height: 200px; | ||
|
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
Oops, something went wrong.