Skip to content

Commit a7d789b

Browse files
committed
Add .htaccess file, update home page layout, add StatisticBanner feature, finalize banner design
1 parent 2fee9b8 commit a7d789b

File tree

5 files changed

+78
-62
lines changed

5 files changed

+78
-62
lines changed

public/.htaccess

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<IfModule mod_rewrite.c>
2+
3+
RewriteEngine on
4+
# RewriteBase /dev/dev-fan
5+
6+
# Don't rewrite files or directories
7+
RewriteCond %{REQUEST_FILENAME} -f [OR]
8+
RewriteCond %{REQUEST_FILENAME} -d
9+
RewriteRule ^ - [L]
10+
11+
# Rewrite everything else to index.html to allow html5 state links
12+
RewriteRule ^ /dev/dev-fan/index.html [L]
13+
14+
#RewriteCond %{REQUEST_FILENAME} (.*)/databases/.*$
15+
#RewriteRule ^(.*)/databases/.*  $1/index.html [QSA,L]
16+
</IfModule>

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="es">
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<link rel="icon" href="io_fav.png" />

src/components/StatisticsBanner.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import PeopleAltIcon from "@mui/icons-material/PeopleAlt";
44
import StorageIcon from "@mui/icons-material/Storage";
55
import TopicIcon from "@mui/icons-material/Topic";
66
import { Box, Typography } from "@mui/material";
7-
import axios from "axios";
87
import { Colors } from "design/theme";
98
import { useAppDispatch } from "hooks/useAppDispatch";
109
import { useAppSelector } from "hooks/useAppSelector";
@@ -51,16 +50,21 @@ const StatisticsBanner: React.FC = () => {
5150
<Box
5251
sx={{
5352
backgroundColor: "rgba(0, 0, 0, 0.5)",
53+
backdropFilter: "blur(15px)",
5454
borderRadius: "8px",
55-
backdropFilter: "blur(20px)",
5655
zIndex: 100,
57-
padding: "1rem 2rem",
56+
padding: "1rem",
5857
position: "absolute",
59-
bottom: "5%",
58+
// top: "2%",
59+
// top: "20%",
60+
// left: "8%",
61+
bottom: "13%",
6062
left: "50%",
6163
transform: "translateX(-50%)",
6264
display: "flex",
63-
gap: "5rem",
65+
// flexDirection: "column",
66+
// flexWrap: "wrap",
67+
gap: "2rem",
6468
}}
6569
>
6670
{/* Databases */}

src/design/Layouts/FullScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const FullScreen = () => {
139139
sx={{
140140
width: "100%",
141141
height: "calc(100vh - 6rem)",
142+
// minHeight: "calc(100vh - 6rem)",
142143
boxSizing: "border-box",
143144
marginTop: "6rem",
144145
// backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2000 1500'%3E%3Cdefs%3E%3CradialGradient id='a' gradientUnits='objectBoundingBox'%3E%3Cstop offset='0' stop-color='%23282C56'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/radialGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='0' y1='750' x2='1550' y2='750'%3E%3Cstop offset='0' stop-color='%234049a4'/%3E%3Cstop offset='1' stop-color='%235865F2'/%3E%3C/linearGradient%3E%3Cpath id='s' fill='url(%23b)' d='M1549.2 51.6c-5.4 99.1-20.2 197.6-44.2 293.6c-24.1 96-57.4 189.4-99.3 278.6c-41.9 89.2-92.4 174.1-150.3 253.3c-58 79.2-123.4 152.6-195.1 219c-71.7 66.4-149.6 125.8-232.2 177.2c-82.7 51.4-170.1 94.7-260.7 129.1c-90.6 34.4-184.4 60-279.5 76.3C192.6 1495 96.1 1502 0 1500c96.1-2.1 191.8-13.3 285.4-33.6c93.6-20.2 185-49.5 272.5-87.2c87.6-37.7 171.3-83.8 249.6-137.3c78.4-53.5 151.5-114.5 217.9-181.7c66.5-67.2 126.4-140.7 178.6-218.9c52.3-78.3 96.9-161.4 133-247.9c36.1-86.5 63.8-176.2 82.6-267.6c18.8-91.4 28.6-184.4 29.6-277.4c0.3-27.6 23.2-48.7 50.8-48.4s49.5 21.8 49.2 49.5c0 0.7 0 1.3-0.1 2L1549.2 51.6z'/%3E%3Cg id='g'%3E%3Cuse href='%23s' transform='scale(0.12) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.2) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.25) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(0.3) rotate(-20)'/%3E%3Cuse href='%23s' transform='scale(0.4) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(0.5) rotate(20)'/%3E%3Cuse href='%23s' transform='scale(0.6) rotate(60)'/%3E%3Cuse href='%23s' transform='scale(0.7) rotate(10)'/%3E%3Cuse href='%23s' transform='scale(0.835) rotate(-40)'/%3E%3Cuse href='%23s' transform='scale(0.9) rotate(40)'/%3E%3Cuse href='%23s' transform='scale(1.05) rotate(25)'/%3E%3Cuse href='%23s' transform='scale(1.2) rotate(8)'/%3E%3Cuse href='%23s' transform='scale(1.333) rotate(-60)'/%3E%3Cuse href='%23s' transform='scale(1.45) rotate(-30)'/%3E%3Cuse href='%23s' transform='scale(1.6) rotate(10)'/%3E%3C/g%3E%3C/defs%3E%3Cg transform='translate(400 0)'%3E%3Cg %3E%3Ccircle fill='url(%23a)' r='3000'/%3E%3Cg opacity='0.5'%3E%3Ccircle fill='url(%23a)' r='2000'/%3E%3Ccircle fill='url(%23a)' r='1800'/%3E%3Ccircle fill='url(%23a)' r='1700'/%3E%3Ccircle fill='url(%23a)' r='1651'/%3E%3Ccircle fill='url(%23a)' r='1450'/%3E%3Ccircle fill='url(%23a)' r='1250'/%3E%3Ccircle fill='url(%23a)' r='1175'/%3E%3Ccircle fill='url(%23a)' r='900'/%3E%3Ccircle fill='url(%23a)' r='750'/%3E%3Ccircle fill='url(%23a)' r='500'/%3E%3Ccircle fill='url(%23a)' r='380'/%3E%3Ccircle fill='url(%23a)' r='250'/%3E%3C/g%3E%3Cg transform='rotate(-273.6 0 0)'%3E%3Cuse href='%23g' transform='rotate(10)'/%3E%3Cuse href='%23g' transform='rotate(120)'/%3E%3Cuse href='%23g' transform='rotate(240)'/%3E%3C/g%3E%3Ccircle fill-opacity='0.61' fill='url(%23a)' r='3000'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,

src/pages/Home.tsx

Lines changed: 51 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,12 @@ const Home: React.FC = () => {
3535
}, [dispatch]);
3636

3737
// Handle node click: Set selected node and open panel
38-
// const handleNodeClick = (node: NodeObject) => {
39-
// setSelectedNode(node);
40-
// setPanelOpen(true);
41-
// };
4238
const handleNodeClick = useCallback((node: NodeObject) => {
4339
setSelectedNode(node);
4440
setPanelOpen(true);
4541
}, []);
4642

4743
// filter logic
48-
// const filteredRegistry = registry
49-
// ? registry.filter((node) => {
50-
// const matchKeyword = node.name
51-
// .toLowerCase()
52-
// .includes(filterKeyword.toLowerCase());
53-
// const matchModalities =
54-
// selectedModalities.length === 0 ||
55-
// selectedModalities.some((modality) =>
56-
// Array.isArray(node.datatype)
57-
// ? node.datatype.includes(modality)
58-
// : node.datatype === modality
59-
// );
60-
61-
// return matchKeyword && matchModalities;
62-
// })
63-
// : [];
64-
6544
const filteredRegistry = useMemo(() => {
6645
return registry
6746
? registry.filter((node) => {
@@ -91,70 +70,87 @@ const Home: React.FC = () => {
9170
minHeight: "500px", // make sure the view databases card won't be cut when no nodes showing
9271
// display: "flex",
9372
// flexDirection: "column",
73+
// minHeight: "100vh",
9474
}}
9575
>
96-
{/* Filter Menu Button */}
97-
<Box sx={{ position: "absolute", top: 20, right: 20, zIndex: 10 }}>
98-
<FilterMenu
99-
onKeywordFilter={setFilterKeyword}
100-
onModalitiesFilter={setSelectedModalities}
101-
filterKeyword={filterKeyword}
102-
homeSelectedModalities={selectedModalities}
103-
/>
104-
</Box>
105-
<Box
76+
<Box // add box for group StatisticsBanner and 3d-graph
10677
sx={{
107-
zIndex: "2",
108-
position: "relative",
78+
flex: "2",
10979
width: "100%",
80+
position: "relative",
11081
overflow: "hidden",
82+
// minHeight: "100vh",
83+
// minHeight: "90%",
84+
// maxHeight: "80vh",
11185
}}
11286
>
113-
{!registry ? (
114-
<Box sx={{ display: "flex", justifyContent: "center", mt: 4 }}>
115-
<CircularProgress sx={{ color: Colors.primary.main }} />
116-
</Box>
117-
) : filteredRegistry.length > 0 ? (
118-
<NeuroJsonGraph
119-
registry={filteredRegistry}
120-
onNodeClick={handleNodeClick}
87+
{/* Filter Menu Button */}
88+
<Box sx={{ position: "absolute", top: 20, right: 20, zIndex: 10 }}>
89+
<FilterMenu
90+
onKeywordFilter={setFilterKeyword}
91+
onModalitiesFilter={setSelectedModalities}
92+
filterKeyword={filterKeyword}
93+
homeSelectedModalities={selectedModalities}
12194
/>
122-
) : (
123-
<Box sx={{ textAlign: "center", mt: 4 }}>
124-
<Typography variant="h6" color={Colors.textSecondary}>
125-
No matching nodes found
126-
</Typography>
127-
</Box>
128-
)}
95+
</Box>
96+
<Box
97+
sx={{
98+
zIndex: "2",
99+
position: "relative",
100+
width: "100%",
101+
overflow: "hidden",
102+
}}
103+
>
104+
{!registry ? (
105+
<Box sx={{ display: "flex", justifyContent: "center", mt: 4 }}>
106+
<CircularProgress sx={{ color: Colors.primary.main }} />
107+
</Box>
108+
) : filteredRegistry.length > 0 ? (
109+
<NeuroJsonGraph
110+
registry={filteredRegistry}
111+
onNodeClick={handleNodeClick}
112+
/>
113+
) : (
114+
<Box sx={{ textAlign: "center", mt: 4 }}>
115+
<Typography variant="h6" color={Colors.textSecondary}>
116+
No matching nodes found
117+
</Typography>
118+
</Box>
119+
)}
120+
</Box>
121+
<StatisticsBanner />
129122
</Box>
130123

131124
<Box
132125
sx={{
133126
overflow: "hidden",
134127
maxWidth: "35%",
135-
// border: "2px yellow solid",
136128
// width: "100%",
137-
zIndex: "3",
129+
zIndex: 3,
138130
position: "absolute",
139-
top: "10%",
131+
top: "5%",
140132
left: "1%",
141133
backgroundColor: "rgba(97, 109, 243, 0.4)",
142134
// backgroundColor: "rgba(160, 165, 194, 0.4)",
143135
backdropFilter: "blur(10px)",
144-
// boxShadow: `2px 2px 5px ${Colors.lightGray}`,
145-
padding: "1.5rem",
136+
// backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900'%3E%3Cpolygon fill='%235865f2' points='957 450 539 900 1396 900'/%3E%3Cpolygon fill='%2302dec4' points='957 450 872.9 900 1396 900'/%3E%3Cpolygon fill='%234c59d1' points='-60 900 398 662 816 900'/%3E%3Cpolygon fill='%2347e3a9' points='337 900 398 662 816 900'/%3E%3Cpolygon fill='%23424eb1' points='1203 546 1552 900 876 900'/%3E%3Cpolygon fill='%2377e789' points='1203 546 1552 900 1162 900'/%3E%3Cpolygon fill='%23394392' points='641 695 886 900 367 900'/%3E%3Cpolygon fill='%23a3e768' points='587 900 641 695 886 900'/%3E%3Cpolygon fill='%23303773' points='1710 900 1401 632 1096 900'/%3E%3Cpolygon fill='%23d1e449' points='1710 900 1401 632 1365 900'/%3E%3Cpolygon fill='%23282c56' points='1210 900 971 687 725 900'/%3E%3Cpolygon fill='%23ffdd31' points='943 900 1210 900 971 687'/%3E%3C/svg%3E")`,
137+
// backgroundAttachment: "local",
138+
// backgroundSize: "cover",
139+
padding: { xs: "1rem", sm: "1rem", md: "1.5rem" }, // Responsive padding
146140
borderRadius: "8px",
141+
flexShrink: 0,
142+
// minHeight: "800px",
147143
}}
148144
>
149145
{/* Header Section */}
150146
<Typography
151147
variant="h3"
152148
gutterBottom
153-
sx={{ color: Colors.white, fontWeight: "medium" }}
149+
sx={{ color: Colors.lightGray, fontWeight: "medium" }}
154150
>
155151
Discover NeuroJSON.io
156152
</Typography>
157-
<Typography variant="body1" sx={{ color: Colors.white }}>
153+
<Typography variant="body1" sx={{ color: Colors.lightGray }}>
158154
Efficiently manage and explore your CouchDB databases and datasets
159155
with ease.
160156
</Typography>
@@ -185,7 +181,6 @@ const Home: React.FC = () => {
185181
onClose={() => setPanelOpen(false)}
186182
nodeData={selectedNode}
187183
/>
188-
<StatisticsBanner />
189184
</Container>
190185
);
191186
};

0 commit comments

Comments
 (0)