From 70f74d71a0ca14c626d29270c978a1f0c5f66860 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 24 Jul 2024 14:04:15 +0100 Subject: [PATCH] Add Basic Mobile support --- style/balance.css | 94 +++++++++++++++++++++++++++---------- style/components/button.css | 67 +++++++++++++++++++++----- style/components/card.css | 30 +++++++++++- style/components/images.css | 87 ++++++++++++++++++++++------------ style/components/video.css | 0 5 files changed, 209 insertions(+), 69 deletions(-) delete mode 100644 style/components/video.css diff --git a/style/balance.css b/style/balance.css index e44b218..10e32f6 100644 --- a/style/balance.css +++ b/style/balance.css @@ -13,10 +13,7 @@ h6 { font-family: "Ubuntu", sans-serif; font-style: normal; font-weight: normal; -} - -h3 { - margin: 10px 0px; + margin: 10px 0; } a { @@ -25,11 +22,11 @@ a { } ul { - padding: 10px 25px 10px 25px; + padding: 10px 25px; } li { - padding: 5px 0 5px 0; + padding: 5px 0; list-style: none; } @@ -42,11 +39,11 @@ header { } .Grid { - padding: 10px; /* Space inside the grid container */ - display: grid; /* Enable grid layout */ - grid-template-columns: 1fr 3fr 0.75fr; /* Define column sizes */ - gap: 20px; /* Space between grid items */ - margin: 0; /* Remove default margin */ + padding: 10px; + display: grid; + grid-template-columns: 1fr 3fr 0.75fr; + gap: 20px; + margin: 0; } .Content { @@ -97,29 +94,23 @@ header { position: sticky; /* Sticky positioning */ top: 20px; /* Distance from the top */ background: var(--IconGridBackground); /* Background color */ - padding: 5px 20px 20px 20px; /* Padding */ + padding: 5px 20px; /* Padding */ margin-left: 5px; /* Margin from the left */ color: var(--Text); /* Text color */ text-align: justify; /* Text alignment */ border-radius: 15px; /* Border radius */ display: grid; /* Enable grid layout */ grid-template-columns: repeat(4, 1fr); /* Four column layout */ - row-gap: 5px; /* Space between rows */ - column-gap: 5px; /* Space between columns */ + gap: 5px; /* Space between rows */ } /* Title in Icon Sidebar */ -.IconSidebarTitle { +.IconSidebarTitle, +.IconSidebarSubtitle { grid-column: 1 / -1; /* Spanning full width */ text-align: center; /* Centred text */ margin: 0; /* Remove default margin */ - padding: 10px 0 10px 0; /* Padding */ -} - -.IconSidebarSubtitle { - grid-column: 1 / -1; - text-align: left; - margin: 0; + padding: 10px 0; /* Padding */ } /* Subgrid in Icon Sidebar */ @@ -172,9 +163,64 @@ header { .Stat { border-radius: 8px; border: lightgray 1px solid; - padding: 3px 8px 3px 8px; + padding: 3px 8px; } .SectionHeader { - padding: 10px 0 10px 0; + padding: 10px 0; +} + +/* Responsive Design */ +@media (max-width: 768px) { + .Grid { + grid-template-columns: 1fr; + gap: 15px; + } + + .Sidebar { + grid-column: 1; + } + + .Content { + grid-column: 1; + } + + .IconSidebar { + grid-template-columns: repeat(3, 1fr); + } + + .IconSidebarSubgrid { + grid-template-columns: repeat(3, 1fr); + } + + .IconGrid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 420px) { + .Grid { + grid-template-columns: 1fr; + gap: 10px; + } + + .Sidebar { + grid-column: 1; + } + + .Content { + grid-column: 1; + } + + .IconSidebar { + grid-template-columns: repeat(2, 1fr); + } + + .IconSidebarSubgrid { + grid-template-columns: repeat(2, 1fr); + } + + .IconGrid { + grid-template-columns: 1fr; + } } diff --git a/style/components/button.css b/style/components/button.css index 5d3eeab..3e3977f 100644 --- a/style/components/button.css +++ b/style/components/button.css @@ -1,14 +1,55 @@ button { - border-radius: 5px; - padding: 8px; - background: var(--ButtonBackground); - color: var(--ButtonText); - border: none; - text-decoration: none; - font-size: 18px; -} - -button a{ - color: var(--Link); - text-decoration: none; -} \ No newline at end of file + border-radius: 5px; + padding: 12px 16px; + background: var(--ButtonBackground); + color: var(--ButtonText); + border: none; + text-decoration: none; + font-size: 16px; + cursor: pointer; + transition: background 0.3s ease, color 0.3 ease; + display: inline-flex; + align-items: center; + justify-content: center; +} + +button a { + color: inherit; + text-decoration: none; +} + +/* Hover and active states */ +button:hover { + background: var( + --ButtonHoverBackground, + darken(var(--ButtonBackground), 10%) + ); +} + +button:active { + background: var( + --ButtonActiveBackground, + darken(var(--ButtonBackground), 20%) + ); +} + +/* Focus styles for accessibility */ +button:focus { + outline: 2px solid var(--ButtonFocusOutline, #000); + outline-offset: 2px; +} + +/* Responsive design */ +@media (max-width: 768px) { + button { + font-size: 14px; /* Adjust font size for medium screens */ + padding: 10px 14px; /* Adjust padding for medium screens */ + } +} + +@media (max-width: 420px) { + button { + font-size: 12px; /* Adjust font size for small screens */ + padding: 8px 12px; /* Adjust padding for small screens */ + } +} diff --git a/style/components/card.css b/style/components/card.css index 9da7df1..e184840 100644 --- a/style/components/card.css +++ b/style/components/card.css @@ -3,12 +3,38 @@ .Card { background: var(--Card); border-radius: 1em; - padding: 5px 15px; + padding: 10px 20px; margin: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); color: var(--Text); + display: flex; + flex-direction: column; } .Card img { - margin-right: 15px; + margin-bottom: 15px; + max-width: 100%; + height: auto; + border-radius: 0.5em; +} + +/* Responsive design */ +@media (max-width: 768px) { + .Card { + padding: 8px 16px; /* Adjust padding for medium screens */ + margin: 15px; /* Adjust margin for medium screens */ + box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); /* Slightly lighter shadow */ + } +} + +@media (max-width: 420px) { + .Card { + padding: 6px 12px; /* Adjust padding for small screens */ + margin: 10px; /* Adjust margin for small screens */ + box-shadow: 0 0 6px rgba(0, 0, 0, 0.3); /* Lighter shadow for smaller screens */ + } + + .Card img { + margin-bottom: 10px; /* Adjust spacing below the image */ + } } diff --git a/style/components/images.css b/style/components/images.css index 4e88151..5ed9a2c 100644 --- a/style/components/images.css +++ b/style/components/images.css @@ -1,44 +1,71 @@ .ImageSlider { - position: relative; - display: inline-block; - line-height: 0; - border-radius: 1em; + position: relative; + display: block; + overflow: hidden; + border-radius: 1em; + max-width: 100%; } .ImageSlider > div { - border-right: 2px solid #00000099; - position: absolute; - top: 0; - left: 0; - width: 25px; - max-width: 100%; - overflow: hidden; - resize: horizontal; + border-right: 2px solid rgba(0, 0, 0, 0.6); + position: absolute; + top: 0; + left: 0; + width: 30px; + max-width: 100%; + overflow: hidden; + resize: horizontal; + z-index: 1; } .ImageSlider > div:before { - content: ""; - position: absolute; - right: 0; - bottom: 0; - width: 13px; - height: 13px; - padding: 5px; - background: linear-gradient(-45deg, white 50%, transparent 0); - background-clip: content-box; - cursor: ew-resize; - filter: drop-shadow(0 0 10px black); + content: ""; + position: absolute; + right: 0; + bottom: 0; + width: 16px; + height: 16px; + padding: 5px; + background: linear-gradient(-45deg, white 50%, transparent 0); + background-clip: content-box; + cursor: ew-resize; + filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.6)); } .ImageSlider img { - border-radius: 1em; - user-select: none; - max-width: 730px; + display: block; + border-radius: 1em; + user-select: none; + width: 100%; + height: auto; } .ImageShowcase { - width: 100%; - height: 100%; - object-fit: cover; - border-radius: 15px; + width: 100%; + height: auto; + object-fit: cover; + border-radius: 15px; +} + +/* Responsive design */ +@media (max-width: 768px) { + .ImageSlider > div { + width: 25px; /* Smaller handle for medium screens */ + } + + .ImageSlider > div:before { + width: 14px; /* Adjusted handle size */ + height: 14px; /* Adjusted handle size */ + } +} + +@media (max-width: 420px) { + .ImageSlider > div { + width: 20px; /* Smaller handle for small screens */ + } + + .ImageSlider > div:before { + width: 12px; /* Adjusted handle size */ + height: 12px; /* Adjusted handle size */ + } } diff --git a/style/components/video.css b/style/components/video.css deleted file mode 100644 index e69de29..0000000