Skip to content

Commit

Permalink
feat: ehance news section
Browse files Browse the repository at this point in the history
  • Loading branch information
NoeTerrier committed Feb 25, 2024
1 parent 7d52784 commit a59d36e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
16 changes: 10 additions & 6 deletions app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import PreviewImage from "@/assets/galleryPreview.png";
import Card from "@/components/Card";
import DirectusImage from "@/components/DirectusImage";
import NewsCard from "@/components/NewsCard";
import Slider from "@/components/Slider";
import { directus, populateLayoutProps } from "@/directus";
import {
getTranslation,
Expand Down Expand Up @@ -33,11 +32,16 @@ export default function Home(
<DirectusImage img={translation.banner} className="mainLogo" />
<img src={PreviewImage.src} alt="preview" className="galleryPreview" />
</div>
<Slider>
{props.news.map((n) => (
<NewsCard key={(n as any).id} news={n} />
))}
</Slider>

<div className="news">
<h1 className="title">News</h1>
<div className="news-list">
{props.news.map((n) => (
<NewsCard key={(n as any).id} news={n} />
))}
</div>
</div>

<Markdown className="text">{translation.description}</Markdown>
<div className="cardList">
<h1 className="title">
Expand Down
5 changes: 2 additions & 3 deletions app/src/styles/NavigationBar.module.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
.navigationBar {
display: flex;
flex-direction: row;
background-color: rgba(100, 100, 255, 0.75);
width: 100%;
height: 3em;
position: fixed;
z-index: 100;

background-color: rgba(100, 100, 255, 0.75);
backdrop-filter: blur(10px) saturate(180%);

border: 1px solid rgba(255, 255, 255, 0.125);
box-shadow: 0 4px 30px rgba(0, 0, 100, 0.3);

color: white;
color: var(--text-color);
font-family: "Courier New", Courier, monospace;
font-weight: bold;
font-size: 15pt;
Expand Down
27 changes: 24 additions & 3 deletions app/src/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ body {
margin: 0;

--background-color: #fafafa;
--text-color: #fafafa;
--dark-text-color: darkblue;

font-family: "Courier New", Courier, monospace;
}
Expand All @@ -22,8 +24,6 @@ a {

gap: 4rem;

padding: 2rem;

min-height: 100vh;

background-position: left top;
Expand Down Expand Up @@ -74,6 +74,26 @@ a {
}
}

.news {
width: 100%;
overflow: scroll;

padding: 2em;

background-color: rgba(100, 100, 255, 0.75);
backdrop-filter: blur(10px) saturate(180%);
border: 1px solid rgba(255, 255, 255, 0.125);
box-shadow: 0 4px 30px rgba(0, 0, 100, 0.3);

.news-list {
margin: 2%;
gap: 2em;
width: fit-content;
display: flex;
flex-direction: row;
}
}

.text {
min-width: 20ch;
max-width: 60ch;
Expand Down Expand Up @@ -170,6 +190,7 @@ a {

.title {
text-align: center;
color: var(--dark-text-color);

&::after {
position: relative;
Expand All @@ -178,7 +199,7 @@ a {
top: -0.45rem;
left: 0.5rem;

background-color: darkcyan;
background-color: var(--dark-text-color);
content: "";
display: inline-block;
}
Expand Down

0 comments on commit a59d36e

Please sign in to comment.