Skip to content

Commit 144330d

Browse files
authored
Merge pull request #79 from OCA-UFCG/feat/team-member-v3
Implements the third version of the members section
2 parents 5a7867f + 1c3ecfe commit 144330d

File tree

8 files changed

+220
-89
lines changed

8 files changed

+220
-89
lines changed

public/sprite.svg

Lines changed: 1 addition & 1 deletion
Loading

src/app/globalStyles.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,28 @@ export const GlobalStyles = createGlobalStyle`
7575
}
7676
}
7777
78+
@keyframes close {
79+
0% {
80+
height: fit-content;
81+
}
82+
100% {
83+
opacity: 0;
84+
height: 0px;
85+
padding: 0;
86+
}
87+
}
88+
89+
@keyframes open {
90+
0% {
91+
opacity: 0;
92+
height: 0px;
93+
padding: 0;
94+
}
95+
100% {
96+
height: fit-content;
97+
}
98+
}
99+
78100
@keyframes expandWidth {
79101
from {
80102
width: 0%;

src/app/team/page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
"use client";
22

3-
import { TeamMembersWrapper } from "./styles";
43
import TeamMembersSection from "@/components/TeamMember/Section/TeamMembers";
54
import Template from "@/templates/hubTemplate";
65

76
const TeamPage = () => (
87
<Template>
9-
<TeamMembersWrapper>
10-
<TeamMembersSection />
11-
</TeamMembersWrapper>
8+
<TeamMembersSection />
129
</Template>
1310
);
1411

src/app/team/styles.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ import styled from "styled-components";
33
export const TeamMembersWrapper = styled.section`
44
display: flex;
55
margin-top: 4rem;
6+
justify-content: center;
67
`;

src/components/TeamMember/Section/TeamMembers.styles.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
import { Section as DefaultSection } from "@/app/globalStyles";
12
import styled from "styled-components";
23

4+
export const Section = styled(DefaultSection)`
5+
margin-top: 4rem;
6+
align-items: center;
7+
`;
8+
39
export const TeamMembersContainer = styled.div`
4-
display: flex;
5-
flex-wrap: wrap;
610
justify-content: center;
711
padding: 1rem;
8-
gap: 2rem 5rem;
12+
gap: 2rem;
13+
column-count: 4;
14+
width: fit-content;
15+
16+
@media screen and (max-width: 1200px) {
17+
column-count: 3;
18+
}
19+
20+
@media screen and (max-width: 900px) {
21+
column-count: 2;
22+
}
23+
24+
@media screen and (max-width: 600px) {
25+
column-count: 1;
26+
}
927
`;
1028

1129
export const SubTitleMembers = styled.h2`

src/components/TeamMember/Section/TeamMembers.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use client";
22

3-
import { Section, SectionTitle } from "@/app/globalStyles";
4-
import { TeamMembersContainer, SubTitleMembers } from "./TeamMembers.styles";
3+
import { SectionTitle } from "@/app/globalStyles";
4+
import {
5+
TeamMembersContainer,
6+
SubTitleMembers,
7+
Section,
8+
} from "./TeamMembers.styles";
59
import TeamMember from "../TeamMember";
610
import { useContext, useEffect, useState } from "react";
711
import { CMSContext } from "@/contexts/ContentProvider";

src/components/TeamMember/TeamMember.styles.ts

Lines changed: 85 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,85 +3,133 @@ import Image from "next/image";
33
import Link from "next/link";
44
import { Icon } from "@/components/Icon/Icon";
55

6-
export const ExpandIcon = styled(Icon)`
7-
position: absolute;
6+
export const Checkbox = styled.input``;
7+
8+
export const ExpandIcon = styled(Icon)<{ expanded: string }>`
89
color: ${({ theme }) => theme.colors.black};
9-
opacity: 0;
10-
z-index: 1;
1110
align-self: center;
12-
margin-top: 2.25rem;
13-
cursor: pointer;
14-
`;
11+
opacity: 0.5;
12+
transition: 300ms;
13+
transform: rotate(180deg);
1514
16-
export const Avatar = styled(Image)`
17-
position: relative;
18-
border-radius: 50%;
19-
height: 6rem;
20-
width: 6rem;
15+
${Checkbox}:checked ~ & {
16+
transform: rotate(0deg);
17+
}
2118
`;
2219

23-
export const InfoContainer = styled.div`
20+
export const Wrapper = styled.label`
2421
display: flex;
2522
align-items: center;
2623
width: auto;
2724
gap: 0.5rem;
2825
flex-direction: column;
26+
break-inside: avoid;
27+
width: 16rem;
28+
box-shadow: 0 0 5px #cdcdcd;
29+
background-color: white;
30+
margin-bottom: 2rem;
31+
cursor: pointer;
32+
2933
&:hover ${ExpandIcon} {
3034
opacity: 1;
31-
animation: pulse 0.5s;
35+
width: 6rem;
3236
}
37+
`;
38+
39+
export const Avatar = styled(Image)`
40+
position: relative;
41+
width: 100%;
42+
height: auto;
43+
box-shadow: inset 0 0 5px #cdcdcd;
44+
`;
45+
46+
export const InfoContainer = styled.div`
47+
display: flex;
48+
width: 100%;
49+
padding: 0.75rem 1rem;
50+
box-sizing: border-box;
51+
gap: 0.5rem;
52+
flex-direction: column;
53+
3354
&:hover ${Avatar} {
3455
opacity: 0.4;
3556
filter: blur(2px);
3657
cursor: pointer;
3758
}
3859
`;
3960

40-
export const Wrapper = styled.div`
61+
export const MainInfoContainer = styled.div`
4162
display: flex;
42-
align-items: center;
43-
width: auto;
44-
gap: 0.5rem;
45-
flex-direction: column;
63+
flex-flow: column;
4664
`;
4765

4866
export const Name = styled.span`
4967
font-weight: bold;
5068
font-size: 1.1rem;
51-
52-
@media (max-width: 600px) {
53-
flex: 2;
54-
min-width: 7rem;
55-
text-align: center;
56-
font-size: 1rem;
57-
max-width: 8rem;
58-
}
5969
`;
6070

6171
export const Role = styled.span`
62-
margin-bottom: 0.5rem;
63-
font-size: 0.9rem;
72+
font-size: 0.8rem;
6473
color: ${({ theme }) => theme.colors.gray};
74+
`;
75+
76+
export const MoreInfoContainer = styled.div`
77+
display: flex;
78+
flex-flow: column;
79+
gap: 0.75rem;
80+
transition: height 300ms;
81+
82+
overflow: hidden;
83+
padding: 0.5rem 0;
84+
border-top: 1px solid #cdcdcd;
85+
border-bottom: 1px solid #cdcdcd;
6586
66-
@media (max-width: 600px) {
67-
flex: 2;
68-
min-width: 7rem;
69-
text-align: center;
70-
font-size: 0.8rem;
87+
${Checkbox}:checked ~ & {
88+
animation: close 300ms ease-in-out forwards;
7189
}
90+
91+
:not(Checkbox:checked) ~ & {
92+
animation: open 300ms ease-in-out forwards;
93+
}
94+
`;
95+
96+
export const Institution = styled.span`
97+
font-size: 13px;
98+
`;
99+
100+
export const FieldWorkContainer = styled.div``;
101+
102+
export const FieldWorkTitleContainer = styled.div`
103+
display: flex;
104+
align-items: center;
105+
gap: 0.25rem;
106+
font-weight: bold;
107+
color: #222;
108+
`;
109+
export const FieldWorkTitle = styled.span`
110+
font-size: 14px;
111+
`;
112+
113+
export const FieldWorkWrapper = styled.div``;
114+
115+
export const FieldWork = styled.span`
116+
font-size: 13px;
72117
`;
73118

74119
export const Networks = styled.div`
75120
display: flex;
76121
gap: 0.5rem;
77-
align-items: center;
122+
/* align-items: flex-end;
123+
justify-content: center; */
124+
width: 100%;
78125
`;
79126

80127
export const Medias = styled(Link)`
128+
display: flex;
81129
transition: 0.2s;
82-
color: ${({ theme }) => theme.colors.black}90;
130+
color: ${({ theme }) => theme.colors.gray};
83131
&:hover {
84-
opacity: 0.6;
132+
transform: scale(1.1);
85133
}
86134
87135
img {

0 commit comments

Comments
 (0)