[frontend]: Make CSS more responsive for small screens
This commit is contained in:
@ -303,7 +303,9 @@ function App() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: "10px",
|
top: "1vh",
|
||||||
|
height: "5vh",
|
||||||
|
width: "250px", minWidth: "50px",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translateX(-50%)",
|
transform: "translateX(-50%)",
|
||||||
zIndex: 1000
|
zIndex: 1000
|
||||||
|
@ -5,7 +5,7 @@ const LoadingOverlay = ({ message }) => (
|
|||||||
<div style={{
|
<div style={{
|
||||||
position: "absolute", top: 0, left: 0, width: "100%", height: "100%",
|
position: "absolute", top: 0, left: 0, width: "100%", height: "100%",
|
||||||
background: "rgba(0, 0, 0, 0.5)", display: "flex",
|
background: "rgba(0, 0, 0, 0.5)", display: "flex",
|
||||||
alignItems: "center", justifyContent: "center",
|
alignItems: "center", justifyContent: "center", textAlign: "center",
|
||||||
color: "white", fontSize: "20px", fontWeight: "bold",
|
color: "white", fontSize: "20px", fontWeight: "bold",
|
||||||
zIndex: 1000
|
zIndex: 1000
|
||||||
}}>
|
}}>
|
||||||
|
@ -132,7 +132,7 @@ const CheckboxItem = ({ item, selectedSources, setSelectedSources, enabledSource
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setClusteringEnabled, fetchData }) => {
|
const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setClusteringEnabled, fetchData }) => {
|
||||||
const [isOpen, setIsOpen] = useState(true);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [enabledSources, setEnabledSources] = useState([]); // New state to track enabled sources
|
const [enabledSources, setEnabledSources] = useState([]); // New state to track enabled sources
|
||||||
|
|
||||||
// Load selected sources from cookies or set all as default checked
|
// Load selected sources from cookies or set all as default checked
|
||||||
@ -153,11 +153,11 @@ const Sidebar = ({ selectedSources, setSelectedSources, clusteringEnabled, setCl
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
position: "absolute", top: "10px", right: "10px",
|
position: "absolute", top: window.innerWidth < 900 ? "8vh" : "1vh", right: "1vh",
|
||||||
width: "250px", minWidth: "50px",
|
width: "250px", minWidth: "50px",
|
||||||
padding: isOpen ? "10px" : "5px 10px", background: "rgba(255, 255, 255, 0.9)", color: "black",
|
padding: isOpen ? "10px" : "5px 10px", background: "rgba(255, 255, 255, 0.9)", color: "black",
|
||||||
borderRadius: "10px", transition: "height 0.2s ease-in-out, padding 0.2s ease-in-out",
|
borderRadius: "10px", transition: "height 0.2s ease-in-out, padding 0.2s ease-in-out",
|
||||||
height: isOpen ? "auto" : "40px", display: "flex", flexDirection: "column",
|
height: isOpen ? "auto" : "5vh", display: "flex", flexDirection: "column",
|
||||||
alignItems: "center", zIndex: 1000, overflow: "hidden", justifyContent: "center"
|
alignItems: "center", zIndex: 1000, overflow: "hidden", justifyContent: "center"
|
||||||
}}>
|
}}>
|
||||||
<button onClick={() => setIsOpen(!isOpen)} style={{ background: "none", border: "none", color: "black" }}>
|
<button onClick={() => setIsOpen(!isOpen)} style={{ background: "none", border: "none", color: "black" }}>
|
||||||
|
Reference in New Issue
Block a user