MetacaseForm

This commit is contained in:
2026-03-14 20:31:10 +00:00
parent 057717b0b7
commit 9bebe1de72
68 changed files with 3930 additions and 15 deletions
+21 -1
View File
@@ -1,3 +1,23 @@
import { Routes } from '@angular/router';
import { Formacaometacase } from './formacaometacase/formacaometacase';
import { CourseDetailPageComponent } from './course-detail-page/course-detail-page';
import { CourseLearningPageComponent } from './course-learning-page/course-learning-page';
export const routes: Routes = [];
export const routes: Routes = [
{
path: '',
component: Formacaometacase
},
{
path: 'cursos/:slug',
component: CourseDetailPageComponent
},
{
path: 'cursos/:slug/percurso',
component: CourseLearningPageComponent
},
{
path: '**',
redirectTo: ''
}
];
+3 -7
View File
@@ -1,10 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { App } from './app';
import { routes } from './app.routes';
describe('App', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [App],
providers: [provideRouter(routes)]
}).compileComponents();
});
@@ -13,11 +16,4 @@ describe('App', () => {
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it('should render title', async () => {
const fixture = TestBed.createComponent(App);
await fixture.whenStable();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, form_metacase');
});
});
+3 -4
View File
@@ -1,12 +1,11 @@
import { Component, signal } from '@angular/core';
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.html',
styleUrl: './app.css'
template: `<router-outlet></router-outlet>`
})
export class App {
protected readonly title = signal('form_metacase');
}
@@ -0,0 +1,527 @@
:host {
display: block;
min-height: 100vh;
background: #f8fafc;
color: #0f172a;
}
* {
box-sizing: border-box;
}
.course-detail-page {
min-height: 100vh;
}
.course-intro {
background:
radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 24%),
linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
border-bottom: 1px solid #e2e8f0;
}
.course-intro__inner {
display: grid;
grid-template-columns: minmax(0, 1.55fr) minmax(320px, 420px);
gap: 34px;
max-width: 1240px;
margin: 0 auto;
padding: 56px 24px 40px;
}
.course-intro__main {
padding-top: 12px;
}
.back-link {
display: inline-flex;
align-items: center;
margin-bottom: 20px;
color: #2563eb;
text-decoration: none;
font-weight: 700;
}
.back-link:hover {
color: #1d4ed8;
}
.intro-pills {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 18px;
}
.intro-pill {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 34px;
padding: 0 14px;
border-radius: 999px;
background: #dbeafe;
color: #1d4ed8;
font-size: 0.86rem;
font-weight: 800;
}
.intro-pill--muted {
background: #eff6ff;
color: #334155;
}
.course-intro h1 {
max-width: 760px;
margin: 0 0 16px;
font-size: clamp(2.4rem, 5vw, 4rem);
line-height: 1.04;
letter-spacing: -0.03em;
}
.lesson-image {
display: block;
margin: 30px auto;
max-width: 600px;
width: 100%;
}
.intro-summary {
max-width: 760px;
margin: 0 0 24px;
color: #475569;
font-size: 1.06rem;
line-height: 1.75;
text-align: justify;
}
.intro-stats {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14px;
max-width: 720px;
margin-bottom: 20px;
}
.intro-stat {
padding: 18px 18px 16px;
border: 1px solid #dbe4f0;
border-radius: 22px;
background: #ffffff;
}
.intro-stat span {
display: block;
margin-bottom: 8px;
color: #64748b;
font-size: 0.8rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.intro-stat strong {
font-size: 1rem;
}
.intro-icons {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.intro-icons__item {
width: auto;
height: 28px;
}
.enroll-card {
overflow: hidden;
border: 1px solid #dbe4f0;
border-radius: 28px;
background: #ffffff;
box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
.enroll-card__media {
aspect-ratio: 16 / 10;
overflow: hidden;
background: #0f172a;
}
.enroll-card__media img {
width: 100%;
height: 100%;
object-fit: cover;
}
.enroll-card__body {
padding: 22px;
}
.enroll-card__topline {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 14px;
}
.enroll-card__topline span {
display: inline-flex;
padding: 7px 11px;
border-radius: 999px;
background: #eff6ff;
color: #1d4ed8;
font-size: 0.8rem;
font-weight: 800;
}
.enroll-card h2 {
margin: 0 0 10px;
font-size: 1.55rem;
}
.enroll-card p {
margin: 0 0 18px;
color: #64748b;
line-height: 1.65;
}
.detail-tabs {
position: sticky;
top: 0;
z-index: 20;
display: flex;
gap: 28px;
max-width: 1240px;
margin: 0 auto;
padding: 0 24px;
background: rgba(248, 250, 252, 0.94);
backdrop-filter: blur(12px);
border-bottom: 1px solid #e2e8f0;
}
.detail-tabs a {
display: inline-flex;
align-items: center;
min-height: 62px;
color: #334155;
text-decoration: none;
font-weight: 800;
border-bottom: 3px solid transparent;
}
.detail-tabs a:hover {
color: #0f172a;
border-bottom-color: #2563eb;
}
.detail-layout {
display: grid;
grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
gap: 30px;
max-width: 1240px;
margin: 0 auto;
padding: 28px 24px 72px;
}
.detail-main {
display: flex;
flex-direction: column;
gap: 22px;
}
.detail-panel,
.sidebar-card,
.course-not-found__card {
border: 1px solid #dbe4f0;
border-radius: 28px;
background: #ffffff;
box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}
.detail-panel {
padding: 28px;
}
.panel-header {
margin-bottom: 18px;
}
.panel-header--split {
display: flex;
align-items: end;
justify-content: space-between;
gap: 16px;
}
.panel-header__eyebrow,
.sidebar-card__eyebrow {
display: inline-flex;
margin-bottom: 10px;
color: #2563eb;
font-size: 1.2rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.panel-header h2 {
margin: 0;
font-size: 1.7rem;
line-height: 1.2;
}
.panel-count {
display: inline-flex;
padding: 8px 12px;
border-radius: 999px;
background: #eff6ff;
color: #1d4ed8;
font-size: 0.82rem;
font-weight: 800;
white-space: nowrap;
}
.detail-lead {
margin: 0 0 18px;
color: #475569;
line-height: 1.75;
}
.detail-facts {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14px;
margin-bottom: 18px;
}
.detail-facts article,
.detail-box {
padding: 18px;
border: 1px solid #e5edf6;
border-radius: 22px;
background: #fbfdff;
}
.detail-facts span {
display: block;
margin-bottom: 8px;
color: #64748b;
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.detail-columns {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 16px;
}
.detail-box h3,
.learning-card h3,
.module-card__content h3 {
margin: 0 0 10px;
font-size: 1.08rem;
}
.bullet-list,
.sidebar-list {
margin: 0;
padding-left: 18px;
color: #475569;
line-height: 1.75;
}
.bullet-list li + li,
.sidebar-list li + li {
margin-top: 8px;
}
.learning-grid {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 16px;
}
.learning-card {
padding: 20px;
border: 1px solid #e5edf6;
border-radius: 22px;
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.learning-card p,
.module-card__content p {
margin: 0;
color: #64748b;
line-height: 1.65;
}
.module-list {
display: flex;
flex-direction: column;
gap: 14px;
}
.module-card {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 16px;
align-items: start;
padding: 20px;
border: 1px solid #e5edf6;
border-radius: 24px;
background: #ffffff;
}
.module-card__index {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 14px;
background: #eff6ff;
color: #1d4ed8;
font-weight: 800;
}
.module-card__duration {
display: inline-flex;
padding: 8px 11px;
border-radius: 999px;
background: #f1f5f9;
color: #334155;
font-size: 0.82rem;
font-weight: 800;
white-space: nowrap;
}
.sidebar-card {
position: sticky;
top: 92px;
padding: 24px;
}
.sidebar-list {
margin-bottom: 18px;
}
.sidebar-tags {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.sidebar-tags span {
display: inline-flex;
padding: 8px 12px;
border-radius: 999px;
background: #eff6ff;
color: #1d4ed8;
font-size: 0.84rem;
font-weight: 700;
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 50px;
border: 0;
border-radius: 18px;
background: #1d4ed8;
color: #ffffff;
text-decoration: none;
font-size: 0.96rem;
font-weight: 800;
cursor: pointer;
}
.button + .button {
margin-top: 12px;
}
.button--secondary {
background: #eff6ff;
color: #1d4ed8;
}
.course-not-found {
min-height: 100vh;
display: grid;
place-items: center;
padding: 24px;
}
.course-not-found__card {
max-width: 520px;
padding: 32px;
text-align: center;
}
.course-not-found__card h1 {
margin: 0 0 12px;
}
.course-not-found__card p {
margin: 0 0 20px;
color: #64748b;
}
@media (max-width: 1024px) {
.course-intro__inner,
.detail-layout {
grid-template-columns: 1fr;
}
.sidebar-card {
position: static;
}
}
@media (max-width: 768px) {
.course-intro__inner {
padding: 40px 20px 28px;
}
.detail-tabs {
gap: 18px;
overflow-x: auto;
padding: 0 20px;
}
.detail-layout {
padding: 22px 20px 56px;
}
.intro-stats,
.detail-facts,
.detail-columns,
.learning-grid {
grid-template-columns: 1fr;
}
.detail-panel,
.sidebar-card,
.course-not-found__card {
border-radius: 22px;
}
.detail-panel {
padding: 22px;
}
.panel-header--split,
.module-card {
grid-template-columns: 1fr;
}
.module-card__duration {
justify-self: start;
}
}
@@ -0,0 +1,121 @@
<ng-container *ngIf="course() as course; else notFound">
<div class="course-detail-page">
<section class="course-intro">
<div class="course-intro__inner">
<div class="course-intro__main">
<a routerLink="/" class="back-link">Voltar ao menu das formações</a>
<h1>{{ course.title }}</h1>
<p class="intro-summary">{{ course.summary }}</p>
<section id="overview" class="detail-panel">
<div class="panel-header">
<span class="panel-header__eyebrow">Informação geral da formação</span>
<p class="detail-lead">{{ course.description }}</p>
</div>
<div class="detail-facts">
<article>
<span>Idioma</span>
<strong>{{ course.language }}</strong>
</article>
<article>
<span>Formato</span>
<strong>{{ course.format }}</strong>
</article>
<article class="intro-stat">
<span>Duração</span>
<strong>{{ course.duration }}</strong>
</article>
<article class="intro-stat">
<span>Modú los</span>
<strong>{{ course.modules.length }}</strong>
</article>
<div class="detail-box">
<span>Pré-requisitos</span>
<ul class="bullet-list">
<li *ngFor="let item of course.prerequisites">{{ item }}</li>
</ul>
</div>
<div class="detail-box">
<span>Público-Alvo</span>
<ul class="bullet-list">
<li *ngFor="let item of course.audience">{{ item }}</li>
</ul>
</div>
</div>
</section>
</div>
<aside class="enroll-card">
<div class="enroll-card__media">
<img
[src]="course.image"
[alt]="course.title"
/>
</div>
<div class="enroll-card__body">
<h2>Começar esta formação</h2>
<p>{{ course.description }}</p>
<a [routerLink]="['/cursos', course.slug, 'percurso']" class="button">Iniciar formação</a>
<a routerLink="/" class="button button--secondary">Voltar ao menu das formações</a>
</div>
</aside>
</div>
</section>
<main class="detail-layout">
<section class="detail-main">
<section id="structure" class="detail-panel">
<div class="panel-header panel-header--split">
<div>
<span class="panel-header__eyebrow">Estrutura da formação</span>
</div>
<span class="panel-count">{{ course.modules.length }} lições</span>
</div>
<div class="module-list">
<article
*ngFor="let module of course.modules; let index = index"
class="module-card"
>
<div class="module-card__index">{{ index + 1 }}</div>
<div class="module-card__content">
<h3>{{ module.title }}</h3>
<p>{{ module.description }}</p>
</div>
<span class="module-card__duration">{{ module.duration }}</span>
</article>
</div>
</section>
</section>
<aside class="detail-sidebar">
<div class="sidebar-card">
<span class="sidebar-card__eyebrow">Competências da Formação</span>
<div class="learning-grid">
<article *ngFor="let item of course.objectives" class="topic-card">
<h3>{{ item }}</h3>
</article>
</div>
</div>
</aside>
</main>
</div>
</ng-container>
<ng-template #notFound>
<div class="course-not-found">
<div class="course-not-found__card">
<h1>Formação não encontrada</h1>
<p>A formação selecionada não está disponível neste momento.</p>
<a routerLink="/" class="button">Voltar aos cursos</a>
</div>
</div>
</ng-template>
@@ -0,0 +1,22 @@
import { CommonModule } from '@angular/common';
import { Component, computed, inject } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { getCourseBySlug } from '../data/courses';
@Component({
selector: 'app-course-detail-page',
standalone: true,
imports: [CommonModule, RouterLink],
templateUrl: './course-detail-page.html',
styleUrl: './course-detail-page.css'
})
export class CourseDetailPageComponent {
private readonly route = inject(ActivatedRoute);
private readonly paramMap = toSignal(this.route.paramMap);
readonly course = computed(() => {
const slug = this.paramMap()?.get('slug') ?? null;
return getCourseBySlug(slug);
});
}
@@ -0,0 +1,740 @@
:host {
display: block;
min-height: 100vh;
background: #f8fafc;
color: #0f172a;
}
* {
box-sizing: border-box;
}
.learning-page {
min-height: 100vh;
}
.learning-header {
border-bottom: 1px solid #e2e8f0;
background:
radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.learning-header__inner {
display: flex;
align-items: end;
justify-content: space-between;
gap: 24px;
max-width: 1280px;
margin: 0 auto;
padding: 40px 24px 28px;
}
.back-link {
display: inline-flex;
margin-bottom: 18px;
color: #2563eb;
text-decoration: none;
font-weight: 700;
}
.course-kicker {
margin: 0 0 10px;
color: #2563eb;
font-size: 0.82rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.learning-header h1 {
margin: 0;
font-size: clamp(2.2rem, 4vw, 3.6rem);
line-height: 1.06;
letter-spacing: -0.03em;
}
.progress-card {
min-width: 260px;
padding: 18px 20px;
border: 1px solid #dbe4f0;
border-radius: 24px;
background: #ffffff;
box-shadow: 0 16px 30px rgba(15, 23, 42, 0.05);
}
.progress-card__label {
display: block;
margin-bottom: 8px;
color: #64748b;
font-size: 0.8rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.progress-card strong {
display: block;
margin-bottom: 14px;
font-size: 1rem;
}
.progress-bar {
height: 8px;
border-radius: 999px;
background: #e2e8f0;
overflow: hidden;
}
.progress-bar span {
display: block;
width: 24%;
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%);
}
.learning-layout {
display: grid;
grid-template-columns: 320px minmax(0, 1fr);
gap: 28px;
max-width: 1280px;
margin: 0 auto;
padding: 28px 24px 64px;
}
.learning-sidebar {
position: relative;
}
.sidebar-panel,
.content-panel,
.course-not-found__card {
border: 1px solid #dbe4f0;
border-radius: 28px;
background: #ffffff;
box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}
.sidebar-panel {
position: sticky;
top: 24px;
padding: 22px;
}
.sidebar-panel__top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 18px;
}
.sidebar-panel__eyebrow {
color: #2563eb;
font-size: 0.78rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.module-nav {
display: flex;
flex-direction: column;
gap: 12px;
}
.module-nav__item {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
padding: 0;
border: 1px solid #e5edf6;
border-radius: 20px;
background: #f8fafc;
}
.module-nav__trigger {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 12px;
width: 100%;
padding: 14px;
border: 0;
border-radius: inherit;
background: transparent;
text-align: left;
cursor: pointer;
}
.module-nav__item--active {
border-color: #bfdbfe;
background: #eff6ff;
}
.module-nav__index {
display: inline-flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
border-radius: 12px;
background: #ffffff;
color: #1d4ed8;
font-weight: 800;
}
.module-nav__content h3 {
margin: 0 0 6px;
font-size: 0.98rem;
}
.module-nav__content p {
margin: 0;
color: #64748b;
font-size: 0.9rem;
}
.learning-main {
display: flex;
flex-direction: column;
gap: 22px;
}
.content-panel {
padding: 28px;
}
.content-panel__header {
display: flex;
align-items: end;
justify-content: space-between;
gap: 18px;
margin-bottom: 18px;
}
.content-panel__eyebrow {
display: inline-flex;
margin-bottom: 10px;
color: #2563eb;
font-size: 0.78rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.content-panel__header h2 {
margin: 0;
font-size: 1.8rem;
line-height: 1.15;
}
.lesson-duration {
display: inline-flex;
padding: 8px 12px;
border-radius: 999px;
background: #eff6ff;
color: #1d4ed8;
font-size: 0.84rem;
font-weight: 800;
white-space: nowrap;
}
.content-intro {
margin: 0 0 18px;
color: #475569;
line-height: 1.75;
white-space: pre-line;
text-align: justify
}
.resource-download-card {
display: flex;
align-items: center;
gap: 16px;
margin: 0 0 22px;
padding: 18px 20px;
border: 1px solid #bfdbfe;
border-radius: 22px;
background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
color: inherit;
text-decoration: none;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.resource-download-card:hover {
transform: translateY(-1px);
border-color: #60a5fa;
box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}
.resource-download-card__icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 56px;
width: 56px;
height: 56px;
border-radius: 18px;
background: #dbeafe;
color: #1d4ed8;
}
.resource-download-card__icon svg {
width: 28px;
height: 28px;
fill: none;
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 1.8;
}
.resource-download-card__content {
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.resource-download-card__eyebrow {
color: #2563eb;
font-size: 0.78rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.resource-download-card__content strong {
font-size: 1rem;
}
.resource-download-card__content span:last-child {
color: #64748b;
line-height: 1.5;
}
.resource-download-card__action {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 42px;
padding: 0 16px;
border-radius: 999px;
background: #1d4ed8;
color: #ffffff;
font-size: 0.88rem;
font-weight: 800;
white-space: nowrap;
}
.course-topics {
margin: 0 0 18px;
color: #475569;
line-height: 1.75;
text-align: justify;
padding-left: 20px;
}
.course-topics li {
margin-bottom: 6px;
}
.course-topics li::before {
content: "✓";
color: #475569;
margin: 0 0 18px;
}
.content-icons {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 22px;
}
.content-icons__item {
width: auto;
height: 26px;
}
.lesson-section + .lesson-section {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #e5edf6;
}
.module-sequence {
display: flex;
flex-direction: column;
gap: 18px;
}
.learning-module {
scroll-margin-top: 28px;
padding: 20px;
border: 1px solid #e5edf6;
border-radius: 24px;
background: #ffffff;
}
.learning-module__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.module-description {
margin: 0 0 14px;
color: #475569;
line-height: 1.7;
}
.lesson-section h3,
.question-card h3 {
margin: 0 0 10px;
font-size: 1.16rem;
}
.lesson-section p,
.question-note {
margin: 0;
color: #64748b;
line-height: 1.75;
text-align: justify;
white-space: pre-line;
}
.lesson-section p + p {
margin-top: 12px;
}
.lesson-image {
display: block;
width: min(100%, 860px);
margin: 18px auto;
border-radius: 18px;
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
cursor: zoom-in;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lesson-image:hover {
transform: scale(1.01);
box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}
.presentation-viewer {
margin-top: 24px;
padding: 22px;
border: 1px solid #dbe4f0;
border-radius: 24px;
background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.presentation-viewer__header {
display: flex;
align-items: end;
justify-content: space-between;
gap: 16px;
margin-bottom: 16px;
}
.presentation-viewer__header h3 {
margin: 0;
font-size: 1.12rem;
}
.presentation-viewer__counter,
.image-lightbox__counter {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 40px;
padding: 0 14px;
border-radius: 999px;
background: #dbeafe;
color: #1d4ed8;
font-size: 0.82rem;
font-weight: 800;
white-space: nowrap;
}
.presentation-viewer__stage {
overflow: hidden;
border-radius: 20px;
background: #0f172a;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.presentation-viewer__slide {
display: block;
width: 100%;
aspect-ratio: 16 / 9;
object-fit: contain;
background: #0f172a;
cursor: zoom-in;
}
.presentation-viewer__actions {
display: flex;
justify-content: flex-end;
gap: 12px;
margin-top: 16px;
}
.presentation-viewer__button {
min-height: 44px;
padding: 0 18px;
border: 0;
border-radius: 14px;
background: #1d4ed8;
color: #ffffff;
font-size: 0.9rem;
font-weight: 800;
cursor: pointer;
}
.presentation-viewer__button:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.image-lightbox {
position: fixed;
inset: 0;
z-index: 1000;
display: grid;
place-items: center;
padding: 24px;
background: rgba(15, 23, 42, 0.82);
backdrop-filter: blur(6px);
}
.image-lightbox__dialog {
position: relative;
max-width: min(1200px, 100%);
max-height: 100%;
}
.image-lightbox__toolbar {
position: absolute;
top: -12px;
right: -12px;
z-index: 1;
display: flex;
align-items: center;
gap: 8px;
}
.image-lightbox__action,
.image-lightbox__close {
min-width: 48px;
min-height: 40px;
padding: 0 14px;
border: 0;
border-radius: 999px;
background: #ffffff;
color: #0f172a;
font-size: 0.86rem;
font-weight: 800;
cursor: pointer;
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}
.image-lightbox__close {
min-width: 96px;
}
.image-lightbox__viewport {
overflow: auto;
max-width: min(1200px, calc(100vw - 48px));
max-height: calc(100vh - 48px);
border-radius: 20px;
cursor: zoom-in;
}
.image-lightbox__image {
display: block;
max-width: min(1200px, calc(100vw - 48px));
max-height: calc(100vh - 48px);
border-radius: 20px;
box-shadow: 0 28px 70px rgba(15, 23, 42, 0.35);
transition: transform 0.18s ease;
user-select: none;
}
.question-list {
display: flex;
flex-direction: column;
gap: 16px;
}
.question-card {
padding: 20px;
border: 1px solid #e5edf6;
border-radius: 24px;
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.question-card__number {
display: inline-flex;
margin-bottom: 12px;
color: #2563eb;
font-size: 0.78rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.question-options {
display: grid;
gap: 10px;
margin: 16px 0 14px;
}
.question-option {
min-height: 50px;
border: 1px solid #dbe4f0;
border-radius: 16px;
background: #ffffff;
color: #0f172a;
font-size: 0.95rem;
font-weight: 700;
text-align: left;
padding: 0 16px;
cursor: pointer;
}
.question-option:hover {
border-color: #93c5fd;
background: #f8fbff;
}
.question-option:disabled {
opacity: 1;
cursor: default;
}
.question-option.question-option--correct {
border-color: #16a34a;
background: #dcfce7;
color: #166534;
}
.question-option.question-option--incorrect {
border-color: #dc2626;
background: #fee2e2;
color: #991b1b;
}
.lesson-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 180px;
min-height: 50px;
padding: 0 20px;
border: 0;
border-radius: 18px;
background: #1d4ed8;
color: #ffffff;
text-decoration: none;
font-size: 0.96rem;
font-weight: 800;
cursor: pointer;
}
.button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.button--secondary {
background: #eff6ff;
color: #1d4ed8;
}
.course-not-found {
min-height: 100vh;
display: grid;
place-items: center;
padding: 24px;
}
.course-not-found__card {
max-width: 520px;
padding: 32px;
text-align: center;
}
.course-not-found__card h1 {
margin: 0 0 12px;
}
.course-not-found__card p {
margin: 0 0 20px;
color: #64748b;
}
@media (max-width: 1024px) {
.learning-header__inner,
.learning-layout {
grid-template-columns: 1fr;
display: grid;
}
.progress-card,
.sidebar-panel {
position: static;
}
}
@media (max-width: 768px) {
.learning-header__inner,
.learning-layout {
padding-left: 20px;
padding-right: 20px;
}
.learning-header__inner {
padding-top: 32px;
padding-bottom: 24px;
}
.content-panel,
.sidebar-panel,
.course-not-found__card {
border-radius: 22px;
}
.content-panel {
padding: 22px;
}
.content-panel__header,
.lesson-actions,
.presentation-viewer__header,
.presentation-viewer__actions {
flex-direction: column;
align-items: stretch;
}
.resource-download-card {
align-items: flex-start;
flex-direction: column;
}
.resource-download-card__action {
width: 100%;
}
}
@@ -0,0 +1,289 @@
<ng-container *ngIf="course() as course; else notFound">
<div class="learning-page">
<header class="learning-header">
<div class="learning-header__inner">
<div>
<a [routerLink]="['/cursos', course.slug]" class="back-link">Voltar aos detalhes do curso</a>
<p class="course-kicker" style="display:none">{{ course.category }}</p>
<h1>{{ course.title }}</h1>
</div>
</div>
</header>
<main class="learning-layout">
<aside class="learning-sidebar">
<div class="sidebar-panel">
<div class="sidebar-panel__top">
<span class="sidebar-panel__eyebrow">Conteúdo da Formação</span>
<strong>{{ course.modules.length }} módulos</strong>
</div>
<div class="module-nav">
<article
*ngFor="let module of course.modules; let index = index"
class="module-nav__item"
[class.module-nav__item--active]="index === currentModuleIndex()"
>
<button type="button" class="module-nav__trigger" (click)="scrollToModule(index)">
<span class="module-nav__index">{{ index + 1 }}</span>
<div class="module-nav__content">
<h3>{{ module.title }}</h3>
<p>{{ module.duration }}</p>
</div>
</button>
</article>
<div class="progress-card">
<span class="progress-card__label">Progressão atual</span>
<strong>{{ progressLabel() }}</strong>
<div class="progress-bar">
<span [style.width.%]="progressPercentage()"></span>
</div>
</div>
</div>
</div>
</aside>
<section class="learning-main">
<div class="content-panel">
<div class="content-panel__header">
<div>
<span class="content-panel__eyebrow">Percurso da Formação</span>
<h2>Contextualização</h2>
</div>
</div>
<p class="content-intro">{{ course.summary }}</p>
<ul class="course-topics">
<li *ngFor="let topic of course.topics">{{ topic }}</li>
</ul>
<section class="module-sequence">
<article
*ngFor="let item of modulesWithSections(); let index = index"
class="learning-module"
[attr.data-module-index]="index"
>
<div class="learning-module__header">
<span class="question-card__number">Módulo {{ index + 1 + " " + item.module.title }}</span>
<span class="lesson-duration">{{ item.module.duration }}</span>
</div>
<section class="lesson-section" *ngIf="item.section as section">
<p *ngFor="let paragraph of section.paragraphs" [innerHTML]="paragraph"> </p>
<ul class="course-topics" *ngIf="section.bullets">
<li *ngFor="let bullet of section.bullets">
{{ bullet }}
</li>
</ul>
<p *ngFor="let paragraph of section.paragraphs2" [innerHTML]="paragraph"> </p>
<img
*ngIf="section.imagem && section.imagem.trim() !== ''"
[src]="section.imagem"
class="lesson-image"
alt="Imagem da secao"
(click)="openZoomedImage(section.imagem)"
>
<p *ngFor="let paragraph of section.paragraphs3" [innerHTML]="paragraph"> </p>
<ul class="course-topics" *ngIf="section.bullets2">
<li *ngFor="let bullet of section.bullets2">
{{ bullet }}
</li>
</ul>
<p *ngFor="let paragraph of section.paragraphs4" [innerHTML]="paragraph"> </p>
<ul class="course-topics" *ngIf="section.bullets3">
<li *ngFor="let bullet of section.bullets3">
{{ bullet }}
</li>
</ul>
<p *ngFor="let paragraph of section.paragraphs5" [innerHTML]="paragraph"> </p>
<img
*ngIf="section.imagem2 && section.imagem2.trim() !== ''"
[src]="section.imagem2"
class="lesson-image"
alt="Imagem da secao"
(click)="openZoomedImage(section.imagem2)"
>
<p *ngFor="let paragraph of section.paragraphs6" [innerHTML]="paragraph"> </p>
<ul class="course-topics" *ngIf="section.bullets4">
<li *ngFor="let bullet of section.bullets4">
{{ bullet }}
</li>
</ul>
<img
*ngIf="section.imagem3 && section.imagem3.trim() !== ''"
[src]="section.imagem3"
class="lesson-image"
alt="Imagem da secao"
(click)="openZoomedImage(section.imagem3)"
>
<section class="presentation-viewer" *ngIf="section.presentationImages?.length">
<div class="presentation-viewer__header">
<div>
<span class="content-panel__eyebrow">Apresentação interativa</span>
</div>
<span class="presentation-viewer__counter">
Imagem {{ getPresentationImageIndex(index) + 1 }} / {{ section.presentationImages!.length }}
</span>
</div>
<div class="presentation-viewer__stage">
<img
[src]="getPresentationImage(index, section.presentationImages!)"
class="presentation-viewer__slide"
alt="Imagem da apresentacao"
(click)="openZoomedImageGallery(section.presentationImages!, getPresentationImageIndex(index))"
>
</div>
<div class="presentation-viewer__actions">
<button
type="button"
class="presentation-viewer__button"
[disabled]="getPresentationImageIndex(index) === 0"
(click)="previousPresentationImage(index)"
>
Anterior
</button>
<button
type="button"
class="presentation-viewer__button"
[disabled]="getPresentationImageIndex(index) >= section.presentationImages!.length - 1"
(click)="nextPresentationImage(index, section.presentationImages!)"
>
Seguinte
</button>
</div>
</section>
</section>
</article>
</section>
</div>
<a
*ngIf="course.pdfPath"
class="resource-download-card"
[href]="course.pdfPath"
[attr.download]="course.pdfDownloadName ?? ''"
[attr.aria-label]="'Descarregar ' + (course.pdfTitle ?? 'documento PDF')"
>
<span class="resource-download-card__icon" aria-hidden="true">
<svg viewBox="0 0 24 24" focusable="false">
<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" />
<path d="M14 3v5h5" />
<path d="M12 11v6" />
<path d="m9.5 14.5 2.5 2.5 2.5-2.5" />
</svg>
</span>
<span class="resource-download-card__content">
<strong>{{ course.pdfTitle ?? 'Documento PDF' }}</strong>
</span>
<span class="resource-download-card__action">Download</span>
</a>
<div class="content-panel">
<div class="content-panel__header">
<div>
<span class="content-panel__eyebrow">Validação de Conhecimentos</span>
</div>
</div>
<div class="question-list">
<article *ngFor="let question of visibleQuestions(); let index = index" class="question-card">
<span class="question-card__number">Pergunta {{ index + 1 }}</span>
<h3>{{ question.prompt }}</h3>
<div class="question-options">
<button
*ngFor="let option of question.options; let optionIndex = index"
type="button"
class="question-option"
[class.question-option--correct]="isCorrectOption(index, optionIndex)"
[class.question-option--incorrect]="isWrongSelectedOption(index, optionIndex)"
[disabled]="isQuestionAnswered(index)"
(click)="selectAnswer(index, optionIndex)"
>
{{ option }}
</button>
</div>
<p class="question-note">{{ question.note }}</p>
</article>
</div>
</div>
<div class="lesson-actions">
<a [routerLink]="['/cursos', course.slug]" class="button button--secondary">Voltar ao curso</a>
<button type="button" class="button" (click)="scrollToModule(0)">Voltar ao primeiro modulo</button>
</div>
</section>
</main>
</div>
</ng-container>
<div *ngIf="zoomedImageSrc() as zoomedImage" class="image-lightbox" (click)="closeZoomedImage()">
<div class="image-lightbox__dialog" (click)="$event.stopPropagation()">
<div class="image-lightbox__toolbar">
<button
*ngIf="zoomedImageSet().length > 1"
type="button"
class="image-lightbox__action"
[disabled]="zoomedImageIndex() === 0"
(click)="showPreviousZoomedImage()"
>
Anterior
</button>
<span *ngIf="zoomedImageSet().length > 1" class="image-lightbox__counter">
{{ zoomedImageIndex() + 1 }} / {{ zoomedImageSet().length }}
</span>
<button type="button" class="image-lightbox__action" (click)="zoomOutImage()">-</button>
<button type="button" class="image-lightbox__action" (click)="resetImageZoom()">100%</button>
<button type="button" class="image-lightbox__action" (click)="zoomInImage()">+</button>
<button
*ngIf="zoomedImageSet().length > 1"
type="button"
class="image-lightbox__action"
[disabled]="zoomedImageIndex() >= zoomedImageSet().length - 1"
(click)="showNextZoomedImage()"
>
Seguinte
</button>
<button type="button" class="image-lightbox__close" (click)="closeZoomedImage()">Fechar</button>
</div>
<div class="image-lightbox__viewport" (wheel)="handleImageZoomWheel($event, zoomedImageElement)">
<img
#zoomedImageElement
[src]="zoomedImage"
class="image-lightbox__image"
[style.transform]="'scale(' + zoomScale() + ')'"
[style.transform-origin]="zoomOrigin()"
alt="Imagem ampliada"
(click)="handleImageZoomClick($event, zoomedImageElement)"
>
</div>
</div>
</div>
<ng-template #notFound>
<div class="course-not-found">
<div class="course-not-found__card">
<h1>Percurso nao encontrado</h1>
<p>O percurso pedido nao esta disponivel neste momento.</p>
<a routerLink="/" class="button">Voltar aos cursos</a>
</div>
</div>
</ng-template>
@@ -0,0 +1,298 @@
import { CommonModule } from '@angular/common';
import { Component, HostListener, computed, effect, inject, signal } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { CourseQuestion, getCourseBySlug } from '../data/courses';
@Component({
selector: 'app-course-learning-page',
standalone: true,
imports: [CommonModule, RouterLink],
templateUrl: './course-learning-page.html',
styleUrl: './course-learning-page.css'
})
export class CourseLearningPageComponent {
private static readonly QUESTIONS_PER_SESSION = 5;
private static readonly MIN_ZOOM_SCALE = 1;
private static readonly MAX_ZOOM_SCALE = 3;
private static readonly ZOOM_STEP = 0.25;
private readonly route = inject(ActivatedRoute);
private readonly paramMap = toSignal(this.route.paramMap);
private readonly selectedAnswers = signal<Record<number, number>>({});
private readonly presentationImageIndexes = signal<Record<number, number>>({});
readonly visibleQuestions = signal<CourseQuestion[]>([]);
readonly currentModuleIndex = signal(0);
readonly zoomedImageSet = signal<string[]>([]);
readonly zoomedImageIndex = signal(0);
readonly zoomedImageSrc = computed(() => this.zoomedImageSet()[this.zoomedImageIndex()] ?? null);
readonly zoomScale = signal(1);
readonly zoomOrigin = signal('50% 50%');
private readonly resetAnswersOnCourseChange = effect(() => {
const slug = this.paramMap()?.get('slug') ?? null;
const course = getCourseBySlug(slug);
this.selectedAnswers.set({});
this.presentationImageIndexes.set({});
this.currentModuleIndex.set(0);
this.zoomedImageSet.set([]);
this.zoomedImageIndex.set(0);
this.zoomScale.set(1);
this.zoomOrigin.set('50% 50%');
this.visibleQuestions.set(this.pickRandomQuestions(course?.questions ?? []));
setTimeout(() => this.updateCurrentModuleFromScroll(), 0);
});
readonly course = computed(() => {
const slug = this.paramMap()?.get('slug') ?? null;
return getCourseBySlug(slug);
});
readonly modulesWithSections = computed(() => {
const course = this.course();
if (!course) {
return [];
}
const fallbackSection = course.lessonSections[course.lessonSections.length - 1] ?? null;
return course.modules.map((module, index) => ({
module,
section: course.lessonSections[index] ?? fallbackSection
}));
});
readonly progressLabel = computed(() => {
const course = this.course();
if (!course) {
return '0% complete';
}
return `${this.currentModuleIndex() + 1} of ${course.modules.length} módulos`;
});
readonly progressPercentage = computed(() => {
const course = this.course();
if (!course || course.modules.length === 0) {
return 0;
}
return ((this.currentModuleIndex() + 1) / course.modules.length) * 100;
});
scrollToModule(index: number): void {
const section = document.querySelector<HTMLElement>(`[data-module-index="${index}"]`);
if (!section) {
return;
}
section.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
@HostListener('window:scroll')
onWindowScroll(): void {
this.updateCurrentModuleFromScroll();
}
@HostListener('window:keydown.escape')
onEscapeKey(): void {
this.closeZoomedImage();
}
@HostListener('window:keydown.arrowleft')
onArrowLeftKey(): void {
this.showPreviousZoomedImage();
}
@HostListener('window:keydown.arrowright')
onArrowRightKey(): void {
this.showNextZoomedImage();
}
private updateCurrentModuleFromScroll(): void {
const sections = Array.from(document.querySelectorAll<HTMLElement>('[data-module-index]'));
if (sections.length === 0) {
return;
}
const scrollProbe = window.scrollY + window.innerHeight * 0.35;
let activeIndex = 0;
sections.forEach((section, index) => {
if (section.offsetTop <= scrollProbe) {
activeIndex = index;
}
});
if (activeIndex !== this.currentModuleIndex()) {
this.currentModuleIndex.set(activeIndex);
}
}
selectAnswer(questionIndex: number, optionIndex: number): void {
const currentAnswers = this.selectedAnswers();
if (currentAnswers[questionIndex] !== undefined) {
return;
}
this.selectedAnswers.set({
...currentAnswers,
[questionIndex]: optionIndex
});
}
isQuestionAnswered(questionIndex: number): boolean {
return this.selectedAnswers()[questionIndex] !== undefined;
}
isCorrectOption(questionIndex: number, optionIndex: number): boolean {
const question = this.visibleQuestions()[questionIndex];
if (!question || !this.isQuestionAnswered(questionIndex)) {
return false;
}
return question.correctOptionIndex === optionIndex;
}
isWrongSelectedOption(questionIndex: number, optionIndex: number): boolean {
const selectedOption = this.selectedAnswers()[questionIndex];
if (selectedOption === undefined) {
return false;
}
const question = this.visibleQuestions()[questionIndex];
if (!question) {
return false;
}
const correctOption = question.correctOptionIndex;
return selectedOption === optionIndex && selectedOption !== correctOption;
}
openZoomedImage(imageSrc: string): void {
this.openZoomedImageGallery([imageSrc], 0);
}
openZoomedImageGallery(imageSet: string[], imageIndex: number): void {
this.zoomedImageSet.set(imageSet);
this.zoomedImageIndex.set(imageIndex);
this.zoomScale.set(1);
this.zoomOrigin.set('50% 50%');
}
closeZoomedImage(): void {
this.zoomedImageSet.set([]);
this.zoomedImageIndex.set(0);
this.zoomScale.set(1);
this.zoomOrigin.set('50% 50%');
}
showPreviousZoomedImage(): void {
const imageSet = this.zoomedImageSet();
const imageIndex = this.zoomedImageIndex();
if (imageSet.length <= 1 || imageIndex === 0) {
return;
}
this.zoomedImageIndex.set(imageIndex - 1);
this.resetImageZoom();
}
showNextZoomedImage(): void {
const imageSet = this.zoomedImageSet();
const imageIndex = this.zoomedImageIndex();
if (imageSet.length <= 1 || imageIndex >= imageSet.length - 1) {
return;
}
this.zoomedImageIndex.set(imageIndex + 1);
this.resetImageZoom();
}
previousPresentationImage(moduleIndex: number): void {
const currentImage = this.getPresentationImageIndex(moduleIndex);
if (currentImage === 0) {
return;
}
this.presentationImageIndexes.update((indexes) => ({
...indexes,
[moduleIndex]: currentImage - 1
}));
}
nextPresentationImage(moduleIndex: number, images: string[]): void {
const currentImage = this.getPresentationImageIndex(moduleIndex);
if (currentImage >= images.length - 1) {
return;
}
this.presentationImageIndexes.update((indexes) => ({
...indexes,
[moduleIndex]: currentImage + 1
}));
}
getPresentationImage(moduleIndex: number, images: string[]): string {
return images[this.getPresentationImageIndex(moduleIndex)] ?? images[0] ?? '';
}
getPresentationImageIndex(moduleIndex: number): number {
return this.presentationImageIndexes()[moduleIndex] ?? 0;
}
zoomInImage(): void {
this.zoomScale.update((scale) => Math.min(scale + CourseLearningPageComponent.ZOOM_STEP, CourseLearningPageComponent.MAX_ZOOM_SCALE));
}
zoomOutImage(): void {
this.zoomScale.update((scale) => Math.max(scale - CourseLearningPageComponent.ZOOM_STEP, CourseLearningPageComponent.MIN_ZOOM_SCALE));
}
resetImageZoom(): void {
this.zoomScale.set(1);
this.zoomOrigin.set('50% 50%');
}
handleImageZoomWheel(event: WheelEvent, imageElement: HTMLImageElement): void {
event.preventDefault();
this.updateZoomOriginFromPointer(event, imageElement);
if (event.deltaY < 0) {
this.zoomInImage();
return;
}
this.zoomOutImage();
}
handleImageZoomClick(event: MouseEvent, imageElement: HTMLImageElement): void {
this.updateZoomOriginFromPointer(event, imageElement);
this.zoomInImage();
}
private updateZoomOriginFromPointer(event: MouseEvent | WheelEvent, imageElement: HTMLImageElement): void {
const bounds = imageElement.getBoundingClientRect();
if (bounds.width === 0 || bounds.height === 0) {
return;
}
const relativeX = ((event.clientX - bounds.left) / bounds.width) * 100;
const relativeY = ((event.clientY - bounds.top) / bounds.height) * 100;
const clampedX = Math.min(Math.max(relativeX, 0), 100);
const clampedY = Math.min(Math.max(relativeY, 0), 100);
this.zoomOrigin.set(`${clampedX}% ${clampedY}%`);
}
private pickRandomQuestions(questions: CourseQuestion[]): CourseQuestion[] {
const shuffledQuestions = [...questions];
for (let index = shuffledQuestions.length - 1; index > 0; index -= 1) {
const randomIndex = Math.floor(Math.random() * (index + 1));
[shuffledQuestions[index], shuffledQuestions[randomIndex]] = [shuffledQuestions[randomIndex], shuffledQuestions[index]];
}
return shuffledQuestions.slice(0, CourseLearningPageComponent.QUESTIONS_PER_SESSION);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,57 @@
.hero-logo-badge {
position: absolute;
top: 24px;
right: 24px;
z-index: 1;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 10px 16px;
border: 1px solid rgba(191, 219, 254, 0.55);
border-radius: 999px;
background: rgba(239, 246, 255, 0.88);
backdrop-filter: blur(8px);
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
.hero-logo {
width: clamp(120px, 16vw, 190px);
height: auto;
display: block;
object-fit: contain;
}
.course-card__badge {
position: absolute;
top: 16px;
left: 16px;
z-index: 1;
display: flex;
align-items: center;
justify-content: flex-start;
gap: 8px;
max-width: calc(100% - 32px);
overflow-x: auto;
}
.course-card__badge-image {
width: auto;
max-width: 88px;
flex: 0 0 auto;
height: 24px;
display: block;
object-fit: contain;
}
@media (max-width: 768px) {
.hero-logo-badge {
top: 16px;
right: 16px;
padding: 8px 14px;
}
.hero-logo {
width: 120px;
}
}
@@ -0,0 +1,98 @@
<div class="min-h-screen bg-slate-50 text-slate-900">
<section class="relative overflow-hidden bg-slate-950">
<div class="absolute inset-0 bg-gradient-to-r from-indigo-700/20 via-cyan-500/10 to-purple-700/20"></div>
<div class="hero-logo-badge">
<a href="https://www.metacase.pt" target="_blank" rel="noopener">
<img
src="/logo-metacase-cor.svg"
alt="Metacase"
class="hero-logo"
/>
</a>
</div>
<div class="relative mx-auto max-w-7xl px-6 py-20 lg:px-8">
<div class="max-w-3xl">
<span class="inline-flex rounded-full border border-white/20 bg-white/10 px-4 py-1 text-sm font-medium text-white">
Learning Hub
</span>
<h1 class="mt-6 text-4xl font-bold tracking-tight text-white sm:text-5xl lg:text-6xl">
Formações de TargetOne
</h1>
<p class="mt-6 text-lg leading-8 text-slate-300">
Formações práticas e atualizadas para a utilização da plataforma TargetOne <br>Aprendizagem orientada para a ferramenta com formações teóricas e práticas
</p>
</div>
</div>
</section>
<section class="mx-auto max-w-7xl px-6 py-10 lg:px-8">
<div class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div>
<h2 class="text-3xl font-bold tracking-tight text-slate-900">Formações disponíveis</h2>
<p class="mt-2 text-slate-600">
Atualmente encontram-se disponíveis {{ courses.length }} {{ courses.length === 1 ? 'formação' : 'formações' }} em destaque.
</p>
</div>
<div class="inline-flex w-fit items-center rounded-2xl border border-slate-200 bg-white px-4 py-3 shadow-sm">
<span class="text-sm font-semibold text-slate-700">
{{ courses.length }} {{ courses.length === 1 ? 'curso' : 'cursos' }}
</span>
</div>
</div>
</section>
<section class="mx-auto max-w-7xl px-6 pb-16 lg:px-8">
<div class="grid gap-8 md:grid-cols-2 xl:grid-cols-3">
<article
*ngFor="let course of courses"
class="group overflow-hidden rounded-3xl border border-slate-200 bg-white shadow-sm transition duration-300 hover:-translate-y-1 hover:shadow-xl"
>
<div class="relative h-56 overflow-hidden">
<img
[src]="course.image"
[alt]="course.title"
class="h-full w-full object-cover transition duration-500 group-hover:scale-105"
/>
<div class="absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent"></div>
<div class="course-card__badge">
<img
*ngFor="let icon of course.categoryIcons"
[alt]="course.category"
class="course-card__badge-image"
/>
</div>
</div>
<div class="p-6">
<h3 class="mt-2 text-xl font-bold text-slate-900">
{{ course.title }}
</h3>
<p class="mt-3 text-sm leading-6 text-slate-600">
{{ course.description }}
</p>
<div class="mt-5 flex flex-wrap gap-2">
<span class="rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700">
{{ course.duration }}
</span>
</div>
<a
[routerLink]="['/cursos', course.slug]"
class="mt-6 block w-full rounded-2xl bg-gradient-to-r from-indigo-600 to-purple-600 px-4 py-3 text-center text-sm font-semibold text-white transition hover:opacity-95"
>
Entrar
</a>
</div>
</article>
</div>
</section>
</div>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { Formacaometacase } from './formacaometacase';
describe('Formacaometacase', () => {
let component: Formacaometacase;
let fixture: ComponentFixture<Formacaometacase>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Formacaometacase],
providers: [provideRouter([])]
}).compileComponents();
fixture = TestBed.createComponent(Formacaometacase);
component = fixture.componentInstance;
await fixture.whenStable();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
import { COURSES, type Course } from '../data/courses';
@Component({
selector: 'app-formacaometacase',
standalone: true,
imports: [CommonModule, RouterLink],
templateUrl: './formacaometacase.html',
styleUrl: './formacaometacase.css'
})
export class Formacaometacase {
readonly courses: Course[] = COURSES;
}