diff --git a/backend/src/resolvers.ts b/backend/src/resolvers.ts index f9d37a85..2bd63294 100644 --- a/backend/src/resolvers.ts +++ b/backend/src/resolvers.ts @@ -63,7 +63,7 @@ const users = db.collection("users"); const toPlant = (doc: WithId): Plant => ({ id: doc._id.toString(), - name: doc.commonName, + name: doc.commonName.replace(/\*/g, "").replace(/\s+/g, " ").trim(), imageURL: doc.imageData ?? doc.imageURL ?? null, scientificName: doc.scientificName, description: doc.description, diff --git a/e2e/uiAccessibility.spec.ts b/e2e/uiAccessibility.spec.ts index 00628492..7147b5bf 100644 --- a/e2e/uiAccessibility.spec.ts +++ b/e2e/uiAccessibility.spec.ts @@ -76,10 +76,8 @@ test.describe("after interaction", () => { test("ExplorePlants with a plant card flipped", async ({ page }) => { await page.goto("#/explorePlants"); const firstCard = page.locator(".plant-grid > li").first(); - await firstCard - .locator(".plant-card-front .plant-card-info-button") - .click(); - await expect(firstCard.locator(".plant-card-back")).toHaveAttribute( + await firstCard.locator(".plant-card-front .plant-card-hint").click(); + await expect(firstCard.locator(".plant-card-face-back")).toHaveAttribute( "aria-hidden", "false", ); diff --git a/e2e/uiExplorePlants.spec.ts b/e2e/uiExplorePlants.spec.ts index a6b40825..9b0c4ba4 100644 --- a/e2e/uiExplorePlants.spec.ts +++ b/e2e/uiExplorePlants.spec.ts @@ -50,9 +50,9 @@ test("user pages, filters, searches, opens a plant, sorts and resets", async ({ await test.step("opening a plant shows its details", async () => { const jadeCard = cards.nth(0); - const details = jadeCard.locator(".plant-card-back"); + const details = jadeCard.locator(".plant-card-face-back"); - await jadeCard.locator(".plant-card-front .plant-card-info-button").click(); + await jadeCard.locator(".plant-card-front .plant-card-hint").click(); await expect(details).toHaveAttribute("aria-hidden", "false"); await expect(details).toContainText("Crassula ovata"); await expect(details).toContainText("Low"); @@ -61,7 +61,7 @@ test("user pages, filters, searches, opens a plant, sorts and resets", async ({ ); // Flip the card back so the next steps see the front again - await details.locator(".plant-card-info-button").click(); + await details.locator(".plant-card-hint").click(); await expect(details).toHaveAttribute("aria-hidden", "true"); }); diff --git a/frontend/src/components/plantCard/PlantCard.css b/frontend/src/components/plantCard/PlantCard.css index 0a177f6b..6308c0c8 100644 --- a/frontend/src/components/plantCard/PlantCard.css +++ b/frontend/src/components/plantCard/PlantCard.css @@ -1,12 +1,61 @@ +:root { + --plant-card-width: 310px; + --plant-card-height: 528px; + + --plant-card-compact-scale: 0.8; + --plant-card-compact-width: calc(390px * var(--plant-card-compact-scale)); +} + .plant-card-flipper { --card-name-height: clamp(100px, 8vh, 86px); - --card-image-height: 270px; + --card-fold-base: clamp(38px, 19.5cqw, 60px); + --card-fold: var(--card-fold-base); + --card-hint-space: calc(var(--card-fold-base) * 1.25); + + container-type: inline-size; + position: relative; - width: 100%; - height: 100%; + width: var(--plant-card-width); + height: var(--plant-card-height); + + filter: var(--card-shadow); + transition: filter 0.2s ease; +} + +.plant-card-flipper:has(.plant-card-hint:focus-visible) { + filter: var(--card-shadow-hover); +} + +@media (hover: hover) { + .plant-card-flipper:hover { + filter: var(--card-shadow-hover); + } +} + +.plant-card-flip-target { + position: absolute; + inset: 0; + + border-radius: 32px; + + cursor: pointer; + -webkit-tap-highlight-color: transparent; +} + +.plant-card-flip-target:has(.plant-card-hint:focus-visible) { + outline: 3px solid var(--dark-green); + outline-offset: 4px; + + --card-fold: calc(var(--card-fold-base) * 1.25); } -.plant-card-flipper .plant-card { +@media (hover: hover) { + .plant-card-flip-target:hover { + --card-fold: calc(var(--card-fold-base) * 1.25); + } +} + +.plant-card-face { position: absolute; inset: 0; @@ -16,24 +65,18 @@ transition: transform 0.6s ease; } -.plant-card-back { +.plant-card-face-back { transform: rotateY(180deg); } -.plant-card-flipper.is-flipped .plant-card-front { +.plant-card-flipper.is-flipped .plant-card-face-front { transform: rotateY(-180deg); } -.plant-card-flipper.is-flipped .plant-card-back { +.plant-card-flipper.is-flipped .plant-card-face-back { transform: rotateY(0deg); } -@media (prefers-reduced-motion: reduce) { - .plant-card-flipper .plant-card { - transition: none; - } -} - .plant-card { box-sizing: border-box; @@ -53,81 +96,99 @@ font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; } -.plant-card-bookmark { - display: none; +.plant-card-face > .plant-card { + clip-path: polygon( + 0 0, + 100% 0, + 100% calc(100% - var(--card-fold)), + calc(100% - var(--card-fold)) 100%, + 0 100% + ); + transition: clip-path 0.2s ease; } -.plant-card-front { - position: relative; - padding: 0; - height: 100%; -} +.plant-card-flap { + position: absolute; + right: 0; + bottom: 0; -.plant-card-front .plant-card-panel { - flex: none; + width: var(--card-fold); + height: var(--card-fold); - width: 100%; - padding: 0; + --flap-fill: var(--card-flap); - display: flex; - flex-direction: column; - gap: 0; + background: var(--flap-fill); + clip-path: polygon(0 0, 100% 0, 0 100%); - background: transparent; + pointer-events: none; - border-radius: 0; + transition: + width 0.2s ease, + height 0.2s ease; +} - overflow: hidden; +@media (prefers-reduced-motion: reduce) { + .plant-card-flipper, + .plant-card-face, + .plant-card-face > .plant-card, + .plant-card-flap { + transition: none; + } } .plant-card-name { box-sizing: border-box; width: 100%; + margin: 0; + + color: var(--text-on-green); + + font-weight: 700; + line-height: 1.1; + text-align: center; +} + +.plant-card-front .plant-card-panel { + flex: 1 1 auto; + min-height: 0; + + width: 100%; + + display: flex; + flex-direction: column; +} + +.plant-card-front .plant-card-name { + flex: none; height: var(--card-name-height); - margin: 0; padding: 5px 40px; display: flex; align-items: center; justify-content: center; - color: var(--dark-green); + background: var(--dark-green); font-size: 1.5rem; - font-weight: 700; - line-height: 1.1; - text-align: center; overflow: hidden; } -.plant-card-front .plant-card-name { - background: var(--dark-green); - color: var(--light-green); -} - .plant-card-image { display: block; width: 100%; - height: var(--card-image-height); - - flex: none; + flex: 1 1 0; + min-height: 0; object-fit: cover; - - border-radius: 0; } .plant-card-image-missing { position: relative; - width: 100%; - height: var(--card-image-height); - flex: none; overflow: hidden; - border-radius: 0; } .plant-card-image-missing::before { @@ -137,45 +198,6 @@ background: url("/plant-placeholder.png") center / cover no-repeat; } -.plant-card-info-button { - flex: none; - align-self: center; - width: 95%; - height: 60px; - margin-top: 18px; - padding: 0 24px; - display: flex; - align-items: center; - justify-content: center; - gap: 14px; - background: var(--dark-green); - color: var(--text-on-green); - border: none; - border-radius: 999px; - font-family: inherit; - font-size: 1.25rem; - font-weight: 700; - cursor: pointer; - transition: - transform 0.2s ease, - background-color 0.2s ease; -} - -.plant-card-info-button:hover { - background: var(--accent-green-hover); - transform: translateY(-2px); -} - -.plant-card-info-arrow { - display: flex; - align-items: center; - justify-content: center; - - font-size: 1.8rem; - font-weight: 400; - line-height: 1; -} - .plant-card-front .plant-card-preferences { flex: none; @@ -183,7 +205,7 @@ box-sizing: border-box; margin: 0; - padding: 14px 18px 18px; + padding: 20px 18px 4px; display: flex; flex-wrap: wrap; @@ -192,78 +214,111 @@ align-content: flex-start; gap: 8px; - - overflow: visible; -} - -.plant-card-back { - background: var(--light-green); } -.plant-card-back .plant-card-panel { - box-sizing: border-box; +.plant-card-hint { flex: none; - height: calc(var(--card-name-height) + var(--card-image-height)); - min-height: 0; - padding: 20px; + display: block; + width: 100%; + border: none; + background: none; + font-family: inherit; + cursor: pointer; - display: flex; - flex-direction: column; - align-items: stretch; + margin: auto 0 0; + padding: 18px var(--card-hint-space) 32px 20px; - gap: 12px; + color: var(--dark-green); - background: var(--dark-green); - color: var(--light-green); + font-size: 1rem; + font-weight: 600; + line-height: 1.3; + text-align: center; +} - border-radius: 20px 20px 0 0; +.plant-card-hint:focus { + outline: none; +} - overflow-y: auto; +.plant-card-back { + background: var(--card-back); + color: var(--text-light); } -.plant-card-details:focus-visible { - outline: 3px solid var(--light-green); - outline-offset: -6px; +.plant-card-face-back .plant-card-flap { + --flap-fill: var(--light-green); } -.plant-card-back .plant-card-name { - height: auto; - min-height: 62px; +.plant-card-back .plant-card-hint, +.plant-card-back .plant-card-details, +.plant-card-back .plant-card-facts dt { + color: var(--text-light); +} - padding: 0 24px; +.plant-card-back-header { + flex: none; - color: var(--light-green); + padding: 20px 28px 16px; - font-size: 1.7rem; + background: var(--dark-green); + color: var(--text-on-green); +} + +.plant-card-back .plant-card-name { + font-size: 1.6rem; + overflow-wrap: anywhere; } .plant-card-scientific { - margin: -4px 0 6px; + margin: 6px 0 0; - color: var(--light-green); + color: var(--text-on-green-muted); - font-size: 1rem; + font-size: 1.15rem; + font-weight: 600; font-style: italic; text-align: center; + overflow-wrap: anywhere; +} + +.plant-card-details { + flex: 1 1 auto; + min-height: 0; + + padding: 18px 22px 4px; + + overflow-y: auto; + overscroll-behavior: contain; + + color: var(--text-dark); +} + +.plant-card-description { + margin: 0; + + font-size: 18px; + line-height: 1.65; } .plant-card-facts { - margin: 5px 0 10px; + margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; - column-gap: 14px; - row-gap: 7px; + row-gap: 4px; - color: var(--light-green); + font-size: 16px; + line-height: 1.45; +} - font-size: 0.95rem; - line-height: 1.25; +.plant-card-facts > div { + display: contents; } .plant-card-facts dt { + color: var(--dark-green); font-weight: 700; } @@ -271,106 +326,95 @@ margin: 0; } -.plant-card-description { - color: var(--light-green); - font-size: 0.9rem; - line-height: 1.4; - margin-bottom: 40px; +.plant-card-flipper.is-compact { + --plant-card-width: 390px; + --plant-card-height: 638px; + zoom: var(--plant-card-compact-scale); } -@media (max-width: 767px) { - .plant-card-flipper { - --card-name-height: 68px; - --card-image-height: 175px; - } - - .plant-card { - border-radius: 24px; - } - - .plant-card-name { - height: var(--card-name-height); +.plant-card-flipper .plant-preference-chip { + padding: 0.5em 0.93em; + font-size: clamp(12px, 4.5cqw, 14px); - padding: 10px 16px; + box-sizing: border-box; + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} - font-size: 1.25rem; +@media (min-width: 768px) { + .plant-card-flipper.is-compact .plant-preference-chip { + font-size: 16px; } - /* The card has a fixed height, so the image only gets the space left - after the name, button and preferences. Otherwise a tall image pushes - the preferences out of the card. */ - .plant-card-front .plant-card-panel { - flex: 1 1 auto; - min-height: 0; + .plant-card-flipper.is-compact .plant-card-hint { + font-size: 1.125rem; } +} - .plant-card-front .plant-card-name { - flex: none; +@media (max-width: 767px) { + :root { + --plant-card-width: min(280px, 62vw); } - .plant-card-front .plant-card-image, - .plant-card-front .plant-card-image-missing { - width: 100%; - height: auto; - flex: 1 1 0; - min-height: 0; - object-fit: cover; + .plant-card-flipper { + --card-name-height: 68px; + --card-hint-space: calc(var(--card-fold-base) * 1.25 - 16px); } - .plant-card-info-button { - width: 82%; - height: 44px; - - margin-top: 12px; - - padding: 0 16px; - - gap: 9px; + .plant-card-flipper.is-compact { + --plant-card-width: min(280px, 62vw); + --plant-card-height: 520px; + zoom: 1; + } - font-size: 1rem; + .plant-card, + .plant-card-flip-target { + border-radius: 24px; } - .plant-card-info-arrow { - font-size: 1.4rem; + .plant-card-front .plant-card-name { + height: auto; + min-height: var(--card-name-height); + padding: 10px 16px; + font-size: clamp(1.05rem, 6.5cqw, 1.25rem); + overflow-wrap: anywhere; } .plant-card-front .plant-card-preferences { - padding: 12px 12px 14px; - + padding: 18px 12px 4px; gap: 6px; } - .plant-card-back { - padding: 0; + .plant-card-hint { + padding: 16px var(--card-hint-space) 26px 14px; + font-size: clamp(0.8rem, 4.8cqw, 0.9rem); } - .plant-card-back .plant-card-panel { - padding: 14px; - - gap: 8px; - - border-radius: 18px; + .plant-card-back-header { + padding: 16px 16px 12px; } .plant-card-back .plant-card-name { - min-height: 45px; - - font-size: 1.3rem; + font-size: clamp(1.1rem, 7cqw, 1.3rem); } .plant-card-scientific { - font-size: 0.85rem; + font-size: 1rem; } - .plant-card-facts { - font-size: 0.8rem; - - column-gap: 8px; - row-gap: 4px; + .plant-card-details { + padding: 14px 14px 4px; } .plant-card-description { - font-size: 0.78rem; - line-height: 1.3; + font-size: 17px; + line-height: 1.6; + } + + .plant-card-facts { + font-size: 15px; + column-gap: 10px; } } diff --git a/frontend/src/components/plantCard/PlantCard.tsx b/frontend/src/components/plantCard/PlantCard.tsx index 1863d4d4..f4e1d926 100644 --- a/frontend/src/components/plantCard/PlantCard.tsx +++ b/frontend/src/components/plantCard/PlantCard.tsx @@ -1,118 +1,164 @@ -import { useState } from "react"; +import { useEffect, useRef, useState } from "react"; +import type { KeyboardEvent } from "react"; import { useTranslation } from "react-i18next"; import "./PlantCard.css"; import PlantPreferenceChips from "../plantPreferenceChips/PlantPreferenceChips"; +import type { Plant } from "../../types/Plant"; + +type PlantCardData = Omit; type Props = { - name: string | null; - imageURL: string | null; - scientificName?: string[] | null; - description?: string | null; - watering?: string | null; - sunlight?: string[] | null; - careLevel?: string | null; + plant: PlantCardData; + size?: "large" | "compact"; onInfo?: () => void; }; -export default function PlantCard({ - name, - imageURL, - scientificName, - description, - watering, - sunlight, - careLevel, - onInfo, -}: Props) { +export default function PlantCard({ plant, size = "large", onInfo }: Props) { + const { + name, + imageURL, + scientificName, + description, + watering, + sunlight, + careLevel, + } = plant; const { t } = useTranslation(); + const cardRef = useRef(null); + const detailsRef = useRef(null); + const frontButtonRef = useRef(null); + const backButtonRef = useRef(null); + const moveFocusRef = useRef(false); const [isFlipped, setIsFlipped] = useState(false); - function handleInfoClick() { - setIsFlipped(!isFlipped); + useEffect(() => { + if (!moveFocusRef.current) return; + moveFocusRef.current = false; + (isFlipped ? backButtonRef : frontButtonRef).current?.focus(); + }, [isFlipped]); + + function flip() { + moveFocusRef.current = + cardRef.current?.contains(document.activeElement) ?? false; + setIsFlipped((flipped) => !flipped); onInfo?.(); } - return ( -
-
- + function handleKeyDown(event: KeyboardEvent) { + if (isFlipped && (event.key === "ArrowDown" || event.key === "ArrowUp")) { + event.preventDefault(); + detailsRef.current?.scrollBy({ + top: event.key === "ArrowDown" ? 40 : -40, + }); + } + } -
-

{name}

+ const plantName = name ?? ""; - {imageURL ? ( - {name - ) : ( -
- )} -
- - - - -
- -
+ return ( +
+
-

{name}

- - {scientificName && scientificName.length > 0 && ( -

{scientificName.join(", ")}

- )} - -
-
{t("plantCard.watering")}
-
{watering ?? t("plantCard.unknown")}
- -
{t("plantCard.sunlight")}
-
- {sunlight && sunlight.length > 0 - ? sunlight.join(", ") - : t("plantCard.unknown")} -
- -
{t("plantCard.careLevel")}
-
{careLevel ?? t("plantCard.unknown")}
-
- - {description && ( -

{description}

- )} +
+
+

{name}

+ + {imageURL ? ( + {plantName} + ) : ( +
+ )} +
+ + + + +
+
- -
+
+
+

{name}

+ + {scientificName && scientificName.length > 0 && ( +

+ {scientificName.join(", ")} +

+ )} +
+ +
+
+
+
{t("plantCard.watering")}
+
{watering ?? t("plantCard.unknown")}
+
+ +
+
{t("plantCard.sunlight")}
+
+ {sunlight && sunlight.length > 0 + ? sunlight.join(", ") + : t("plantCard.unknown")} +
+
+ +
+
{t("plantCard.careLevel")}
+
{careLevel ?? t("plantCard.unknown")}
+
+
+ + {description && ( +

{description}

+ )} +
+ + +
+
+ ); } diff --git a/frontend/src/components/sidebar/Sidebar.css b/frontend/src/components/sidebar/Sidebar.css index db4e22e6..29ec854a 100644 --- a/frontend/src/components/sidebar/Sidebar.css +++ b/frontend/src/components/sidebar/Sidebar.css @@ -5,11 +5,11 @@ position: fixed; overflow-y: auto; z-index: 100; - background: var(--light-green); + background: var(--sidebar-background); color: var(--text-dark); padding: 1.5rem 1rem; box-sizing: border-box; - border-right: 1px solid var(--border-soft); + border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; } @@ -28,7 +28,7 @@ gap: 0.85rem; padding: 0.7rem 0.9rem; border-radius: 0.6rem; - color: var(--text-dark); + color: var(--sidebar-text); text-decoration: none; font-size: 1.1rem; font-weight: 500; @@ -41,7 +41,7 @@ .sidebar__link:hover { background: var(--light-background); - border-color: var(--border-soft); + border-color: var(--sidebar-border); } .sidebar__link[aria-current="page"] { diff --git a/frontend/src/components/sidebarButtons/SideBarButton.css b/frontend/src/components/sidebarButtons/SideBarButton.css index 967a69ec..839cf076 100644 --- a/frontend/src/components/sidebarButtons/SideBarButton.css +++ b/frontend/src/components/sidebarButtons/SideBarButton.css @@ -1,7 +1,7 @@ .sidebar-button { width: 74px; height: 38px; - border: 1px solid var(--border-soft); + border: 1px solid var(--sidebar-border); border-radius: 8px; background-color: var(--light-background); color: var(--text-dark); diff --git a/frontend/src/i18n/locales/en/translation.json b/frontend/src/i18n/locales/en/translation.json index 0cce216a..288b0935 100644 --- a/frontend/src/i18n/locales/en/translation.json +++ b/frontend/src/i18n/locales/en/translation.json @@ -101,13 +101,12 @@ "plantCard": { "preferences": "Plant preferences", "matchesPreferences": "Matches your saved preferences", - "information": "Information", - "save": "Save plant", - "back": "Back", "watering": "Watering", "sunlight": "Sunlight", "careLevel": "Care level", - "unknown": "Unknown" + "unknown": "Unknown", + "tapForDetails": "Tap the card for details", + "tapToFlipBack": "Tap to flip back" }, "plantQuiz": { "title": "What kind of plant owner are you?", diff --git a/frontend/src/i18n/locales/no/translation.json b/frontend/src/i18n/locales/no/translation.json index f4314a7c..f7c8da11 100644 --- a/frontend/src/i18n/locales/no/translation.json +++ b/frontend/src/i18n/locales/no/translation.json @@ -13,7 +13,7 @@ "explorePlants": "Utforsk Planter", "profile": "Profil", "title": "I <3 Plants", - "plantOwnerTest": "Planteeier Test" + "plantOwnerTest": "Planteeiertest" }, "plantMatchPage": { "skipPlant": "Hopp over planten", @@ -101,13 +101,12 @@ "plantCard": { "preferences": "Plantepreferanser", "matchesPreferences": "Matcher dine lagrede preferanser", - "information": "Informasjon", - "save": "Lagre plante", - "back": "Tilbake", "watering": "Vanning", "sunlight": "Sollys", "careLevel": "Stell", - "unknown": "Ukjent" + "unknown": "Ukjent", + "tapForDetails": "Trykk på kortet for detaljer", + "tapToFlipBack": "Trykk for å snu tilbake" }, "plantQuiz": { "title": "Hvilken type planteeier er du?", diff --git a/frontend/src/index.css b/frontend/src/index.css index 377b3003..68312d8c 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -18,28 +18,40 @@ body { --text-dark: #44403c; --text-light: #ffffff; --light-background: #ffffff; - --dark-green: #3a6642; - --text-on-green: #ffffff; - --light-green: #e8f0e9; + --dark-green: #2e4a3b; + --text-on-green: #f5f1e8; + --light-green: #f5f1e8; + --text-on-green-muted: #d9dcc8; + --card-flap: #7a8b5c; + --card-back: #5c6b42; --dark-pink: #9e3050; --pink-text: #9e3050; --light-pink: #fce8ee; --bg: #fff; --border: #f3f7f3; - --border-soft: #c5d9c7; + --border-soft: #ddd5c5; --border-pink: #ffe5ed; --accent-green: #6b8f71; --accent-green-hover: #6f9373; - --sidebar-background: #f7efe4; + --light-sage: #dce1cc; + --sidebar-background: var(--light-sage); + --sidebar-border: #c9d0b5; + --sidebar-text: #2e4a3b; + --card-shadow: drop-shadow(0 6px 14px rgba(30, 40, 30, 0.18)); + --card-shadow-hover: drop-shadow(0 10px 22px rgba(30, 40, 30, 0.24)); + --card-box-shadow: 0 6px 20px rgba(30, 40, 30, 0.15); } [data-theme="dark"] { --text-dark: #f5f1ec; --text-light: #ffffff; --light-background: #292724; - --dark-green: #8fb996; - --text-on-green: #191816; - --light-green: #2c3a2e; + --dark-green: #a9b48a; + --text-on-green: #1f2a22; + --light-green: #2f3329; + --text-on-green-muted: #2f3329; + --card-flap: #5e6b48; + --card-back: #5e6b48; --dark-pink: #c2476b; --light-pink: #4a2a35; --pink-text: #ffffff; @@ -49,5 +61,11 @@ body { --border-pink: #5a3340; --accent-green: #6b8f71; --accent-green-hover: #7a9e7e; - --sidebar-background: #221f1c; + --light-sage: var(--light-green); + --sidebar-background: var(--light-sage); + --sidebar-border: var(--border-soft); + --sidebar-text: var(--text-dark); + --card-shadow: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); + --card-shadow-hover: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55)); + --card-box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); } diff --git a/frontend/src/pages/explorePlants/ExplorePlants.css b/frontend/src/pages/explorePlants/ExplorePlants.css index 24cf0046..3be91b98 100644 --- a/frontend/src/pages/explorePlants/ExplorePlants.css +++ b/frontend/src/pages/explorePlants/ExplorePlants.css @@ -11,7 +11,6 @@ gap: 30px; font-family: Georgia, serif; - --card-scale: 0.8; } .visually-hidden { @@ -86,7 +85,7 @@ border-radius: 8px; min-width: 160px; font-size: 15px; - background-color: var(--light-background); + background-color: var(--light-pink); color: var(--text-dark); } @@ -102,15 +101,15 @@ height: 38px; border: 1px solid var(--dark-pink); border-radius: 8px; - background-color: var(--light-background); - color: var(--text-dark); + background-color: var(--dark-pink); + color: var(--text-light); font-size: 15px; cursor: pointer; } .reset-button:hover { - background-color: var(--dark-pink); - color: var(--text-light); + background-color: var(--light-pink); + color: var(--text-dark); } .reset-button:focus-within { @@ -127,7 +126,7 @@ background-color: var(--light-pink); } -.explore-results p { +.explore-results > p { font-size: 20px; text-align: center; font-family: Georgia, serif; @@ -140,30 +139,16 @@ display: grid; grid-template-columns: repeat( auto-fill, - minmax(calc(390px * var(--card-scale)), 1fr) + minmax(var(--plant-card-compact-width), 1fr) ); gap: 30px 20px; } .explore-plant-item { - width: calc(390px * var(--card-scale)); - height: calc(620px * var(--card-scale)); justify-self: center; position: relative; } -.explore-plant-item .plant-card-flipper { - width: 390px; - height: 620px; - transform: scale(var(--card-scale)); - transform-origin: top left; -} - -/* Sets the card apart from the pink background */ -.explore-plant-item .plant-card { - border: 3px solid var(--dark-green); -} - .pagination { display: flex; flex-wrap: wrap; @@ -211,7 +196,7 @@ padding: 0 0.75rem; border: 1px solid var(--dark-pink); border-radius: 8px; - background-color: var(--light-background); + background-color: var(--light-pink); color: var(--text-dark); font: inherit; font-size: 15px; @@ -361,17 +346,6 @@ gap: 20px; } - .explore-plant-item { - width: min(280px, 62vw); - height: 502px; - } - - .explore-plant-item .plant-card-flipper { - width: 100%; - height: 100%; - transform: none; - } - .add-match-button { width: 35px; height: 35px; diff --git a/frontend/src/pages/explorePlants/ExplorePlants.tsx b/frontend/src/pages/explorePlants/ExplorePlants.tsx index 830d76d7..2f37686c 100644 --- a/frontend/src/pages/explorePlants/ExplorePlants.tsx +++ b/frontend/src/pages/explorePlants/ExplorePlants.tsx @@ -327,15 +327,7 @@ export default function ExplorePlants() { return (
  • - + {/* Sibling of the card (not inside it), so no nested buttons */}