Skip to content

Commit ad42149

Browse files
committedMar 16, 2024·
style: news page style
1 parent 81d312b commit ad42149

12 files changed

+91
-111
lines changed
 

‎app/src/assets/icons/lang.svg

+1
Loading

‎app/src/assets/lang.svg

-71
This file was deleted.

‎app/src/components/NavigationBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Corner from "@/assets/corner.svg";
22
import Burger from "@/assets/icons/burger_menu_icon.svg";
3-
import Lang from "@/assets/lang.svg";
3+
import Lang from "@/assets/icons/lang.svg";
44
import { locale, translate } from "@/locales";
55
import styles from "@/styles/NavigationBar.module.scss";
66
import { Commission } from "@/types/aliases";

‎app/src/components/NewsCard.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ import { News } from "@/types/aliases";
66
import Link from "next/link";
77
import { useRouter } from "next/router";
88

9-
export default function NewsCard({ news }: { news: News }) {
9+
export default function NewsCard({
10+
news,
11+
vertical = false,
12+
}: {
13+
news: News;
14+
vertical?: boolean;
15+
}) {
1016
const router = useRouter();
1117

1218
const translation = getTranslation(news, router.locale);
1319
return (
14-
<Link href={`/news/${news.slug}`} className={`${styles.newsCard}`}>
20+
<Link
21+
href={`/news/${news.slug}`}
22+
className={`${styles.newsCard} ${vertical ? styles.vertical : ""}`}
23+
>
1524
<DirectusImage
1625
img={translation.banner}
1726
name={translation.title || ""}
@@ -26,8 +35,8 @@ export default function NewsCard({ news }: { news: News }) {
2635
<p className={styles.date}>
2736
{news.date_created ? new Date(news.date_created).toUTCString() : ""}
2837
</p>
29-
<Button className={styles.button} text="> " size="small" />
3038
</div>
39+
<Button className={styles.button} text="> " size="small" />
3140
</div>
3241
</Link>
3342
);

‎app/src/pages/news.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import NewsCard from "@/components/NewsCard";
22
import { directus, populateLayoutProps } from "@/directus";
33
import { queryTranslations } from "@/locales";
4+
import styles from "@/styles/NewsPage.module.scss";
45
import { News } from "@/types/aliases";
56
import { readItems } from "@directus/sdk";
67
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
@@ -9,10 +10,8 @@ export default function NewsComponent(
910
props: InferGetServerSidePropsType<typeof getServerSideProps>
1011
) {
1112
return (
12-
<div className="pageList">
13-
<div>
14-
<h1>News</h1>
15-
</div>
13+
<div className={styles.pageList}>
14+
<h1>News</h1>
1615
{props.news.map((n) => (
1716
<NewsCard key={(n as any).id} news={n} />
1817
))}

‎app/src/styles/AssociationDescription.module.scss

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
.publicFiles {
2-
$color: rgb(130, 130, 255);
3-
42
display: flex;
53
flex-direction: column;
64
align-items: center;
@@ -16,12 +14,17 @@
1614
}
1715

1816
> * {
19-
border: 2px $color solid;
17+
border: 2px var(--glass-color) solid;
2018
border-radius: 1rem;
2119
padding: 1rem;
2220

2321
display: flex;
2422
align-items: center;
2523
gap: 0.5rem;
24+
25+
&:hover {
26+
border: 2px var(--glass-color-hover) solid;
27+
color: var(--glass-color-hover);
28+
}
2629
}
2730
}

‎app/src/styles/Button.module.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
margin: 1rem;
55

66
color: var(--text-color);
7-
background-color: darkblue;
7+
background-color: var(--glass-color);
88

99
width: fit-content;
1010
height: fit-content;
@@ -15,7 +15,7 @@
1515
gap: 1rem;
1616

1717
&:hover {
18-
background-color: var(--glass-color);
18+
background-color: var(--glass-color-hover);
1919
}
2020

2121
backdrop-filter: blur(10px) saturate(180%);

‎app/src/styles/Homepage.module.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
margin: 2%;
6161
gap: 2em;
6262
width: fit-content;
63-
display: flex;
64-
flex-direction: row;
63+
display: grid;
64+
grid-template-columns: repeat(3, 50rem);
65+
padding-right: 5rem;
6566
}
6667
}
6768

‎app/src/styles/NavigationBar.module.scss

+13-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
.lang {
2929
width: 2em;
3030
height: auto;
31-
stroke: white;
31+
stroke-width: 0;
3232
cursor: pointer;
3333
}
3434

@@ -45,6 +45,7 @@
4545
.menuItem {
4646
fill: inherit;
4747
user-select: none;
48+
width: fit-content;
4849
cursor: pointer;
4950

5051
&:hover {
@@ -82,21 +83,27 @@
8283
.content {
8384
@extend .glass;
8485

85-
display: none;
8686
position: absolute;
87-
flex-direction: column;
88-
89-
padding-right: 2em;
87+
right: 0;
88+
display: none;
89+
overflow: hidden;
9090
z-index: 1;
9191
border-radius: 5px;
92+
white-space: nowrap;
9293

9394
.menuItem {
94-
margin: 0.5em 0em 0.5em 1em;
95+
padding: 0.5rem 1rem 0.5rem 1rem;
96+
width: 100%;
97+
98+
&:hover {
99+
background-color: var(--glass-color-hover);
100+
}
95101
}
96102
}
97103

98104
&:hover .content {
99105
display: flex;
106+
flex-direction: column;
100107
}
101108
}
102109

‎app/src/styles/NewsCard.module.scss

+17-19
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
background-color: var(--background-color);
33
border-radius: 3rem;
44

5-
min-width: 50rem;
6-
min-height: 20rem;
7-
8-
$width: 40ch;
9-
$height: 30ch;
10-
115
display: grid;
12-
grid-template-columns: 1fr 1fr;
6+
grid-template-columns: repeat(auto-fill, minmax(max(25rem, 50%), 1fr));
7+
grid-template-rows: repeat(auto-fill, minmax(20rem, 1fr));
138

149
overflow: hidden;
1510

@@ -18,6 +13,7 @@
1813
}
1914

2015
.content {
16+
position: relative;
2117
margin: 1em;
2218
display: flex;
2319
flex-direction: column;
@@ -37,19 +33,21 @@
3733
padding-right: 1rem;
3834
width: 80%;
3935
}
40-
41-
.button {
42-
margin: 0;
43-
width: 2rem;
44-
height: 2rem;
45-
font-size: 2rem;
46-
}
36+
}
37+
.button {
38+
position: absolute;
39+
margin: 0;
40+
bottom: 0.5em;
41+
right: 0.5em;
42+
width: 2rem;
43+
height: 2rem;
44+
font-size: 2rem;
4745
}
4846
}
4947

50-
@media (max-width: 800px) {
51-
grid-template-rows: 1fr 1fr;
52-
grid-template-columns: 1fr;
53-
min-width: 25rem;
54-
}
48+
// @media (max-width: 800px) {
49+
// grid-template-rows: 1fr 1fr;
50+
// grid-template-columns: 1fr;
51+
// min-width: 25rem;
52+
// }
5553
}

‎app/src/styles/NewsPage.module.scss

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.pageList {
2+
display: grid;
3+
4+
grid-template-columns: auto auto;
5+
6+
row-gap: 2rem;
7+
8+
column-gap: 2rem;
9+
10+
width: 80%;
11+
12+
> :first-child,
13+
> :nth-child(2) {
14+
grid-column: 1 / 3;
15+
}
16+
17+
@media (max-width: 1000px) {
18+
grid-template-columns: auto;
19+
20+
> :first-child,
21+
> :nth-child(2) {
22+
grid-column: 1;
23+
}
24+
}
25+
}

‎app/src/styles/SocialsList.module.scss

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
.social {
66
width: 40px;
77
height: 40px;
8+
9+
filter: brightness(0) saturate(100%) invert(18%) sepia(18%) saturate(6050%)
10+
hue-rotate(215deg) brightness(95%) contrast(95%);
11+
12+
&:hover {
13+
filter: brightness(0) saturate(100%) invert(25%) sepia(71%) saturate(627%)
14+
hue-rotate(198deg) brightness(98%) contrast(84%);
15+
}
816
}
917

1018
.light {

0 commit comments

Comments
 (0)
Please sign in to comment.