From 66e767414e9f733412e0a4b006b3b4218b708ccb Mon Sep 17 00:00:00 2001 From: Frank Delaguila Date: Sun, 6 Nov 2022 13:55:26 -0700 Subject: [PATCH] Fixing up Modal styles, and close button, need to add more elements --- components/modal.tsx | 84 +++++++++++++++++++++++++++----------------- pages/_document.tsx | 4 ++- pages/index.tsx | 8 +++-- styles/globals.css | 11 +++++- 4 files changed, 70 insertions(+), 37 deletions(-) diff --git a/components/modal.tsx b/components/modal.tsx index b86583c..a3efb59 100644 --- a/components/modal.tsx +++ b/components/modal.tsx @@ -41,45 +41,65 @@ const Modal = forwardRef(({modalOpen, toggleModal, c return ( -
-
-
- {card && - {`${card.name}} + <> + +
+
+

+ {card.flavor_text} +

-
-

{card?.name}

-

{card.oracle_text}

-

{card.flavor_text}

+
- null - } - } - }} /> + {card && ( + {`${card.name} + )} +
+
+

{card?.name}

+

{card.oracle_text}

+
+ null, + }, + }, + }} + /> +
-
- +
); diff --git a/pages/_document.tsx b/pages/_document.tsx index 3105ab4..65ba083 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -3,7 +3,9 @@ import { Html, Head, Main, NextScript } from 'next/document'; export default function Document() { return ( - + + +
{/* Here we will mount our modal portal */} diff --git a/pages/index.tsx b/pages/index.tsx index 67fa76e..f18f6b3 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -67,7 +67,7 @@ export default function Home() { Magic Card Valuator -
+
{errorMessage}
@@ -75,7 +75,6 @@ export default function Home() {
- {error ?

{errorMessage}

: null}
@@ -92,7 +91,10 @@ export default function Home() { setSelectedCard(card); setModalOpen(true); document.body.classList.toggle('prevent-scroll'); - }} className="cursor-pointer hover:scale-110 transition-transform duration-150 ease-in-out w-full sm:w-1/2 md:w-1/3 lg:w-1/4 p-2" key={card.id} alt={`${card.name} Card`} src={card.image_uris?.png || "https://via.placeholder.com/150" } width={100} height={100} /> + }} + className="cursor-pointer hover:scale-110 transition-transform duration-150 ease-in-out w-full sm:w-1/2 md:w-1/3 lg:w-1/4 p-2" + key={card.id} + alt={`${card.name} Card`} src={card.image_uris?.png || "https://via.placeholder.com/150" } width={100} height={100} /> ) } diff --git a/styles/globals.css b/styles/globals.css index af73c4b..edf4b34 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -22,13 +22,22 @@ } .modal { - background: #1d1d1c; + background: #333333; width: 100%; height: 100%; top: 100%; transition: top 150ms cubic-bezier(0.4, 0, 0.2, 1); } +.modal-close { + text-shadow: 0 1px 12px #000; + font-size: 36px; +} + +.modal-flavor-text { + text-shadow: 0 1px 2px #000; +} + .modal.open { top: 0; }