diff --git a/src/components/CharacterCardSmall.css b/src/components/CharacterCardSmall.css index 2d929a8..1e3248b 100644 --- a/src/components/CharacterCardSmall.css +++ b/src/components/CharacterCardSmall.css @@ -1,127 +1,123 @@ .card-content { - container-type: inline-size; - position: relative; - display: flex; - align-items: center; - justify-content: center; + width: min(100%, 19rem); + padding: 0.5rem; + align-self: start; + box-sizing: border-box; - width: 19rem; - height: 25.5rem; border-radius: 1.5rem; background-color: #5a7d0d; } -@media (min-width: 600px) { - .card-content { - container-type: inline-size; - position: relative; - display: flex; - align-items: center; - justify-content: center; - - width: 12rem; - height: 16.5rem; - border-radius: 1.5rem; - background-color: #5a7d0d; - } +.small-card-frame { + position: relative; + container-type: inline-size; + width: 100%; + aspect-ratio: 196 / 275; } .card-shape { position: absolute; - width: 18rem; - height: 23rem; -} - -@media (min-width: 600px) { - .card-shape { - position: absolute; - width: 11rem; - height: 16rem; - } + inset: 0; + display: block; + width: 100%; + height: 100%; } .character-info { + position: absolute; + inset: 5% 7%; display: flex; - text-align: center; flex-direction: column; align-items: center; - position: absolute; + gap: 2cqw; color: white; - z-index: 1; + text-align: center; } .character-image { - width: 15rem; - height: 15rem; - border-radius: 1.5rem; -} + display: block; + flex-shrink: 0; -@media (min-width: 600px) { - .character-image { - width: 10rem; - height: 10rem; - border-radius: 1.5rem; - } + width: 100%; + height: auto; + object-fit: cover; + border-radius: 1rem; + aspect-ratio: 1; } .card-buttons { - display: flex; - align-items: center; - justify-content: center; - max-width: inherit; - padding-top: 0.5rem; + flex-shrink: 0; + align-self: flex-start; + + width: 75%; + height: 12cqw; + margin-left: 4%; } .star { - width: 1.5rem; - height: 1.5rem; + display: block; + width: 100%; + height: 100%; filter: brightness(0) invert(1); } .favorite-button { + position: absolute; + left: 92%; + top: 94%; + transform: translate(-50%, -50%); + + display: flex; + align-items: center; + justify-content: center; + + width: 14%; + aspect-ratio: 1; + padding: 0; + border: none; background: transparent; - border: 0; - transform: translateX(0.7rem) translateY(0.8rem); cursor: pointer; } .star-favorite { - filter: brightness(0) saturate(100%) invert(84%) sepia(85%) saturate(829%) - hue-rotate(359deg) brightness(105%) contrast(104%); + filter: brightness(0) saturate(100%) invert(84%) sepia(85%) saturate(829%) hue-rotate(359deg) brightness(105%) contrast(104%); } .details-button { + display: block; + width: 100%; + height: 100%; + padding: 0; + + border: none; + border-radius: 1rem; background-color: white; color: black; - border-radius: 1rem; - border: none; - width: 12rem; - height: 2rem; + font-size: clamp(0.75rem, 6cqw, 1rem); + cursor: pointer; } -@media (min-width: 600px) { - .details-button { - background-color: white; - color: black; - border-radius: 1rem; - border: none; - width: 8rem; - height: 2rem; - } -} +.character-name { + flex: 1; + min-height: 0; + width: 100%; + margin: 0; + padding: 0; -p { - padding-top: 1rem; - padding-bottom: 1rem; + display: flex; + align-items: center; + justify-content: center; + + font-size: 10cqw; + line-height: 1.1; font-weight: 800; - font-size: 2rem; + overflow-wrap: anywhere; + overflow: auto; } -@media (min-width: 600px) { - p { - padding: 0; - font-weight: 800; - font-size: 1.5rem; +@media (min-width: 768px) { + .card-content { + width: min(100%, 12rem); } -} +} \ No newline at end of file diff --git a/src/components/CharacterCardSmall.tsx b/src/components/CharacterCardSmall.tsx index 4fa9379..91c3c2e 100644 --- a/src/components/CharacterCardSmall.tsx +++ b/src/components/CharacterCardSmall.tsx @@ -19,31 +19,36 @@ export default function CharacterCardSmall({ }: CharacterCardSmallProps) { return (
- -
- character image -

{name}

-
- - +
+ + +
+ character image +

{name}

+ +
+ +
+ +
); diff --git a/src/components/CharacterDetailCard.css b/src/components/CharacterDetailCard.css index dffbd46..fe10a7c 100644 --- a/src/components/CharacterDetailCard.css +++ b/src/components/CharacterDetailCard.css @@ -8,6 +8,8 @@ justify-content: center; background-color: rgb(0 0 0 / 75%); + padding: 1rem 4.5rem; + box-sizing: border-box; } .detail-card { @@ -15,13 +17,20 @@ display: flex; gap: 2rem; - width: 60rem; - max-width: 90%; + width: min(70rem, calc(100vw - 10rem)); + max-height: calc(100dvh - 2rem); padding: 3rem; + box-sizing: border-box; color: white; background-color: #5a7d0d; border-radius: 1.5rem; + overflow: auto; +} + +.detail-info { + flex: 1 1 55%; + min-width: 0; } .detail-info p { @@ -32,6 +41,16 @@ font-weight: 800; } +.detail-image-section { + display: flex; + align-items: center; + gap: 1rem; + + width: 45%; + margin-left: auto; + flex-shrink: 0; +} + .character-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -44,11 +63,14 @@ } .detail-info h2 { - margin-top: 0; + margin: 0; + color: white; font-size: 3rem; font-weight: bold; + line-height: 1; text-transform: uppercase; + white-space: nowrap; } .detail-image-frame { @@ -57,12 +79,10 @@ align-items: center; justify-content: center; - width: 45%; - margin-left: auto; - transform: translateX(0.5rem); - + width: 100%; aspect-ratio: 1 / 0.93; - align-self: center; + + overflow: visible; } .detail-card-shape { @@ -72,13 +92,17 @@ } .detail-character-image { - position: relative; + position: absolute; + top: 50%; + left: 50%; z-index: 1; width: 90%; height: 90%; object-fit: cover; border-radius: 1rem; + + transform: translate(-50%, -50%); } .close-button { @@ -146,14 +170,16 @@ } .detail-heading { - display: flex; - align-items: center; - gap: 1rem; + position: relative; + z-index: 3; + width: calc(100% + 15rem); margin-bottom: 1.5rem; } .detail-favorite-button { + position: static; flex-shrink: 0; + padding: 0; border: none; background: transparent; @@ -168,14 +194,16 @@ } .detail-star-favorite { - filter: brightness(0) saturate(100%) invert(84%) sepia(85%) saturate(829%) - hue-rotate(359deg) brightness(105%) contrast(104%); + filter: brightness(0) saturate(100%) invert(84%) sepia(85%) saturate(829%) hue-rotate(359deg) brightness(105%) contrast(104%); } -@media (max-width: 600px) { +@media (max-width: 750px) { + .detail-heading { + width: 100%; + } + .detail-overlay { - padding: 1rem; - box-sizing: border-box; + padding: 0.75rem; } .detail-card { @@ -183,8 +211,8 @@ width: 100%; max-width: 100%; - max-height: 90vh; - padding: 3rem 1.5rem 1.5rem; + max-height: calc(100dvh - 1.5rem); + padding: 3rem 2.75rem 1.5rem; box-sizing: border-box; overflow-y: auto; @@ -196,6 +224,7 @@ } .detail-info h2 { + white-space: normal; font-size: 2rem; overflow-wrap: anywhere; } @@ -206,17 +235,13 @@ } .detail-character-image { - width: 100%; - height: 100%; + width: 90%; + height: 90%; } .detail-image-frame { - width: 85%; - margin: 0 auto; - padding: 2rem; - box-sizing: border-box; - transform: none; - aspect-ratio: 1 / 1; + width: 100%; + padding: 0; } .detail-episodes h3 { @@ -233,15 +258,32 @@ } .previous-button { - left: 1.2rem; + left: 1rem; } .next-button { - right: 1.2rem; + right: 1rem; } .navigation-arrow { width: 2.25rem; height: 2.25rem; } + + .detail-favorite-button { + left: auto; + right: 0.5rem; + bottom: 0.5rem; + } + + .detail-image-section { + width: min(100%, 24rem); + margin: 0 auto; +} } + +@media (max-width: 420px) { + .character-facts { + grid-template-columns: 1fr; + } +} \ No newline at end of file diff --git a/src/components/CharacterDetailCard.tsx b/src/components/CharacterDetailCard.tsx index 9fb735a..7124fb8 100644 --- a/src/components/CharacterDetailCard.tsx +++ b/src/components/CharacterDetailCard.tsx @@ -55,7 +55,7 @@ export default function CharacterDetailCard({ }, [character]); return ( -
+
+

{character.name}

@@ -123,13 +107,34 @@ export default function CharacterDetailCard({
-
- - {character.name} +
+ + +
+ + + {character.name} +
diff --git a/src/components/Hero.css b/src/components/Hero.css index fdfe9f7..153b725 100644 --- a/src/components/Hero.css +++ b/src/components/Hero.css @@ -1,6 +1,7 @@ .hero { - min-height: 750px; - padding: 70px; + min-height: 100svh; + padding: 7clamp(2rem, 6vw, 4.375rem); + box-sizing: border-box; display: flex; justify-content: center; align-items: center; @@ -12,7 +13,8 @@ } .hero-content { - width: 360px; + width: min(100%, 360px); + flex-shrink: 1; } .logo { @@ -36,25 +38,27 @@ text-align: center; text-decoration: none; font-size: 18px; + box-sizing: border-box; } .hero-characters { - width: 480px; + width: min(45vw, 480px); + min-width: 0; height: auto; } @media (max-width: 900px) { .hero { - min-height: 740px; - padding: 80px 20px; - display: block; + min-height: 100svh; + padding: clamp(4rem, 12vh, 8rem) 1.25rem; + display: flex; border-radius: 0 0 50% 50% / 0 0 4% 4%; } .hero-content { width: 100%; max-width: 310px; - margin: 70px auto 0; + margin: 0 auto; } .logo { @@ -74,3 +78,14 @@ display: none; } } + +@media (max-width: 900px) and (orientation: landscape) { + .hero { + min-height: 100svh; + padding-block: 2rem; + } + + .hero-description { + margin-block: 1.25rem; + } +} \ No newline at end of file diff --git a/src/index.css b/src/index.css index d437676..3acb526 100644 --- a/src/index.css +++ b/src/index.css @@ -57,6 +57,7 @@ body { margin: 0; + background-color: #282828; } h1, diff --git a/src/pages/CharactersPage.css b/src/pages/CharactersPage.css index 0714fa1..653a512 100644 --- a/src/pages/CharactersPage.css +++ b/src/pages/CharactersPage.css @@ -1,44 +1,70 @@ .content { display: flex; - padding-top: 6rem; + flex-direction: column; + gap: 1.5rem; + width: min(100%, 74rem); + margin: 0 auto; + padding: 6rem 1rem 2rem; + box-sizing: border-box; } .search-area { - max-width: 56rem; + order: 2; + flex: 1; + min-width: 0; } .filter-area { - display: none; + order: 1; + width: 100%; + padding: 1rem; + box-sizing: border-box; + border: 2px solid #3f3f3f; + border-radius: 1rem; } -@media (min-width: 600px) { +@media (min-width: 768px) { + .content { + flex-direction: row; + align-items: flex-start; + padding-inline: 2rem; + } + + .search-area { + order: 1; + } + .filter-area { display: block; + order: 2; + flex: 0 0 13rem; width: 13rem; height: fit-content; margin-right: 1rem; - border: 2px solid #3f3f3f; - - border-radius: 1rem; padding: 2rem; } } .character-cards { - display: flex; - align-items: center; - flex-wrap: wrap; + display: grid; + grid-template-columns: 1fr; gap: 2rem; + min-width: 0; +} + +.character-cards>* { + justify-self: center; } .searchbar { display: flex; - width: min(95%, 80rem); + width: 100%; margin-bottom: 2rem; overflow: hidden; border: 2px solid #3f3f3f; border-radius: 0.5rem; + box-sizing: border-box; } .searchfield { @@ -83,8 +109,21 @@ .filter-group { border: none; + padding: 0; margin-bottom: 1rem; } + +.filter-area>.filter-group { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.75rem; + margin: 0; +} + +.filter-group legend { + font-weight: 700; +} + .checkbox-option { display: flex; align-items: center; @@ -93,3 +132,28 @@ width: fit-content; cursor: pointer; } + +@media (min-width: 768px) { + .filter-area>.filter-group { + grid-template-columns: 1fr; + } + + .search-button { + padding-inline: 1rem; + } + + .character-cards { + grid-template-columns: + repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); + } + + .filter-area>.filter-group { + display: block; + } +} + +@media (max-width: 420px) { + .filter-area>.filter-group { + grid-template-columns: 1fr; + } +} \ No newline at end of file