Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base Structure Setup #152

Open
wants to merge 26 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c844579
Base Structure Setup
Skasix00 Feb 14, 2025
2725604
Adds Inquiry2024Header component and integrates it into Inquiry2024Pa…
Skasix00 Feb 14, 2025
6092b74
Refactors survey to inquiry components; adds new styles and removes o…
Skasix00 Feb 17, 2025
e57ba05
Merge branch 'production' into digital-292-implementar-pagina-inquerito
Skasix00 Feb 17, 2025
c4fb876
Rmoved unecesary files in the cards section, this doesnt need that co…
Skasix00 Feb 17, 2025
7880ddd
Enhance Survey2024AboutCard with Lottie animations; refactor styles a…
Skasix00 Feb 18, 2025
a7e34b2
Results card layout done
Skasix00 Feb 18, 2025
18c0ed1
Added Result Card filtering, by multiple filters
Skasix00 Feb 18, 2025
b0d375c
Tweaked the animations on about section
Skasix00 Feb 18, 2025
215b970
Added a no data label and it's respective translation
Skasix00 Feb 18, 2025
b65aa8a
Refactor Survey2024 components for improved layout and responsiveness…
Skasix00 Feb 19, 2025
d223510
Finished Page
Skasix00 Feb 19, 2025
41fb130
Refactors accordion rendering logic
jusimen Feb 19, 2025
2f025b0
Added Clearable button on TextInput
jusimen Feb 19, 2025
05c98e6
Refactors survey results filtering logic
jusimen Feb 19, 2025
2efd62c
Refactors Survey2024 toolbar layout
jusimen Feb 19, 2025
6fd2840
Refines color scheme for improved readability
jusimen Feb 19, 2025
66c3a40
Adds redirect for survey-2024 page
jusimen Feb 19, 2025
cbb1051
Tweaked card display conditions
Skasix00 Feb 19, 2025
b39a7c6
Changes the avaliation filter from a select to a range slider
Skasix00 Feb 19, 2025
2f6fba2
Added logic to optimze the display of the last card
Skasix00 Feb 20, 2025
76a2a6d
Tweaked range slider
Skasix00 Feb 24, 2025
9f35276
Added color to slider
Skasix00 Feb 28, 2025
c70a4b5
Added More specific result filtering by evaluation, takes into accoun…
Skasix00 Feb 28, 2025
9d32b80
Rolled back to the original slider colors
Skasix00 Feb 28, 2025
8d66e95
Redesigned the Level About Cards
Skasix00 Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions frontend/app/(views)/(website)/survey-2024/opengraph-image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* * */

import { OpenGraphSurvey2024Default } from '@/opengraph/OpenGraphSurvey2024Default';
import fs from 'fs';
import { ImageResponse } from 'next/og';

/* * */

export default async function Image() {
return new ImageResponse(
<OpenGraphSurvey2024Default />,
{
fonts: [
{ data: fs.readFileSync(`${process.cwd()}/public/fonts/Inter-Medium.ttf`).buffer as ArrayBuffer, name: 'Inter', style: 'normal', weight: 500 },
{ data: fs.readFileSync(`${process.cwd()}/public/fonts/Inter-SemiBold.ttf`).buffer as ArrayBuffer, name: 'Inter', style: 'normal', weight: 600 },
{ data: fs.readFileSync(`${process.cwd()}/public/fonts/Inter-Bold.ttf`).buffer as ArrayBuffer, name: 'Inter', style: 'normal', weight: 700 },
],
height: 630,
width: 1200,
},
);
}
16 changes: 16 additions & 0 deletions frontend/app/(views)/(website)/survey-2024/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* * */

import { Survey2024Page } from '@/components/survey-2024/Survey2024Page';
import { type Metadata } from 'next';

/* * */

export const metadata: Metadata = {
description: 'Explore a verdadeira dimensão da CMetropolitana em 2024.',
title: 'CMetropolitana | Inquérito 2024',
};

/* * */
export default function Page() {
return <Survey2024Page />;
}
11 changes: 8 additions & 3 deletions frontend/components/home/MainCarousel/data.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
[
{
"id": "0001",
"src": "/assets/featured/survey-2024.png",
"url": "/survey-2024"
},
{
"id": "0002",
"src": "/assets/featured/review-2024.png",
"url": "/viagem-2024"
},
{
"id": "0002",
"id": "0003",
"src": "/assets/featured/tempo-real.png",
"url": "/news/27134"
},
{
"id": "0003",
"id": "0004",
"src": "/assets/featured/download_app.png",
"target": "_blank",
"url": "https://backoffice.carrismetropolitana.pt/viagemvirtual"
},
{
"id": "0004",
"id": "0005",
"src": "/assets/featured/join_whatsapp.png",
"url": "/news/7243"
}
Expand Down
45 changes: 45 additions & 0 deletions frontend/components/survey-2024/Survey2024AboutCard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use client';

/* * */

import { LottiePlayer } from '@/components/common/LottiePlayer';
import { Survery2024AboutCardSchema } from '@/components/survey-2024/_data/About/cards';

import styles from './styles.module.css';

/* * */

interface Props {
cardData: Survery2024AboutCardSchema

}
/* * */

export function Survey2024AboutCard({ cardData }: Props) {
//

//
// A. Render components

return (
<div className={styles.container}>
<div className={styles.cardMainWrapperShadow}><p className={styles.headerTitle}>{cardData.content.header_title}</p></div>
<div className={styles.cardMainWrapper} id={cardData._id}>
<div className={styles.header}>
{cardData.content.lottie_src && (
<LottiePlayer
className={styles.lottie}
path={cardData.content.lottie_src}
loop
play
/>
)}
<p className={styles.headerNumber}>{cardData.header.value}</p>
<p className={styles.headerTitle}>{cardData.content.legend}</p>
</div>
</div>
</div>
);

//
}
140 changes: 140 additions & 0 deletions frontend/components/survey-2024/Survey2024AboutCard/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/* * */
/* CONTAINER */

.container {
display: grid;
grid-template-columns: 1fr;
gap: 0;
align-items: flex-start;
justify-content: flex-start;
width: 100%;
}


/* * */
/* HEADER */

.header {
z-index: 10;
display: flex;
flex-direction: column;
gap: 5px;
align-items: center;
width: 100%;
padding: 10px;
min-height: 140px;
justify-content: center;
}

.headerTitle {
font-size: 16px;
font-weight: var(--font-weight-bold);
color: var(--color-text);
margin-left: 20px;
}

.headerNumber {
font-size: 28px;
font-weight: var(--font-weight-bold);
color: var(--color-text);
}


/* * */
/* CONTENT */

.content {
width: 100%;
border-right: 2px solid var(--color-border);
border-left: 2px solid var(--color-border);
transition: all 500ms ease-out;
}

/* * */
/* CONTENT NUMBER */

.contentNumber {
display: flex;
flex-direction: column;
gap: 5px;
padding: 15px 20px;
background-color: var(--color-primary);
border-radius: 18px;
}

.contentNumberValue {
font-size: 26px;
font-weight: var(--font-weight-bold);
line-height: 1;
color: var(--color-text);
}

.contentNumberLegend {
font-size: 12px;
font-weight: var(--font-weight-semibold);
color: var(--color-text);
opacity: 0.8;
}

/* * */
/* CONTENT LOTTIE */

.contentLottie {
display: flex;
align-items: center;
justify-content: center;
min-height: 200px;
background: #fff;
border: 1px solid var(--color-system-border-100);
border-radius: 18px;
}

/* * */
/* CONTENT TITLE */

.contentTitle {
font-size: 18px;
font-weight: var(--font-weight-bold);
color: var(--color-system-text-200);
}

.contentDescription {
font-size: 14px;
font-weight: var(--font-weight-medium);
color: var(--color-system-text-200);
}

/* * */
/* CARD WRAPPER SHADOW */

.cardMainWrapperShadow{
width: 100%;
height: 60px;
margin-bottom: -10px;
background-color: var(--color-brand);
border-top-left-radius: 18px;
border-top-right-radius: 18px;
}


/* * */
/* CARD WRAPPER */

.cardMainWrapper{
-webkit-box-shadow: 0px -10px 0px rgba(0, 0, 0, 0.08);
-moz-box-shadow: 0px -10px 0px rgba(0, 0, 0, 0.08);
box-shadow: 0px -10px 0px rgba(0, 0, 0, 0.08);
border-radius: 10px;
background-color: var(--color-system-background-100);
border: 1px solid var(--color-system-border-100);
}

/* * */
/* Header Title */
.headerTitle {
font-size: 16px;
font-weight: var(--font-weight-bold);
color: var(--color-text);
padding: 10px;
text-align: center ;
}
45 changes: 45 additions & 0 deletions frontend/components/survey-2024/Survey2024Header/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* * */

import Button from '@/components/common/Button';
import { Section } from '@/components/layout/Section';
import { Surface } from '@/components/layout/Surface';
import { IconDownload } from '@tabler/icons-react';
import { useTranslations } from 'next-intl';

import styles from './styles.module.css';

/* * */
export function Survey2024Header() {
//

//
// A. Setup variables

const t = useTranslations('survey-2024.Survey2024Header');

//
// B. Render components

return (
<Surface>
<Section withGap withPadding>

<p className={styles.SurveyTitle}>{t('title')}</p>

<div className={styles.anchorButtonsContainer}>
<Button href="#aboutSurvey" label={t('AnchorAboutSurvey')} />
<Button href="#passangerChacterization" label={t('AnchorPassengerCaracter')} />
<Button href="#results" label={t('AnchorResults')} />
<Button href="#recomendationIndex" label={t('AnchorIndex')} />
</div>

<div className={styles.downloadButtonContainer}>
<Button className={styles.downloadButton} icon={<IconDownload size={20} />} label={t('AnchorAboutSurveyTitle')} />
</div>

</Section>
</Surface>
);

//
}
44 changes: 44 additions & 0 deletions frontend/components/survey-2024/Survey2024Header/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.SurveyTitle {
font-weight: var(--font-weight-title);
font-size:var(--font-size-title) ;
color: var(--color-system-text-100);
}

.downloadButton{
background: var(--color-brand);
font-weight: var(--font-weight-semibold);
font-size:var(--color-system-text-300) ;
}

.downloadButtonContainer{
align-items: center;
align-self: center;
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
}

.anchorButtonsContainer{
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin: 0 auto;

}
@media(width <= 650px) {
.anchorButtonsContainer{
display: grid;
grid-template-columns: 1fr;
gap: 10px;
margin: 0 auto;

}
}


.anchorButtonsContainer a{
color: var(--color-system-text-300);
font-weight: var(--font-weight-bold);
font-size:var(--font-size-text);
}
18 changes: 18 additions & 0 deletions frontend/components/survey-2024/Survey2024Intro/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client';

/* * */

import { Surface } from '@/components/layout/Surface';
import { Image } from '@mantine/core';

import styles from './styles.module.css';

/* * */

export function Survey2024Intro() {
return (
<Surface forceOverflow>
<Image alt="Review 2024" className={styles.image} src="/assets/survey-2024/images/AF _ Inquérito _ Banner _ Small.png" />
</Surface>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* * */
/* TEXT */

.text {
padding: 0 5px;
font-size: 18px;
font-weight: var(--font-weight-medium);
color: var(--color-system-text-100);
}
Loading