Spaces:
Runtime error
Runtime error
Esteves Enzo
commited on
Commit
·
53353f2
1
Parent(s):
8d1be70
mobile
Browse files- app/api/route.ts +2 -2
- components/header.tsx +5 -2
- components/main/collections/index.tsx +3 -3
- components/main/index.tsx +1 -1
app/api/route.ts
CHANGED
@@ -37,10 +37,10 @@ export async function POST(
|
|
37 |
body: blob,
|
38 |
})
|
39 |
const isNSFW = await response_isnsfw.clone().json().catch(() => ({}));
|
40 |
-
|
41 |
if (isNSFW?.length) {
|
42 |
const scoreNotSafe = isNSFW?.find((n: { label: string }) => n.label === "no_safe");
|
43 |
-
if (scoreNotSafe?.score > 0.
|
44 |
return Response.json({ status: 401, ok: false, message: "Image is not safe for work." });
|
45 |
}
|
46 |
}
|
|
|
37 |
body: blob,
|
38 |
})
|
39 |
const isNSFW = await response_isnsfw.clone().json().catch(() => ({}));
|
40 |
+
|
41 |
if (isNSFW?.length) {
|
42 |
const scoreNotSafe = isNSFW?.find((n: { label: string }) => n.label === "no_safe");
|
43 |
+
if (scoreNotSafe?.score > 0.8) {
|
44 |
return Response.json({ status: 401, ok: false, message: "Image is not safe for work." });
|
45 |
}
|
46 |
}
|
components/header.tsx
CHANGED
@@ -14,7 +14,7 @@ export const Header = () => {
|
|
14 |
className={classNames(
|
15 |
"bg-black z-[1] transition-all duration-1000 overflow-hidden",
|
16 |
{
|
17 |
-
"!max-h-[0px]": hasMadeFirstGeneration,
|
18 |
"max-h-[450px]": !hasMadeFirstGeneration,
|
19 |
}
|
20 |
)}
|
@@ -36,7 +36,10 @@ export const Header = () => {
|
|
36 |
alt="Demo generated images"
|
37 |
className="absolute h-full top-0 object-contain hidden lg:block right-0 xl:right-44 object-left"
|
38 |
/>
|
39 |
-
<div
|
|
|
|
|
|
|
40 |
</div>
|
41 |
<div className="absolute bottom-0 w-full h-full left-0 bg-gradient-to-b from-transparent to-black z-[1]" />
|
42 |
</div>
|
|
|
14 |
className={classNames(
|
15 |
"bg-black z-[1] transition-all duration-1000 overflow-hidden",
|
16 |
{
|
17 |
+
"!max-h-[0px] mb-6": hasMadeFirstGeneration,
|
18 |
"max-h-[450px]": !hasMadeFirstGeneration,
|
19 |
}
|
20 |
)}
|
|
|
36 |
alt="Demo generated images"
|
37 |
className="absolute h-full top-0 object-contain hidden lg:block right-0 xl:right-44 object-left"
|
38 |
/>
|
39 |
+
<div
|
40 |
+
className="absolute w-full lg:w-1/3 right-0 xl:right-44 -bottom-32 lg:-bottom-32 bg-gradient-to-br from-blue-500 to-pink-500 blur-xl lg:blur-[130px] h-full z-[-1]"
|
41 |
+
style={{ willChange: "transform" }}
|
42 |
+
></div>
|
43 |
</div>
|
44 |
<div className="absolute bottom-0 w-full h-full left-0 bg-gradient-to-b from-transparent to-black z-[1]" />
|
45 |
</div>
|
components/main/collections/index.tsx
CHANGED
@@ -21,7 +21,7 @@ export const Collections: React.FC<{ category: string }> = ({ category }) => {
|
|
21 |
|
22 |
return (
|
23 |
<>
|
24 |
-
<div className="mx-auto grid grid-cols-
|
25 |
{collections?.map((collection: CollectionType, i: number) =>
|
26 |
collection?.loading ? (
|
27 |
<CollectionLoading
|
@@ -37,7 +37,7 @@ export const Collections: React.FC<{ category: string }> = ({ category }) => {
|
|
37 |
: breakpoint === "S"
|
38 |
? i % 3 === 1
|
39 |
: breakpoint === "XS"
|
40 |
-
?
|
41 |
: false,
|
42 |
})}
|
43 |
/>
|
@@ -55,7 +55,7 @@ export const Collections: React.FC<{ category: string }> = ({ category }) => {
|
|
55 |
: breakpoint === "S"
|
56 |
? i % 3 === 1
|
57 |
: breakpoint === "XS"
|
58 |
-
?
|
59 |
: false,
|
60 |
})}
|
61 |
onOpen={setOpen}
|
|
|
21 |
|
22 |
return (
|
23 |
<>
|
24 |
+
<div className="mx-auto grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-5 mt-8 lg:mt-14">
|
25 |
{collections?.map((collection: CollectionType, i: number) =>
|
26 |
collection?.loading ? (
|
27 |
<CollectionLoading
|
|
|
37 |
: breakpoint === "S"
|
38 |
? i % 3 === 1
|
39 |
: breakpoint === "XS"
|
40 |
+
? false
|
41 |
: false,
|
42 |
})}
|
43 |
/>
|
|
|
55 |
: breakpoint === "S"
|
56 |
? i % 3 === 1
|
57 |
: breakpoint === "XS"
|
58 |
+
? false
|
59 |
: false,
|
60 |
})}
|
61 |
onOpen={setOpen}
|
components/main/index.tsx
CHANGED
@@ -31,7 +31,7 @@ export const Main = () => {
|
|
31 |
|
32 |
return (
|
33 |
<main className="px-6 z-[2] relative max-w-[1722px] mx-auto">
|
34 |
-
<div className="py-2 pl-2 pr-4 bg-black bg-opacity-30 backdrop-blur-sm sticky top-
|
35 |
<div className="flex flex-col lg:flex-row items-center justify-between w-full">
|
36 |
<InputGeneration
|
37 |
prompt={prompt}
|
|
|
31 |
|
32 |
return (
|
33 |
<main className="px-6 z-[2] relative max-w-[1722px] mx-auto">
|
34 |
+
<div className="py-2 pl-2 pr-2 lg:pr-4 bg-black bg-opacity-30 backdrop-blur-sm lg:sticky lg:top-4 z-10 rounded-full">
|
35 |
<div className="flex flex-col lg:flex-row items-center justify-between w-full">
|
36 |
<InputGeneration
|
37 |
prompt={prompt}
|