frontend: Functions page et FunctionCard

This commit is contained in:
Divlo 2020-03-19 16:13:51 +01:00
parent d4fb1e3aba
commit 0be0abf13c
11 changed files with 1411 additions and 442 deletions

View File

@ -0,0 +1,6 @@
.footer {
border-top: var(--border-header-footer);
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -1,7 +1,9 @@
import './Footer.css';
export default function Footer() {
return (
<footer>
Footer
<footer className="footer">
<p className="footer-text"><a href="https://divlo.fr/" target="_blank" rel="noopener noreferrer">Divlo</a> | Tous droits réservés</p>
</footer>
);
}

View File

@ -0,0 +1,49 @@
.FunctionCard {
display: flex;
align-items: center;
position: relative;
flex-direction: column;
word-wrap: break-word;
box-shadow: 0px 0px 6px 6px rgba(0, 0, 0, .25);
border: 1px solid black;
border-radius: 1rem;
margin: 0 0 40px 0;
cursor: pointer;
transition: all .3s;
}
.FunctionCard:hover {
transform: translateY(-7px);
}
/* col-md */
@media (min-width: 768px) {
.FunctionCard {
margin: 0 30px 40px 30px;
}
}
/* col-xl */
@media (min-width: 1200px) {
.FunctionCard {
margin: 0 13px 40px 13px;
}
}
.FunctionCard__title {
font-size: 1.4em;
margin: 0;
color: var(--important);
font-weight: 300;
}
.FunctionCard__description {
margin: 20px 0 10px 0;
}
.FunctionCard__info {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.FunctionCard__category {
border-radius: 0.5em;
padding: 0.5em;
margin-right: 20px;
}

View File

@ -0,0 +1,18 @@
import Link from 'next/link';
import './FunctionCard.css';
const FunctionCard = (props) => (
<Link href={`/functions/${props.slug}`}>
<div className="FunctionCard col-sm-16 col-md-7 col-xl-5">
<img className="FunctionCard__image" alt={props.title} src={props.image} />
<h2 className="FunctionCard__title">{props.title}</h2>
<p className="FunctionCard__description">{props.description}</p>
<div className="FunctionCard__info">
<p className="FunctionCard__category" style={{ backgroundColor: props.category.color }}>{props.category.name}</p>
<p className="FunctionCard__publication-date">{props.publicationDate}</p>
</div>
</div>
</Link>
);
export default FunctionCard;

View File

@ -39,6 +39,7 @@ export default function Header() {
<nav className="Header__navbar">
<ul className={"navbar__list " + navbarList}>
<NavigationLink name="Accueil" path="/" />
<NavigationLink name="Fonctions" path="/functions" />
</ul>
</nav>

View File

@ -0,0 +1,42 @@
import { Fragment } from 'react';
import HeadTag from '../components/HeadTag';
import FunctionCard from '../components/FunctionCard/FunctionCard';
import '../public/css/pages/functions.css';
const Functions = () => (
<Fragment>
<HeadTag
title="Fonctions"
description="Liste des fonctions."
image="/images/FunctionProject_icon_small.png"
/>
<div className="container-fluid text-center">
<div className="row justify-content-center">
<div className="col-16">
<h1 className="Functions__title">Fonctions</h1>
</div>
</div>
<div className="row justify-content-center">
{/* TODO: API Call to fetch data */}
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
<FunctionCard slug="weatherRequest" image="/images/functions/weatherRequest.png" title="Météo" description="Affiche la météo et l'heure locale." category={{ name: "✨ Utilitaires", color: "#406880" }} publicationDate="18/03/2020" />
</div>
</div>
</Fragment>
);
export default Functions;

View File

@ -50,6 +50,12 @@ a:hover {
text-align: center;
word-break: break-word;
}
.justify-content-center {
justify-content: center;
}
.align-items-center {
align-items: center;
}
a, .important {
color: var(--important);
text-decoration: none;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
.Functions__title {
padding: 20px 0 20px 0;
}

View File

@ -0,0 +1,531 @@
/*!
* Bootstrap Grid v4.4.1 (https://getbootstrap.com/)
* Edited by Divlo (col, col-sm, col-md, col-lg, col-xl) and 16 columns
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
.container {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.container-fluid {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 576px) {
.container {
max-width: 540px;
}
}
@media (max-width: 576px) {
.container {
width: 90%;
}
}
@media (min-width: 768px) {
.container {
max-width: 720px;
}
}
@media (min-width: 992px) {
.container {
max-width: 960px;
}
}
@media (min-width: 1200px) {
.container {
max-width: 1140px;
}
}
.row {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
.col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 {
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
/* col- */
.col-1 {
flex: 0 0 8.33333%;
max-width: 8.33333%;
}
.col-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
}
.col-3 {
flex: 0 0 25%;
max-width: 25%;
}
.col-4 {
flex: 0 0 33.33333%;
max-width: 33.33333%;
}
.col-5 {
flex: 0 0 41.66667%;
max-width: 41.66667%;
}
.col-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-7 {
flex: 0 0 58.33333%;
max-width: 58.33333%;
}
.col-8 {
flex: 0 0 66.66667%;
max-width: 66.66667%;
}
.col-9 {
flex: 0 0 75%;
max-width: 75%;
}
.col-10 {
flex: 0 0 83.33333%;
max-width: 83.33333%;
}
.col-11 {
flex: 0 0 91.66667%;
max-width: 91.66667%;
}
.col-12 {
flex: 0 0 100%;
max-width: 100%;
}
.offset-1 {
margin-left: 8.33333%;
}
.offset-2 {
margin-left: 16.66667%;
}
.offset-3 {
margin-left: 25%;
}
.offset-4 {
margin-left: 33.33333%;
}
.offset-5 {
margin-left: 41.66667%;
}
.offset-6 {
margin-left: 50%;
}
.offset-7 {
margin-left: 58.33333%;
}
.offset-8 {
margin-left: 66.66667%;
}
.offset-9 {
margin-left: 75%;
}
.offset-10 {
margin-left: 83.33333%;
}
.offset-11 {
margin-left: 91.66667%;
}
/* col-sm */
@media (min-width: 576px) {
.col-sm-1 {
flex: 0 0 8.33333%;
max-width: 8.33333%;
}
.col-sm-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
}
.col-sm-3 {
flex: 0 0 25%;
max-width: 25%;
}
.col-sm-4 {
flex: 0 0 33.33333%;
max-width: 33.33333%;
}
.col-sm-5 {
flex: 0 0 41.66667%;
max-width: 41.66667%;
}
.col-sm-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-sm-7 {
flex: 0 0 58.33333%;
max-width: 58.33333%;
}
.col-sm-8 {
flex: 0 0 66.66667%;
max-width: 66.66667%;
}
.col-sm-9 {
flex: 0 0 75%;
max-width: 75%;
}
.col-sm-10 {
flex: 0 0 83.33333%;
max-width: 83.33333%;
}
.col-sm-11 {
flex: 0 0 91.66667%;
max-width: 91.66667%;
}
.col-sm-12 {
flex: 0 0 100%;
max-width: 100%;
}
.offset-sm-0 {
margin-left: 0;
}
.offset-sm-1 {
margin-left: 8.33333%;
}
.offset-sm-2 {
margin-left: 16.66667%;
}
.offset-sm-3 {
margin-left: 25%;
}
.offset-sm-4 {
margin-left: 33.33333%;
}
.offset-sm-5 {
margin-left: 41.66667%;
}
.offset-sm-6 {
margin-left: 50%;
}
.offset-sm-7 {
margin-left: 58.33333%;
}
.offset-sm-8 {
margin-left: 66.66667%;
}
.offset-sm-9 {
margin-left: 75%;
}
.offset-sm-10 {
margin-left: 83.33333%;
}
.offset-sm-11 {
margin-left: 91.66667%;
}
}
/* col-md */
@media (min-width: 768px) {
.col-md-1 {
flex: 0 0 8.33333%;
max-width: 8.33333%;
}
.col-md-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
}
.col-md-3 {
flex: 0 0 25%;
max-width: 25%;
}
.col-md-4 {
flex: 0 0 33.33333%;
max-width: 33.33333%;
}
.col-md-5 {
flex: 0 0 41.66667%;
max-width: 41.66667%;
}
.col-md-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-md-7 {
flex: 0 0 58.33333%;
max-width: 58.33333%;
}
.col-md-8 {
flex: 0 0 66.66667%;
max-width: 66.66667%;
}
.col-md-9 {
flex: 0 0 75%;
max-width: 75%;
}
.col-md-10 {
flex: 0 0 83.33333%;
max-width: 83.33333%;
}
.col-md-11 {
flex: 0 0 91.66667%;
max-width: 91.66667%;
}
.col-md-12 {
flex: 0 0 100%;
max-width: 100%;
}
.offset-md-0 {
margin-left: 0;
}
.offset-md-1 {
margin-left: 8.33333%;
}
.offset-md-2 {
margin-left: 16.66667%;
}
.offset-md-3 {
margin-left: 25%;
}
.offset-md-4 {
margin-left: 33.33333%;
}
.offset-md-5 {
margin-left: 41.66667%;
}
.offset-md-6 {
margin-left: 50%;
}
.offset-md-7 {
margin-left: 58.33333%;
}
.offset-md-8 {
margin-left: 66.66667%;
}
.offset-md-9 {
margin-left: 75%;
}
.offset-md-10 {
margin-left: 83.33333%;
}
.offset-md-11 {
margin-left: 91.66667%;
}
}
/* col-lg */
@media (min-width: 992px) {
.col-lg-1 {
flex: 0 0 8.33333%;
max-width: 8.33333%;
}
.col-lg-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
}
.col-lg-3 {
flex: 0 0 25%;
max-width: 25%;
}
.col-lg-4 {
flex: 0 0 33.33333%;
max-width: 33.33333%;
}
.col-lg-5 {
flex: 0 0 41.66667%;
max-width: 41.66667%;
}
.col-lg-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-lg-7 {
flex: 0 0 58.33333%;
max-width: 58.33333%;
}
.col-lg-8 {
flex: 0 0 66.66667%;
max-width: 66.66667%;
}
.col-lg-9 {
flex: 0 0 75%;
max-width: 75%;
}
.col-lg-10 {
flex: 0 0 83.33333%;
max-width: 83.33333%;
}
.col-lg-11 {
flex: 0 0 91.66667%;
max-width: 91.66667%;
}
.col-lg-12 {
flex: 0 0 100%;
max-width: 100%;
}
.offset-lg-0 {
margin-left: 0;
}
.offset-lg-1 {
margin-left: 8.33333%;
}
.offset-lg-2 {
margin-left: 16.66667%;
}
.offset-lg-3 {
margin-left: 25%;
}
.offset-lg-4 {
margin-left: 33.33333%;
}
.offset-lg-5 {
margin-left: 41.66667%;
}
.offset-lg-6 {
margin-left: 50%;
}
.offset-lg-7 {
margin-left: 58.33333%;
}
.offset-lg-8 {
margin-left: 66.66667%;
}
.offset-lg-9 {
margin-left: 75%;
}
.offset-lg-10 {
margin-left: 83.33333%;
}
.offset-lg-11 {
margin-left: 91.66667%;
}
}
/* col-xl */
@media (min-width: 1200px) {
.col-xl-1 {
flex: 0 0 8.33333%;
max-width: 8.33333%;
}
.col-xl-2 {
flex: 0 0 16.66667%;
max-width: 16.66667%;
}
.col-xl-3 {
flex: 0 0 25%;
max-width: 25%;
}
.col-xl-4 {
flex: 0 0 33.33333%;
max-width: 33.33333%;
}
.col-xl-5 {
flex: 0 0 41.66667%;
max-width: 41.66667%;
}
.col-xl-6 {
flex: 0 0 50%;
max-width: 50%;
}
.col-xl-7 {
flex: 0 0 58.33333%;
max-width: 58.33333%;
}
.col-xl-8 {
flex: 0 0 66.66667%;
max-width: 66.66667%;
}
.col-xl-9 {
flex: 0 0 75%;
max-width: 75%;
}
.col-xl-10 {
flex: 0 0 83.33333%;
max-width: 83.33333%;
}
.col-xl-11 {
flex: 0 0 91.66667%;
max-width: 91.66667%;
}
.col-xl-12 {
flex: 0 0 100%;
max-width: 100%;
}
.offset-xl-0 {
margin-left: 0;
}
.offset-xl-1 {
margin-left: 8.33333%;
}
.offset-xl-2 {
margin-left: 16.66667%;
}
.offset-xl-3 {
margin-left: 25%;
}
.offset-xl-4 {
margin-left: 33.33333%;
}
.offset-xl-5 {
margin-left: 41.66667%;
}
.offset-xl-6 {
margin-left: 50%;
}
.offset-xl-7 {
margin-left: 58.33333%;
}
.offset-xl-8 {
margin-left: 66.66667%;
}
.offset-xl-9 {
margin-left: 75%;
}
.offset-xl-10 {
margin-left: 83.33333%;
}
.offset-xl-11 {
margin-left: 91.66667%;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB