Skip to content

Commit

Permalink
chore: fix all images in home and links
Browse files Browse the repository at this point in the history
  • Loading branch information
Boyadjie committed Jun 29, 2024
1 parent e6094ae commit 1ce476f
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 39 deletions.
30 changes: 4 additions & 26 deletions app/accueil/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,9 @@ import {MapPreview} from '../../src/components/map/MapPreview';
import {Navbar} from '../../src/components/navbar/Navbar';
import {Onboarding} from '../../src/components/onboarding/Onboarding';
import {Profile} from '../../src/components/profile/Profile';
import {actus, articles} from '../../src/data/homePage';
import styles from './page.module.css';

const tempData = [
{
title: 'Préparer son voyage en 5 étapes',
date: new Date('2024-06-05'),
pictureUrl: '/user.jpg',
},
{
title: 'Vie locale : conseils pratiques',
date: new Date('2024-11-09'),
pictureUrl: '/user.jpg',
},
{
title: 'Où manger local ?',
date: new Date('2024-03-01'),
pictureUrl: '/user.jpg',
},
{
title: 'Transports et déplacements',
date: new Date('2024-03-23'),
pictureUrl: '/user.jpg',
},
];

export default function Home() {
return (
<>
Expand Down Expand Up @@ -61,10 +39,10 @@ export default function Home() {
<div className={styles.homeContentContainer}>
<Slider
title="Articles conseillés"
items={tempData}
link="/accueil#"
items={articles}
link="/articles"
/>
<Slider title="Actualités" items={tempData} link="/accueil#" />
<Slider title="Actualités" items={actus} link="/accueil#" />
<MapPreview />
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions app/articles/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@
}
}
}

.loader {
width: 100%;
display: flex;
justify-content: center;

svg {
width: 120px;
}
}
7 changes: 6 additions & 1 deletion app/articles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {useState} from 'react';

import {ArticlesList} from '../../src/components/articles/articlesList/ArticlesList';
import {Loader} from '../../src/components/decorations/loader';
import {InputRadio} from '../../src/components/Form/Inputs/InputRadio';
import {Navbar} from '../../src/components/navbar/Navbar';
import {useArticles} from '../../src/hook/useArticles';
Expand Down Expand Up @@ -41,7 +42,11 @@ export default function Articles() {
))}
</div>

{loading && 'Loading ...'}
{loading && (
<div className={styles.loader}>
<Loader />
</div>
)}
{!loading && categories && (
<ArticlesList articles={categories[selectedCategory]} />
)}
Expand Down
18 changes: 9 additions & 9 deletions src/components/blocs/preview/article/articlePreview.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@
width: 100%;

.imageContainer {
position: relative;
width: 100%;
overflow: hidden;
border-radius: 5px;

> img {
position: absolute;
aspect-ratio: 16 / 9;
width: 100%;
height: auto;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}

Expand All @@ -39,9 +31,17 @@
position: relative;
width: 125px;
height: 125px;
overflow: hidden;
border-radius: 5px;

> img {
border-radius: 5px;
position: absolute;
aspect-ratio: 16 / 9;
width: auto;
height: 100%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}

.rate {
Expand Down
60 changes: 60 additions & 0 deletions src/components/decorations/Loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
export const Loader = () => {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<circle
fill="#00969F"
stroke="#00969F"
stroke-width="15"
r="15"
cx="40"
cy="100"
>
<animate
attributeName="opacity"
calcMode="spline"
dur="1"
values="1;0;1;"
keySplines=".5 0 .5 1;.5 0 .5 1"
repeatCount="indefinite"
begin="-.4"
></animate>
</circle>
<circle
fill="#00969F"
stroke="#00969F"
stroke-width="15"
r="15"
cx="100"
cy="100"
>
<animate
attributeName="opacity"
calcMode="spline"
dur="1"
values="1;0;1;"
keySplines=".5 0 .5 1;.5 0 .5 1"
repeatCount="indefinite"
begin="-.2"
></animate>
</circle>
<circle
fill="#00969F"
stroke="#00969F"
stroke-width="15"
r="15"
cx="160"
cy="100"
>
<animate
attributeName="opacity"
calcMode="spline"
dur="1"
values="1;0;1;"
keySplines=".5 0 .5 1;.5 0 .5 1"
repeatCount="indefinite"
begin="0"
></animate>
</circle>
</svg>
);
};
2 changes: 1 addition & 1 deletion src/components/landing/contact/Contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Contact = () => {
</>
);
})}
<PrimaryButton url="/Acceuil">Je veux l'application</PrimaryButton>
<PrimaryButton url="/accueil">Je veux l'application</PrimaryButton>
</div>
</div>
</section>
Expand Down
4 changes: 2 additions & 2 deletions src/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Navbar = () => {
return (
<nav className={styles.navbar}>
<ul>
<a href="">
<a href="/accueil">
<li>
<Image
src="/icons/nav/home.svg"
Expand All @@ -16,7 +16,7 @@ export const Navbar = () => {
/>
</li>
</a>
<a href="">
<a href="/articles">
<li>
<Image
src="/icons/nav/articles.svg"
Expand Down
47 changes: 47 additions & 0 deletions src/data/homePage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export const articles = [
{
title: 'Préparer son voyage au Japon en 5 étapes',
date: new Date('2024-06-05'),
pictureUrl:
'/images/articles/préparer_son_voyage_au_japon_en_5_étapes.webp',
},
{
title: 'Vie locale : conseils pratiques',
date: new Date('2024-11-09'),
pictureUrl: '/images/articles/vie_locale_conseils_pratiques.webp',
},
{
title: 'Où manger local ?',
date: new Date('2024-03-01'),
pictureUrl: '/images/articles/où_manger_local.webp',
},
{
title: 'Transports & déplacements',
date: new Date('2024-03-23'),
pictureUrl: '/images/articles/transports_et_déplacements.webp',
},
];

export const actus = [
{
title: 'Transports & déplacements',
date: new Date('2024-03-23'),
pictureUrl: '/images/articles/transports_et_déplacements.webp',
},
{
title: 'Où manger local ?',
date: new Date('2024-03-01'),
pictureUrl: '/images/articles/où_manger_local.webp',
},
{
title: 'Vie locale : conseils pratiques',
date: new Date('2024-11-09'),
pictureUrl: '/images/articles/vie_locale_conseils_pratiques.webp',
},
{
title: 'Préparer son voyage au Japon en 5 étapes',
date: new Date('2024-06-05'),
pictureUrl:
'/images/articles/préparer_son_voyage_au_japon_en_5_étapes.webp',
},
];

0 comments on commit 1ce476f

Please sign in to comment.