Skip to content

Commit f3c9300

Browse files
committed
refactor: update podcast card styles, improve navigation layout, and implement search functionality
1 parent cef2ce5 commit f3c9300

File tree

6 files changed

+61
-72
lines changed

6 files changed

+61
-72
lines changed

public/assets/data/podcast.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"description": "Welcome to Angular Catch-Up – your ultimate hub for everything Angular! "
5151
},
5252
{
53-
"name": "Angular Japan User Group | Angular 日本ユーザー会",
53+
"name": "Angular Japan User Group",
5454
"url": "https://www.youtube.com/@ng_japan",
5555
"logo": "assets/logos/ng-jp.svg",
5656
"language": "Japanese",

src/app/components/cards/podcast-card.ts

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { Podcast } from '../../../models/podcast.model';
66
changeDetection: ChangeDetectionStrategy.OnPush,
77
template: `
88
<article
9-
class="bg-gradient-to-br from-purple-900 to-purple-800 rounded-2xl p-6 text-white shadow-lg h-full"
9+
class="rounded-2xl drop-shadow-xl p-6 bg-white h-full flex flex-col gap-4"
1010
>
11-
<div class="flex items-start gap-4 mb-4">
11+
<div class="flex items-start gap-4">
1212
<img
1313
class="rounded-xl flex-shrink-0"
1414
[src]="podcast().logo"
@@ -19,13 +19,13 @@ import { Podcast } from '../../../models/podcast.model';
1919
<div class="flex-1 min-w-0">
2020
<h3
2121
[attr.id]="podcast().name"
22-
class="text-xl font-bold text-white mb-1"
22+
class="text-lg font-bold mb-1"
2323
itemprop="title"
2424
>
2525
{{ podcast().name }}
2626
</h3>
2727
<span
28-
class="inline-flex items-center justify-center gap-1 bg-purple-800/50 border-purple-600 border rounded px-2 py-1 text-xs text-purple-200"
28+
class="inline-flex items-center justify-center gap-1 bg-gray-100 rounded px-2 py-1 text-xs"
2929
>
3030
<i class="pi pi-language text-xs" aria-hidden="true"></i>
3131
{{
@@ -35,27 +35,21 @@ import { Podcast } from '../../../models/podcast.model';
3535
</div>
3636
</div>
3737
38-
<p class="text-purple-100 text-sm mb-4 leading-relaxed">
38+
<p class="text-sm leading-relaxed flex-1">
3939
A weekly podcast dedicated to the Angular JavaScript framework and
4040
related technologies.
4141
</p>
4242
43-
<button
44-
class="flex items-center justify-between w-full text-left group"
45-
(click)="openPodcast($event)"
43+
<a
44+
[href]="podcast().url"
45+
class="flex items-center justify-between w-full hover:text-purple-100"
46+
target="_blank"
4647
>
4748
<div class="flex items-center gap-3">
48-
<div
49-
class="w-8 h-8 bg-purple-600 rounded-full flex items-center justify-center group-hover:bg-purple-500 transition-colors"
50-
>
51-
<i class="pi pi-play text-white text-xs"></i>
52-
</div>
53-
<span
54-
class="font-medium text-purple-100 group-hover:text-white transition-colors"
55-
>Listen Now</span
56-
>
49+
<i class="pi pi-play-circle text-purple-600 text-2xl"></i>
50+
<span class="font-medium text-purple-600">Listen Now</span>
5751
</div>
58-
</button>
52+
</a>
5953
</article>
6054
`,
6155
styles: [
@@ -70,9 +64,4 @@ import { Podcast } from '../../../models/podcast.model';
7064
})
7165
export class PodcastCard {
7266
podcast = input.required<Podcast>();
73-
74-
openPodcast(event: Event) {
75-
event.preventDefault();
76-
globalThis.window?.open(this.podcast().url, '_blank');
77-
}
7867
}

src/app/components/navigation/navigation.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<nav class="px-8 py-2 flex items-center justify-between">
22
<a class="flex items-center gap-4" routerLink="/">
3-
<img class="h-12" src="/assets/images/logo.webp" alt="" />
3+
<img class="h-8 lg:h-12" src="/assets/images/logo.webp" alt="" />
44
<div class="flex flex-col">
5-
<span class="title text-3xl">ANGULAR HUB</span>
6-
<span class="text-sm text-gray-500">
5+
<span class="title text-3xl flex items-center gap-2">
6+
<span class="hidden md:block">ANGULAR</span>
7+
<span>HUB</span>
8+
</span>
9+
<span class="hidden lg:block text-sm text-gray-500">
710
The Angular community hub for events, communities, and podcasts
811
</span>
912
</div>
@@ -14,32 +17,32 @@
1417
<li>
1518
<a
1619
class="flex gap-4 items-center px-4 py-3 rounded-xl"
17-
[routerLinkActive]="['bg-pink-200', 'text-pink-700']"
20+
[routerLinkActive]="['bg-purple-200', 'text-purple-700']"
1821
[routerLinkActiveOptions]="{ exact: true }"
1922
routerLink="/"
2023
>
2124
<i aria-hidden="true" class="pi pi-calendar text-2xl"></i>
22-
Events
25+
<span class="hidden md:block">Events</span>
2326
</a>
2427
</li>
2528
<li>
2629
<a
2730
class="flex gap-4 items-center px-4 py-3 rounded-xl"
28-
[routerLinkActive]="['bg-pink-200', 'text-pink-700']"
31+
[routerLinkActive]="['bg-purple-200', 'text-purple-700']"
2932
routerLink="/communities"
3033
>
3134
<i aria-hidden="true" class="pi pi-users text-2xl"></i>
32-
Communities
35+
<span class="hidden md:block"> Communities </span>
3336
</a>
3437
</li>
3538
<li>
3639
<a
3740
class="flex gap-4 items-center px-4 py-3 rounded-xl"
38-
[routerLinkActive]="['bg-pink-200', 'text-pink-700']"
41+
[routerLinkActive]="['bg-purple-200', 'text-purple-700']"
3942
routerLink="/podcasts"
4043
>
4144
<i aria-hidden="true" class="pi pi-microphone text-2xl"></i>
42-
Podcasts
45+
<span class="hidden md:block"> Podcasts </span>
4346
</a>
4447
</li>
4548
</ul>

src/app/pages/communities-page.ts

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, inject } from '@angular/core';
1+
import { Component, computed, inject, signal } from '@angular/core';
22
import { CommunityCard } from '../components/cards/community-card';
33
import { Title } from '@angular/platform-browser';
44
import { JsonLdService } from '../services/json-ld.service';
@@ -19,51 +19,44 @@ export const routeMeta = {
1919
@Component({
2020
imports: [CommunityCard, FormsModule],
2121
template: `
22-
<section class="max-w-screen-xl mx-auto">
22+
<section class="max-w-screen-xl mx-auto px-6 lg:px-0">
2323
<input
2424
class="w-full p-2 rounded-lg border-2 border-gray-300"
2525
type="search"
2626
placeholder="Search communities"
27+
[(ngModel)]="search"
2728
/>
2829
<ul class="grid grid-cols-1 lg:grid-cols-3 gap-6 mt-6">
29-
@for (community of communities(); track community) {
30+
@for (community of filteredCommunities(); track community) {
3031
<li>
31-
<app-community-card
32-
class="h-full"
33-
[community]="community"
34-
></app-community-card>
32+
<app-community-card class="h-full" [community]="community" />
3533
</li>
3634
}
37-
<!--
38-
@for (community of communitiesWithUpcomingEvents(); track community) {
39-
<li>
40-
<app-community-card [community]="community"></app-community-card>
41-
</li>
42-
}
43-
@for (community of activeCommunities(); track community) {
44-
<li>
45-
<app-community-card [community]="community"></app-community-card>
46-
</li>
47-
}
48-
@for (community of inactiveCommunities(); track community) {
49-
<li>
50-
<app-community-card [community]="community"></app-community-card>
51-
</li>
52-
}
53-
-->
5435
</ul>
5536
</section>
5637
`,
5738
})
5839
export default class CommunitiesPage {
59-
// TODO /api/v1/communities
40+
search = signal('');
41+
6042
communities = toSignal(
6143
inject(HttpClient).get<Community[]>('/api/v1/communities'),
6244
{
6345
initialValue: [],
6446
},
6547
);
6648

49+
filteredCommunities = computed(() =>
50+
this.communities().filter(
51+
(community) =>
52+
community.name?.toLowerCase().includes(this.search().toLowerCase()) ||
53+
community.location
54+
?.toLowerCase()
55+
.includes(this.search().toLowerCase()) ||
56+
community.type?.toLowerCase().includes(this.search().toLowerCase()),
57+
),
58+
);
59+
6760
/*
6861
6962
communitiesWithUpcomingEvents = computed(() =>

src/app/pages/events-page.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const routeMeta = {
3939

4040
@Component({
4141
template: `
42-
<section class="max-w-screen-xl w-full mx-auto">
42+
<section class="max-w-screen-xl w-full mx-auto px-6 lg:px-0">
4343
<input
4444
class="w-full p-2 rounded-lg border-2 border-gray-300"
4545
type="search"
@@ -103,8 +103,13 @@ export default class EventsPage {
103103
);
104104

105105
filteredEvents = computed(() => {
106-
return this.events().filter((event) =>
107-
event.name?.toLowerCase().includes(this.search().toLowerCase()),
106+
return this.events().filter(
107+
(event) =>
108+
event.name?.toLowerCase().includes(this.search().toLowerCase()) ||
109+
event.location?.toLowerCase().includes(this.search().toLowerCase()) ||
110+
event.organizer?.name
111+
?.toLowerCase()
112+
.includes(this.search().toLowerCase()),
108113
);
109114
});
110115

src/app/pages/podcasts-page.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@ export const routeMeta = {
2020
};
2121

2222
@Component({
23-
imports: [PodcastCard, FormsModule, Banner],
23+
imports: [PodcastCard, FormsModule],
2424
template: `
25-
<app-banner description="Curated list of Angular Podcasts" />
26-
<ul
27-
class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 justify-center gap-x-8 gap-y-4 px-8"
28-
>
29-
@for (podcast of podcasts(); track podcast.name) {
30-
<li>
31-
<app-podcast-card [podcast]="podcast"></app-podcast-card>
32-
</li>
33-
}
34-
</ul>
25+
<section class="max-w-screen-xl w-full mx-auto px-6 lg:px-0">
26+
<ul class="grid grid-cols-1 lg:grid-cols-3 gap-6 mt-6">
27+
@for (podcast of podcasts(); track podcast.name) {
28+
<li>
29+
<app-podcast-card [podcast]="podcast" />
30+
</li>
31+
}
32+
</ul>
33+
</section>
3534
`,
3635
})
3736
export default class PodcastsPage {

0 commit comments

Comments
 (0)