responsive to the moon

This commit is contained in:
AntoninoP 2024-09-21 16:48:27 +02:00
parent f90ef12102
commit 337f77a81a
8 changed files with 122 additions and 13 deletions

View File

@ -81,9 +81,16 @@
color: var(--primary-color); color: var(--primary-color);
margin-right: auto; margin-right: auto;
margin-left: 2rem; margin-left: 2rem;
} }
.backIcon { .backIcon {
margin-right: 0.5rem; margin-right: 0.5rem;
font-size: 1.5rem; font-size: 1.5rem;
} }
@media (max-width: 650px) {
.backButton{
font-size: 1.25rem;
}
}

View File

@ -59,7 +59,7 @@ img {
background-color: #2f2f2f; background-color: #2f2f2f;
color: white; color: white;
cursor: pointer; cursor: pointer;
border: none;
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
} }
@ -84,4 +84,26 @@ img {
.imgCard{ .imgCard{
width: 22rem; width: 22rem;
height: auto; height: auto;
} }
@media (max-width: 1000px) {
.GamesContainer {
flex-direction: column;
flex-wrap: row;
margin-top: 40rem;
height: 100%;
}
.GameCard {
margin: 1rem;
width: 20rem;
padding: 2.5rem;
}
}
@media (max-width: 750px) {
.GamesContainer {
margin-top: 50rem;
}
}

View File

@ -126,3 +126,15 @@
background-color: #145a32; background-color: #145a32;
transform: scale(1.05); transform: scale(1.05);
} }
@media (max-width: 900px) {
.VersionContainer {
grid-template-columns: repeat(4, 1fr);
}
.inputContainer.inputValid {
transform: translateX(-20%);
}
}

View File

@ -52,4 +52,34 @@ input {
.playerName { .playerName {
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 400; font-weight: 400;
} }
@media (max-width: 650px) {
input {
font-size: 1rem;
padding: .35rem;
}
.sendButton {
margin-left: .25rem;
padding: .35rem .75rem;
}
.titlesection {
font-size: 1.5rem;
}
.playerAvatar {
width: 1.5rem;
height: 1.5rem;
}
.playerName {
font-size: 1rem;
}
}

View File

@ -11,7 +11,7 @@ import PropTypes from "prop-types";
import { FaCogs, FaUserFriends, FaGlobe, FaHistory, FaClipboardList, FaSave, FaLock } from 'react-icons/fa'; import { FaCogs, FaUserFriends, FaGlobe, FaHistory, FaClipboardList, FaSave, FaLock } from 'react-icons/fa';
import { FiChevronsLeft, FiChevronsRight } from "react-icons/fi"; import { FiChevronsLeft, FiChevronsRight } from "react-icons/fi";
import NotFoundPage from '../NotFoundPage/NotFoundPage'; import NotFoundPage from '../NotFoundPage/NotFoundPage';
import { useLocation,useNavigate} from 'react-router-dom'; import { useLocation, useNavigate } from 'react-router-dom';
const ServerDetails = ({ user }) => { const ServerDetails = ({ user }) => {
const { serverName } = useParams(); const { serverName } = useParams();
@ -19,7 +19,18 @@ const ServerDetails = ({ user }) => {
const navigate = useNavigate(); const navigate = useNavigate();
const initialStatus = location.state?.status ?? JSON.parse(localStorage.getItem('status')) ?? false; const initialStatus = location.state?.status ?? JSON.parse(localStorage.getItem('status')) ?? false;
const [status, setStatus] = useState(initialStatus); const [status, setStatus] = useState(initialStatus);
const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false); const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(window.innerWidth < 900);
useEffect(() => {
const handleResize = () => {
setIsSidebarCollapsed(window.innerWidth < 900);
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
useEffect(() => { useEffect(() => {
if (location.pathname.includes('/console')) { if (location.pathname.includes('/console')) {
@ -47,46 +58,45 @@ const ServerDetails = ({ user }) => {
<NavLink <NavLink
to={`/server/${serverName}/options`} to={`/server/${serverName}/options`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaCogs /> {!isSidebarCollapsed && 'Propriétés'} <FaCogs style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Propriétés'}
</NavLink> </NavLink>
<NavLink <NavLink
state={{ status }} state={{ status }}
to={`/server/${serverName}/console`} to={`/server/${serverName}/console`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaClipboardList /> {!isSidebarCollapsed && 'Console'} <FaClipboardList style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Console'}
</NavLink> </NavLink>
<NavLink <NavLink
to={`/server/${serverName}/history`} to={`/server/${serverName}/history`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaHistory /> {!isSidebarCollapsed && 'Historique'} <FaHistory style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Historique'}
</NavLink> </NavLink>
<NavLink <NavLink
to={`/server/${serverName}/players`} to={`/server/${serverName}/players`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaUserFriends /> {!isSidebarCollapsed && 'Joueurs'} <FaUserFriends style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Joueurs'}
</NavLink> </NavLink>
<NavLink <NavLink
to={`/server/${serverName}/worlds`} to={`/server/${serverName}/worlds`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaGlobe /> {!isSidebarCollapsed && 'Mondes'} <FaGlobe style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Mondes'}
</NavLink> </NavLink>
<NavLink <NavLink
to={`/server/${serverName}/backups`} to={`/server/${serverName}/backups`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaSave /> {!isSidebarCollapsed && 'Sauvegardes'} <FaSave style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Sauvegardes'}
</NavLink> </NavLink>
<NavLink <NavLink
to={`/server/${serverName}/access`} to={`/server/${serverName}/access`}
className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}> className={({ isActive }) => isActive ? `${styles.menuItem} ${styles.active}` : styles.menuItem}>
<FaLock /> {!isSidebarCollapsed && 'Accès'} <FaLock style={{ fontSize: isSidebarCollapsed ? '1.5rem' : '1.25rem' }} /> {!isSidebarCollapsed && 'Accès'}
</NavLink> </NavLink>
</div> </div>
</div> </div>
<div className={styles.serverDetailsContainer}> <div className={styles.serverDetailsContainer}>

View File

@ -81,3 +81,11 @@
.container.collapsed .serverDetailsContainer { .container.collapsed .serverDetailsContainer {
margin-left: 5rem; // largeur mode rétracté margin-left: 5rem; // largeur mode rétracté
} }
@media (max-width: 950px) {
.menuItem svg {
font-size: 2.25rem;
}
}

View File

@ -52,3 +52,15 @@
color: black; color: black;
font-weight: bold; font-weight: bold;
} }
@media (max-width: 650px) {
.filterContainer {
padding: 2rem;
font-size: 1rem;
}
.historyCard {
padding: .5rem;
}
}

View File

@ -107,6 +107,14 @@
text-align: center; text-align: center;
} }
@media (max-width: 700px) {
.formRow {
display: flex;
flex-direction: column;
}
}
@media (max-width: 48rem) { @media (max-width: 48rem) {
.details { .details {
width: 90%; width: 90%;