From 66567221d95ac7d2422be720e494cdb48b009d11 Mon Sep 17 00:00:00 2001 From: Factiven Date: Tue, 25 Apr 2023 22:18:37 +0700 Subject: Update v3.3 --- package.json | 2 +- pages/anime/[...id].js | 138 ++++++++++++++++++++++++++----------------------- styles/globals.css | 56 ++++++++++++++++++++ 3 files changed, 129 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 842f12e..62518c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moopa", - "version": "3.2.0", + "version": "3.3.0", "private": true, "scripts": { "dev": "next dev", diff --git a/pages/anime/[...id].js b/pages/anime/[...id].js index cf70c62..11fc22d 100644 --- a/pages/anime/[...id].js +++ b/pages/anime/[...id].js @@ -157,9 +157,6 @@ export default function Info() { (data) => data.mediaRecommendation ); - // console.log(rec); - // console.log(info); - useEffect(() => { const defaultState = { data: null, @@ -397,7 +394,7 @@ export default function Info() { {/* PC */} -
+
{info ? ( <> @@ -418,7 +415,7 @@ export default function Info() {
{/* PC */} -
+

{info ? ( @@ -507,72 +504,76 @@ export default function Info() { )}

- {info?.relations?.edges - ? info?.relations?.edges - .slice(0, showAll ? info?.relations?.edges.length : 3) - .map((r, index) => { - const rel = r.node; - return ( - { + const rel = r.node; + return ( + +
-
-
- {rel.id} +
+ {rel.id} +
+
+
+ {r.relationType}
-
-
- {r.relationType} -
-
- {rel.title.userPreferred || - rel.title.romaji} -
-
{rel.type}
+
+ {rel.title.userPreferred || rel.title.romaji}
+
{rel.type}
- - ); - }) - : [1, 2, 3].map((item) => ( -
+
+ + ); + }) + ) : ( + <> + {[1, 2, 3].map((item) => ( +
))} +
+ +
+ + )}
@@ -612,8 +613,8 @@ export default function Info() { {loading ? ( data && (
- {episode ? ( - episode.map((epi, index) => { + {episode?.length !== 0 ? ( + episode?.map((epi, index) => { return (
) ) : ( -
- Loading Episodes... +
+
+
+
+
+
+
)}
diff --git a/styles/globals.css b/styles/globals.css index b101081..ff7a1bb 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -147,3 +147,59 @@ button { .skip-button { @apply bg-white xs:w-28 xs:h-9 w-24 h-7 -right-8 -bottom-7 rounded-md font-karla shadow-xl hover:bg-[#f1f1f1] text-black md:static absolute xs:-right-6 xs:-bottom-5 xs:text-[15px] text-xs md:text-sm; } + +.lds-ellipsis { + display: inline-block; + position: relative; + width: 80px; + height: 80px; +} +.lds-ellipsis div { + position: absolute; + top: 33px; + width: 13px; + height: 13px; + border-radius: 50%; + background: #27272e; + animation-timing-function: cubic-bezier(0, 1, 1, 0); +} +.lds-ellipsis div:nth-child(1) { + left: 8px; + animation: lds-ellipsis1 0.6s infinite; +} +.lds-ellipsis div:nth-child(2) { + left: 8px; + animation: lds-ellipsis2 0.6s infinite; +} +.lds-ellipsis div:nth-child(3) { + left: 32px; + animation: lds-ellipsis2 0.6s infinite; +} +.lds-ellipsis div:nth-child(4) { + left: 56px; + animation: lds-ellipsis3 0.6s infinite; +} +@keyframes lds-ellipsis1 { + 0% { + transform: scale(0); + } + 100% { + transform: scale(1); + } +} +@keyframes lds-ellipsis3 { + 0% { + transform: scale(1); + } + 100% { + transform: scale(0); + } +} +@keyframes lds-ellipsis2 { + 0% { + transform: translate(0, 0); + } + 100% { + transform: translate(24px, 0); + } +} -- cgit v1.2.3