Skip to content

Commit 81cd8e5

Browse files
authored
Merge pull request #110 from dkstlzk/main
fix: Profile card alignment, background & 2D-Tree scaling
2 parents c059503 + f5c897b commit 81cd8e5

File tree

7 files changed

+118
-32
lines changed

7 files changed

+118
-32
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"xlsx": "^0.18.5"
3939
},
4040
"scripts": {
41-
"start": "PORT=8003 react-scripts start",
41+
"start": "cross-env PORT=8003 react-scripts start",
4242
"build": "react-scripts build",
4343
"test": "react-scripts test",
4444
"eject": "react-scripts eject"

frontend/src/assets/Style/home.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.home{
22
filter: blur(10px);
3+
width: 100%;
4+
height: 100vh;
35
position: relative;
46
}
7+
58
.typewriterStyle{
69
position: absolute;
710
top: 4%;

frontend/src/assets/Style/profile.css

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,79 @@
11
.modalprofile {
2-
position:fixed;
3-
top: 36%;
4-
right: 1%;
5-
height: 100%;
2+
position: fixed;
3+
top: 50%;
4+
left: 50%;
5+
transform: translate(-50%, -50%); /* Ensures proper centering */
66
display: flex;
77
align-items: center;
8-
}
9-
10-
.modal-contentprofile {
8+
justify-content: center;
9+
height: auto;
10+
z-index: 1000;
11+
width: fit-content; /* Adjusts width dynamically */
12+
min-width: 300px;
13+
max-width: 90vw; /* Prevents it from being too wide */
14+
}
15+
16+
.modal-contentprofile {
1117
background-color: rgb(165, 201, 221);
12-
border-radius: 5px;
18+
border-radius: 10px;
1319
box-shadow: 2px 5px 10px rgba(20, 20, 20, 0.261);
1420
padding: 20px;
21+
width: 300px; /* Ensures uniform size */
22+
text-align: center;
23+
}
1524

16-
}
25+
/*
1726
.closespro {
1827
position: relative;
1928
top: -180px;
2029
font-size: 1.7rem;
2130
cursor: pointer;
22-
}
23-
.imagepro{
31+
} */
32+
33+
.closespro {
34+
position: absolute;
35+
top: 10px;
36+
right: 15px; /* Aligns it to the top-right */
37+
font-size: 1.7rem;
38+
cursor: pointer;
39+
}
40+
41+
42+
/* .imagepro{
2443
position: relative;
2544
border-radius: 50%;
2645
height: 200px;
2746
width: 200px;
28-
}
47+
} */
48+
49+
.imagepro {
50+
display: block;
51+
margin: 0 auto; /* Ensures the image is centered */
52+
border-radius: 50%;
53+
height: 200px;
54+
width: 200px;
55+
}
56+
57+
2958
.linkedicon{
3059
/* color: #0077B5; */
3160
font-size: 1.5rem;
3261
cursor: pointer;
3362
}
34-
.iconbutton{
63+
64+
/* .iconbutton{
3565
color: #0000005d;
3666
font-size: 1.5rem;
3767
font-weight: 900;
3868
position: relative;
3969
left: 30%;
40-
}
70+
} */
71+
72+
.iconbutton {
73+
color: #0000005d;
74+
font-size: 1.5rem;
75+
font-weight: 900;
76+
position: relative;
77+
left: 50%;
78+
transform: translateX(-50%); /* Ensures perfect centering */
79+
}

frontend/src/assets/Style/tree.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
.tree_{
1+
.tree_ {
22
display: flex;
3-
justify-content: center;
4-
align-items: center;
3+
justify-content: center; /* Centers the tree horizontally */
4+
align-items: center; /* Adjusts alignment */
55
height: 100vh;
66
width: 100vw;
7-
min-width: 2400px;
8-
min-height: 100vh;
7+
overflow: auto; /* Ensure it scrolls properly */
98
}
9+
10+
1011
.tree_ ul {
1112
padding-top: 20px;
1213
position: relative;

frontend/src/components/2DTree.jsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,34 @@ const TwoDTree = ({ data }) => {
117117
strokeWidth: 10,
118118
});
119119

120+
const handleNodeMouseOver = (nodeDatum, event) => {
121+
if (nodeDatum.name !== 'All') {
122+
setroll(nodeDatum)
123+
setShowModal(true)
124+
125+
}
126+
};
127+
const handleNodeMouseOut = (nodeData, event) => {
128+
if (nodeData.name !== 'All') {
129+
setShowModal(false)
130+
}
131+
};
132+
// const dimensions = {
133+
// width: 800,
134+
// height: 600
135+
// };
136+
137+
const dimensions = {
138+
width: window.innerWidth, // Full screen width
139+
height: window.innerHeight // Full screen height
140+
};
141+
142+
<Tree
143+
data={new_data}
144+
translate={{ x: dimensions.width / 2, y: dimensions.height / 2 }} // Center both horizontally & vertically
145+
dimensions={dimensions}
146+
/>
147+
120148
return (
121149
<>
122150
{/* {showModal && <Profile rollNo={roll.rollNo} />} */}

frontend/src/pages/Home.jsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,27 @@ const Home = ({data}) => {
88
const team=()=>{
99
setteamshow(!teamshow)
1010
}
11-
const mystyle={
12-
backgroundImage: `url(${background})`,
13-
backdropFilter: "blur(6px)",
11+
// const mystyle={
12+
// backgroundImage: `url(${background})`,
13+
// backdropFilter: "blur(6px)",
14+
// backgroundSize: "cover",
15+
// backgroundRepeat: "no-repeat",
16+
// height: "100vh",
17+
// opacity: '0.8',
18+
// };
19+
20+
const mystyle = {
21+
backgroundImage: `url(${background})`, // Corrected syntax
1422
backgroundSize: "cover",
23+
backgroundPosition: "center",
1524
backgroundRepeat: "no-repeat",
1625
height: "100vh",
17-
opacity: '0.8',
18-
};
26+
width: "100%",
27+
opacity: 0.8,
28+
};
29+
30+
31+
1932
return (
2033

2134
<>

frontend/src/pages/Search.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,20 @@ const Search = () => {
6767
})
6868

6969
return navigate('/')
70-
7170
}
72-
const mystyle={
73-
backgroundImage: `url(${background})`,
71+
72+
const mystyle = {
73+
backgroundImage: `url(${background})`, // Corrected syntax
7474
backgroundSize: "cover",
75+
backdropFilter: "blur(6px)",
76+
backgroundPosition: "center",
7577
backgroundRepeat: "no-repeat",
7678
height: "100vh",
77-
opacity: '0.8',
78-
minWidth: "2400px",
7979
width: "100%",
80-
81-
};
80+
opacity: 0.8,
81+
};
82+
83+
8284
return (
8385
<div className='topmargin'>
8486
<ToastContainer />

0 commit comments

Comments
 (0)