Spaces:
Runtime error
Runtime error
Esteves Enzo
commited on
Commit
·
5881efa
1
Parent(s):
3787c07
add loading animate
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .next/build-manifest.json +13 -2
- .next/cache/webpack/client-development-fallback/0.pack.gz +2 -2
- .next/cache/webpack/client-development-fallback/index.pack.gz +2 -2
- .next/cache/webpack/client-development-fallback/index.pack.gz.old +0 -0
- .next/cache/webpack/client-development/0.pack.gz +2 -2
- .next/cache/webpack/client-development/1.pack.gz +2 -2
- .next/cache/webpack/client-development/10.pack.gz +2 -2
- .next/cache/webpack/client-development/11.pack.gz +2 -2
- .next/cache/webpack/client-development/12.pack.gz +2 -2
- .next/cache/webpack/client-development/13.pack.gz +2 -2
- .next/cache/webpack/client-development/2.pack.gz +2 -2
- .next/cache/webpack/client-development/3.pack.gz +2 -2
- .next/cache/webpack/client-development/4.pack.gz +2 -2
- .next/cache/webpack/client-development/5.pack.gz +2 -2
- .next/cache/webpack/client-development/6.pack.gz +2 -2
- .next/cache/webpack/client-development/7.pack.gz +2 -2
- .next/cache/webpack/client-development/8.pack.gz +2 -2
- .next/cache/webpack/client-development/9.pack.gz +2 -2
- .next/cache/webpack/client-development/index.pack.gz +2 -2
- .next/cache/webpack/client-development/index.pack.gz.old +0 -0
- .next/cache/webpack/server-development/0.pack.gz +2 -2
- .next/cache/webpack/server-development/1.pack.gz +2 -2
- .next/cache/webpack/server-development/10.pack.gz +2 -2
- .next/cache/webpack/server-development/11.pack.gz +2 -2
- .next/cache/webpack/server-development/12.pack.gz +2 -2
- .next/cache/webpack/server-development/13.pack.gz +2 -2
- .next/cache/webpack/server-development/2.pack.gz +2 -2
- .next/cache/webpack/server-development/3.pack.gz +2 -2
- .next/cache/webpack/server-development/4.pack.gz +2 -2
- .next/cache/webpack/server-development/5.pack.gz +2 -2
- .next/cache/webpack/server-development/6.pack.gz +2 -2
- .next/cache/webpack/server-development/7.pack.gz +2 -2
- .next/cache/webpack/server-development/8.pack.gz +2 -2
- .next/cache/webpack/server-development/9.pack.gz +2 -2
- .next/cache/webpack/server-development/index.pack.gz +2 -2
- .next/cache/webpack/server-development/index.pack.gz.old +0 -0
- .next/server/app-paths-manifest.json +3 -1
- .next/server/middleware-build-manifest.js +1 -1
- .next/server/pages-manifest.json +5 -1
- .next/static/development/_buildManifest.js +1 -1
- .next/trace +0 -0
- app/api/collections/route.ts +5 -1
- app/layout.tsx +9 -1
- assets/globals.css +32 -0
- components/header.tsx +3 -2
- components/main/collections/collection.tsx +39 -32
- components/main/collections/index.tsx +33 -27
- components/main/collections/loading.tsx +28 -0
- components/main/hooks/useCollections.ts +21 -19
- components/main/hooks/useInputGeneration.ts +40 -23
.next/build-manifest.json
CHANGED
@@ -2,7 +2,9 @@
|
|
2 |
"polyfillFiles": [
|
3 |
"static/chunks/polyfills.js"
|
4 |
],
|
5 |
-
"devFiles": [
|
|
|
|
|
6 |
"ampDevFiles": [],
|
7 |
"lowPriorityFiles": [
|
8 |
"static/development/_buildManifest.js",
|
@@ -13,7 +15,16 @@
|
|
13 |
"static/chunks/main-app.js"
|
14 |
],
|
15 |
"pages": {
|
16 |
-
"/_app": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
},
|
18 |
"ampFirstPages": []
|
19 |
}
|
|
|
2 |
"polyfillFiles": [
|
3 |
"static/chunks/polyfills.js"
|
4 |
],
|
5 |
+
"devFiles": [
|
6 |
+
"static/chunks/react-refresh.js"
|
7 |
+
],
|
8 |
"ampDevFiles": [],
|
9 |
"lowPriorityFiles": [
|
10 |
"static/development/_buildManifest.js",
|
|
|
15 |
"static/chunks/main-app.js"
|
16 |
],
|
17 |
"pages": {
|
18 |
+
"/_app": [
|
19 |
+
"static/chunks/webpack.js",
|
20 |
+
"static/chunks/main.js",
|
21 |
+
"static/chunks/pages/_app.js"
|
22 |
+
],
|
23 |
+
"/_error": [
|
24 |
+
"static/chunks/webpack.js",
|
25 |
+
"static/chunks/main.js",
|
26 |
+
"static/chunks/pages/_error.js"
|
27 |
+
]
|
28 |
},
|
29 |
"ampFirstPages": []
|
30 |
}
|
.next/cache/webpack/client-development-fallback/0.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:843ff71831cdafb40dc083869170c9884d6de3fa1cae9f39999f7f573f1abb77
|
3 |
+
size 11806600
|
.next/cache/webpack/client-development-fallback/index.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7cda9257f9ebf045963772f4e5f7fbbff608a70eb39a3efb71f46afe1ed1eacf
|
3 |
+
size 43058
|
.next/cache/webpack/client-development-fallback/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/client-development-fallback/index.pack.gz.old and b/.next/cache/webpack/client-development-fallback/index.pack.gz.old differ
|
|
.next/cache/webpack/client-development/0.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7389b3dd7f2d0b66fb76a504401cb036e5dd9e9ec7dc35932529dc75f02d4829
|
3 |
+
size 545053
|
.next/cache/webpack/client-development/1.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f0af1ca89f44d5be5e42601e1457608014a724e0a1988627fecae92d33ed80c7
|
3 |
+
size 10523
|
.next/cache/webpack/client-development/10.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fd00e2377bd0b581e2431b23f04ed48c6b730839848edc6d993869ee96761ec9
|
3 |
+
size 2437
|
.next/cache/webpack/client-development/11.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:27ec9e0227c1d45b4094c13ba2fb004a60084898fa5358880cd8d0495552eaa7
|
3 |
+
size 11454100
|
.next/cache/webpack/client-development/12.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df2fb7d91480a70b5c4dd41821970e5a67b873365810563dd0b4f45e881c4b23
|
3 |
+
size 1710
|
.next/cache/webpack/client-development/13.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2592ac535f465990869eeb1590fc1be4c6501f24c954e33903c90d1d2116aa09
|
3 |
+
size 4340933
|
.next/cache/webpack/client-development/2.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9fc4fa91c5b4f98d10c9e4b5a16d267072fc0136106a57270d06d594fe4fe491
|
3 |
+
size 1710
|
.next/cache/webpack/client-development/3.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:213cef7d02c10461027884433fb92a76e04c6f0848b3b667bc343d3979c36305
|
3 |
+
size 12367
|
.next/cache/webpack/client-development/4.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd97a31ae299df205694e3ff21cbf137bbf213bc5b5cdb656b7021ae4f3bde54
|
3 |
+
size 1723
|
.next/cache/webpack/client-development/5.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9ff8954aacef4e8f567bd1be5a87a686a236a02e36bb79753e915cd23f9a783
|
3 |
+
size 5179
|
.next/cache/webpack/client-development/6.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:557f608d4cd339eb321737abd9dc93a6256eb30067b951af3e2f9fb3a906acbf
|
3 |
+
size 4350762
|
.next/cache/webpack/client-development/7.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72d23761e4b2f47d91f0368e4545bf2e77c7fae24806fa9e4ee00e2b602fc91d
|
3 |
+
size 1713
|
.next/cache/webpack/client-development/8.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c00bc8e486175cc67eccd8d0a2ecbf2ff0ae0a3709808187dcb87be868a97f5
|
3 |
+
size 7494106
|
.next/cache/webpack/client-development/9.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6332a93010ca1d0da8a40f2b9dab91455bb019242d93d8666a8225ccf39c9fd7
|
3 |
+
size 32017
|
.next/cache/webpack/client-development/index.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8efbdd8b88b9272582cba42b8349f880e3981a0937e5c54ebd90321e6b3e1ee0
|
3 |
+
size 212732
|
.next/cache/webpack/client-development/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/client-development/index.pack.gz.old and b/.next/cache/webpack/client-development/index.pack.gz.old differ
|
|
.next/cache/webpack/server-development/0.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea23ade4e0ec9f4ce33dca43ddd5483244937a84cbb65e2725d509db76ae5ab4
|
3 |
+
size 483827
|
.next/cache/webpack/server-development/1.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9479b095d53db0e6f6674fa9ddf7e4c3342aa4c35624a558617984ced218b005
|
3 |
+
size 6354
|
.next/cache/webpack/server-development/10.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ed0d71472fa078596b7761e3597b55fa8f953fafe64d9e040cebe869aba0dcf
|
3 |
+
size 6392509
|
.next/cache/webpack/server-development/11.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ca15bd6e3fa8e658ec86599e3ed1e52169d7bbf6ae2c429a2f05ba212798e33
|
3 |
+
size 15169
|
.next/cache/webpack/server-development/12.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89704954a7930340b0380ec2410e3e483abf6fe5f0d7e4244ba00cb9a48af0a7
|
3 |
+
size 14622
|
.next/cache/webpack/server-development/13.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9b61bd0c19d160299e443d6d05deae0e0f2b7dcbb390d111329d0b06a71667f
|
3 |
+
size 2883828
|
.next/cache/webpack/server-development/2.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:75b84df1c1ea898112a0338a190122850148fbc3e719cd4d2184c24136866d9b
|
3 |
+
size 1394
|
.next/cache/webpack/server-development/3.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0b14bc3e235f82d81236544beaec86f88b7d18f014e764b5f1b80f1c8b572e31
|
3 |
+
size 8119
|
.next/cache/webpack/server-development/4.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c151908ea6f6b20af2692fa35261af2c7151ffddd3fd05b616a5927cd0bcebb
|
3 |
+
size 4607
|
.next/cache/webpack/server-development/5.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:699a73de5cd9134ae91b062b07e8e37ce1b921d962afad4d83514b0cc931be91
|
3 |
+
size 410
|
.next/cache/webpack/server-development/6.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5d5a24dbdc0fb2b4310fb90b3f8e9e22e595a4ed5443a0869fcbddda52f7f0c8
|
3 |
+
size 3224956
|
.next/cache/webpack/server-development/7.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48379fc2d254a3758fec57856b53d6ea131a8de3575f5ed18b5be16ed80b08a7
|
3 |
+
size 266191
|
.next/cache/webpack/server-development/8.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f9292025cec02edacf6d802d35e3cebc3161c342421269e5e38cdf2127b507f2
|
3 |
+
size 5781
|
.next/cache/webpack/server-development/9.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3194a5cdd55f27806199d5ed94a7f3c10cb430ed67d77bb79a595c98ca47c66
|
3 |
+
size 13702
|
.next/cache/webpack/server-development/index.pack.gz
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8fd03283fca5c9b3e4537962af4fa888ea2bb915f4d826257792048727de4d13
|
3 |
+
size 139172
|
.next/cache/webpack/server-development/index.pack.gz.old
CHANGED
Binary files a/.next/cache/webpack/server-development/index.pack.gz.old and b/.next/cache/webpack/server-development/index.pack.gz.old differ
|
|
.next/server/app-paths-manifest.json
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
{
|
2 |
-
"/
|
|
|
|
|
3 |
}
|
|
|
1 |
{
|
2 |
+
"/api/route": "app/api/route.js",
|
3 |
+
"/page": "app/page.js",
|
4 |
+
"/api/collections/route": "app/api/collections/route.js"
|
5 |
}
|
.next/server/middleware-build-manifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":[],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":["static/chunks/webpack.js","static/chunks/main-app.js"],"pages":{"/_app":[]},"ampFirstPages":[]}
|
|
|
1 |
+
self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":["static/chunks/react-refresh.js"],"ampDevFiles":[],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":["static/chunks/webpack.js","static/chunks/main-app.js"],"pages":{"/_app":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_app.js"],"/_error":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_error.js"]},"ampFirstPages":[]}
|
.next/server/pages-manifest.json
CHANGED
@@ -1 +1,5 @@
|
|
1 |
-
{
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"/_app": "pages/_app.js",
|
3 |
+
"/_error": "pages/_error.js",
|
4 |
+
"/_document": "pages/_document.js"
|
5 |
+
}
|
.next/static/development/_buildManifest.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},sortedPages:["\u002F_app"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
|
|
1 |
+
self.__BUILD_MANIFEST = {__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static\u002Fchunks\u002Fpages\u002F_error.js"],sortedPages:["\u002F_app","\u002F_error"]};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
|
.next/trace
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app/api/collections/route.ts
CHANGED
@@ -3,7 +3,11 @@ import { PrismaClient } from '@prisma/client'
|
|
3 |
const prisma = new PrismaClient()
|
4 |
|
5 |
export async function GET() {
|
6 |
-
const images = await prisma.image.findMany(
|
|
|
|
|
|
|
|
|
7 |
|
8 |
return Response.json({ images, status: 200, statusText: "OK" })
|
9 |
}
|
|
|
3 |
const prisma = new PrismaClient()
|
4 |
|
5 |
export async function GET() {
|
6 |
+
const images = await prisma.image.findMany({
|
7 |
+
orderBy: {
|
8 |
+
id: 'desc'
|
9 |
+
}
|
10 |
+
})
|
11 |
|
12 |
return Response.json({ images, status: 200, statusText: "OK" })
|
13 |
}
|
app/layout.tsx
CHANGED
@@ -1,9 +1,15 @@
|
|
|
|
1 |
import type { Metadata } from "next";
|
2 |
import { Inter } from "next/font/google";
|
|
|
|
|
3 |
import "@/assets/globals.css";
|
|
|
4 |
|
5 |
const inter = Inter({ subsets: ["latin"] });
|
6 |
|
|
|
|
|
7 |
export const metadata: Metadata = {
|
8 |
title: "Create Next App",
|
9 |
description: "Generated by create next app",
|
@@ -16,7 +22,9 @@ export default function RootLayout({
|
|
16 |
}) {
|
17 |
return (
|
18 |
<html lang="en">
|
19 |
-
<body className={inter.className}>
|
|
|
|
|
20 |
</html>
|
21 |
);
|
22 |
}
|
|
|
1 |
+
import { cache } from "react";
|
2 |
import type { Metadata } from "next";
|
3 |
import { Inter } from "next/font/google";
|
4 |
+
import { QueryClient } from "@tanstack/react-query";
|
5 |
+
|
6 |
import "@/assets/globals.css";
|
7 |
+
import Providers from "@/components/react-query/providers";
|
8 |
|
9 |
const inter = Inter({ subsets: ["latin"] });
|
10 |
|
11 |
+
export const getQueryClient = () => cache(() => new QueryClient());
|
12 |
+
|
13 |
export const metadata: Metadata = {
|
14 |
title: "Create Next App",
|
15 |
description: "Generated by create next app",
|
|
|
22 |
}) {
|
23 |
return (
|
24 |
<html lang="en">
|
25 |
+
<body className={inter.className}>
|
26 |
+
<Providers>{children}</Providers>
|
27 |
+
</body>
|
28 |
</html>
|
29 |
);
|
30 |
}
|
assets/globals.css
CHANGED
@@ -5,3 +5,35 @@
|
|
5 |
body {
|
6 |
@apply bg-black
|
7 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
body {
|
6 |
@apply bg-black
|
7 |
}
|
8 |
+
|
9 |
+
.loading-dots {
|
10 |
+
@apply flex justify-start items-center gap-1
|
11 |
+
}
|
12 |
+
.loading-dots span{
|
13 |
+
@apply inline-block w-2 h-2 bg-white rounded-full
|
14 |
+
}
|
15 |
+
.loading-dots span:nth-child(1) {
|
16 |
+
animation: move 1s infinite;
|
17 |
+
}
|
18 |
+
.loading-dots span:nth-child(2) {
|
19 |
+
animation: move 1s .2s infinite;
|
20 |
+
}
|
21 |
+
.loading-dots span:nth-child(3) {
|
22 |
+
animation: move 1s .4s infinite;
|
23 |
+
}
|
24 |
+
|
25 |
+
/* create keyframes to move each span one by one infinite animation */
|
26 |
+
@keyframes move {
|
27 |
+
0% {
|
28 |
+
transform: translateY(0);
|
29 |
+
opacity: .5;
|
30 |
+
}
|
31 |
+
50% {
|
32 |
+
transform: translateY(-6px);
|
33 |
+
opacity: 1;
|
34 |
+
}
|
35 |
+
100% {
|
36 |
+
transform: translateY(0);
|
37 |
+
opacity: .5;
|
38 |
+
}
|
39 |
+
}
|
components/header.tsx
CHANGED
@@ -11,10 +11,11 @@ export const Header = () => {
|
|
11 |
// backgroundImage: `url(${HeaderImageMesh.src})`,
|
12 |
// }}
|
13 |
>
|
14 |
-
<div className="flex items-start px-6 mx-auto max-w-
|
15 |
<div className="w-full lg:w-1/2 relative z-10">
|
16 |
<h1 className="font-bold text-5xl lg:text-7xl text-white text-center lg:text-left">
|
17 |
-
Fast Stable
|
|
|
18 |
on TPU v5e ⚡
|
19 |
</h1>
|
20 |
<p className="text-sm text-white mt-3 text-center lg:text-left">
|
|
|
11 |
// backgroundImage: `url(${HeaderImageMesh.src})`,
|
12 |
// }}
|
13 |
>
|
14 |
+
<div className="flex items-start px-6 mx-auto max-w-[1722px] relative pt-24 pb-20">
|
15 |
<div className="w-full lg:w-1/2 relative z-10">
|
16 |
<h1 className="font-bold text-5xl lg:text-7xl text-white text-center lg:text-left">
|
17 |
+
Fast Stable <br />
|
18 |
+
Diffusion XL <br className="hidden lg:block" />
|
19 |
on TPU v5e ⚡
|
20 |
</h1>
|
21 |
<p className="text-sm text-white mt-3 text-center lg:text-left">
|
components/main/collections/collection.tsx
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
-
import { motion } from "framer-motion";
|
2 |
import { useMemo } from "react";
|
|
|
|
|
|
|
3 |
|
4 |
interface Props {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
data: ArrayBuffer;
|
9 |
-
type: string;
|
10 |
-
};
|
11 |
-
id: number;
|
12 |
-
};
|
13 |
}
|
14 |
|
15 |
-
export const Collection: React.FC<Props> = ({
|
|
|
|
|
|
|
|
|
16 |
const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
17 |
let binary = "";
|
18 |
const bytes = [].slice.call(new Uint8Array(buffer));
|
@@ -27,27 +28,33 @@ export const Collection: React.FC<Props> = ({ collection }) => {
|
|
27 |
}, [collection]);
|
28 |
|
29 |
return (
|
30 |
-
<
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
<
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
);
|
53 |
};
|
|
|
|
|
1 |
import { useMemo } from "react";
|
2 |
+
import { motion } from "framer-motion";
|
3 |
+
|
4 |
+
import { Collection as CollectionType } from "@/type";
|
5 |
|
6 |
interface Props {
|
7 |
+
index: number;
|
8 |
+
collection: CollectionType;
|
9 |
+
className?: string;
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
+
export const Collection: React.FC<Props> = ({
|
13 |
+
collection,
|
14 |
+
index,
|
15 |
+
className,
|
16 |
+
}) => {
|
17 |
const arrayBufferToBase64 = (buffer: ArrayBuffer) => {
|
18 |
let binary = "";
|
19 |
const bytes = [].slice.call(new Uint8Array(buffer));
|
|
|
28 |
}, [collection]);
|
29 |
|
30 |
return (
|
31 |
+
<div className={`h-[377px] w-full relative ${className}`}>
|
32 |
+
<motion.div
|
33 |
+
initial={{ y: 100, opacity: 0 }}
|
34 |
+
animate={{ y: 0, opacity: 1 }}
|
35 |
+
transition={{ duration: 0.35, delay: index * 0.1 }}
|
36 |
+
className="rounded-3xl h-[377px] cursor-pointer group overflow-hidden relative z-[1] group"
|
37 |
+
>
|
38 |
+
<div className="absolute top-0 left-0 w-full h-full translate-y-full opacity-0 transition-all duration-200 group-hover:translate-y-0 group-hover:opacity-100 flex items-end p-3">
|
39 |
+
<div className="bg-[#292424] backdrop-blur-sm bg-opacity-60 rounded-xl p-3 border-white/20 border w-full">
|
40 |
+
<p className="text-xs font-semibold text-white/60 mb-0.5">
|
41 |
+
27 October
|
42 |
+
</p>
|
43 |
+
<p className="text-lg font-medium text-white lowercase leading-snug">
|
44 |
+
{collection.prompt}
|
45 |
+
</p>
|
46 |
+
<p className="text-white text-sm text-right font-semibold mt-2">
|
47 |
+
Try it now
|
48 |
+
</p>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<div
|
52 |
+
style={{
|
53 |
+
backgroundImage: `url(${bufferToBase64})`,
|
54 |
+
}}
|
55 |
+
className="rounded-3xl bg-red-400 bg-cover absolute top-0 left-0 w-full h-full z-[-1] transition-all duration-200 group-hover:scale-125 bg-center"
|
56 |
+
/>
|
57 |
+
</motion.div>
|
58 |
+
</div>
|
59 |
);
|
60 |
};
|
components/main/collections/index.tsx
CHANGED
@@ -1,42 +1,48 @@
|
|
1 |
import classNames from "classnames";
|
2 |
-
import {
|
|
|
|
|
3 |
|
4 |
import { useCollections } from "../hooks/useCollections";
|
5 |
import { Collection } from "./collection";
|
|
|
6 |
|
7 |
-
const
|
8 |
-
"https://www.blueshadow.art/wp-content/uploads/2023/03/prompt13.jpg",
|
9 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/09/prompt01.jpg",
|
10 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/09/prompt02.jpg",
|
11 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/09/prompt06.jpg",
|
12 |
-
"https://www.blueshadow.art/wp-content/uploads/2023/03/prompt14.jpg",
|
13 |
-
"https://www.blueshadow.art/wp-content/uploads/2023/03/prompt17.jpg",
|
14 |
-
"https://www.blueshadow.art/wp-content/uploads/2023/03/prompt18.jpg",
|
15 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/10/prompt27.jpg",
|
16 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/10/prompt32.jpg",
|
17 |
-
"https://www.blueshadow.art/wp-content/uploads/2022/10/prompt34.jpg",
|
18 |
-
"https://www.blueshadow.art/wp-content/uploads/2023/01/prompt44.jpg",
|
19 |
-
];
|
20 |
|
21 |
export const Collections = () => {
|
22 |
const { collections, loading } = useCollections();
|
|
|
23 |
|
24 |
if (loading) return;
|
25 |
|
|
|
|
|
26 |
return (
|
27 |
-
<div className="
|
28 |
-
{collections
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
</div>
|
41 |
);
|
42 |
};
|
|
|
1 |
import classNames from "classnames";
|
2 |
+
import { createBreakpoint } from "react-use";
|
3 |
+
|
4 |
+
import { Collection as CollectionType } from "@/type";
|
5 |
|
6 |
import { useCollections } from "../hooks/useCollections";
|
7 |
import { Collection } from "./collection";
|
8 |
+
import { CollectionLoading } from "./loading";
|
9 |
|
10 |
+
const useBreakpoint = createBreakpoint({ XL: 1280, L: 1024, S: 768, XS: 640 });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
export const Collections = () => {
|
13 |
const { collections, loading } = useCollections();
|
14 |
+
const breakpoint = useBreakpoint();
|
15 |
|
16 |
if (loading) return;
|
17 |
|
18 |
+
console.log(collections);
|
19 |
+
|
20 |
return (
|
21 |
+
<div className="mx-auto grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-5 mt-8 lg:mt-14">
|
22 |
+
{collections?.map((collection: CollectionType, i: number) =>
|
23 |
+
collection?.id === -1 ? (
|
24 |
+
<CollectionLoading prompt={collection.prompt} />
|
25 |
+
) : (
|
26 |
+
<Collection
|
27 |
+
key={i}
|
28 |
+
index={i}
|
29 |
+
collection={collection}
|
30 |
+
className={classNames("", {
|
31 |
+
// translate second and fourth item per row, row of 5 items
|
32 |
+
"!translate-y-12":
|
33 |
+
breakpoint === "XL"
|
34 |
+
? i % 5 === 1 || i % 5 === 3
|
35 |
+
: breakpoint === "L"
|
36 |
+
? i % 4 === 1 || i % 4 === 3
|
37 |
+
: breakpoint === "S"
|
38 |
+
? i % 3 === 1
|
39 |
+
: breakpoint === "XS"
|
40 |
+
? i % 2 === 1
|
41 |
+
: false,
|
42 |
+
})}
|
43 |
+
/>
|
44 |
+
)
|
45 |
+
)}
|
46 |
</div>
|
47 |
);
|
48 |
};
|
components/main/collections/loading.tsx
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { useMemo } from "react";
|
2 |
+
import { motion } from "framer-motion";
|
3 |
+
|
4 |
+
import { Collection as CollectionType } from "@/type";
|
5 |
+
|
6 |
+
interface Props {
|
7 |
+
prompt: string;
|
8 |
+
}
|
9 |
+
|
10 |
+
export const CollectionLoading: React.FC<Props> = ({ prompt }) => {
|
11 |
+
return (
|
12 |
+
<div className="h-[377px] w-full relative">
|
13 |
+
<motion.div
|
14 |
+
initial={{ y: 100, opacity: 0 }}
|
15 |
+
animate={{ y: 0, opacity: 1 }}
|
16 |
+
transition={{ duration: 0.35, delay: 0.1 }}
|
17 |
+
className="rounded-3xl h-[377px] cursor-pointer group overflow-hidden relative z-[1] group bg-primary/70 flex flex-col justify-between p-8"
|
18 |
+
>
|
19 |
+
<div className="loading-dots translate-y-[5px]">
|
20 |
+
<span />
|
21 |
+
<span />
|
22 |
+
<span />
|
23 |
+
</div>
|
24 |
+
<p className="text-white/50 font-semibold text-xl">{prompt}</p>
|
25 |
+
</motion.div>
|
26 |
+
</div>
|
27 |
+
);
|
28 |
+
};
|
components/main/hooks/useCollections.ts
CHANGED
@@ -1,25 +1,27 @@
|
|
1 |
-
import {
|
2 |
-
import {
|
3 |
|
4 |
export const useCollections = () => {
|
5 |
-
const
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
.finally(() => {
|
20 |
-
setLoading(false)
|
21 |
-
})
|
22 |
-
})
|
23 |
|
24 |
return {
|
25 |
collections,
|
|
|
1 |
+
import { Collection } from "@/type";
|
2 |
+
import { useQuery } from "@tanstack/react-query";
|
3 |
|
4 |
export const useCollections = () => {
|
5 |
+
const {
|
6 |
+
data: collections,
|
7 |
+
isLoading: loading,
|
8 |
+
} = useQuery(
|
9 |
+
["collections"],
|
10 |
+
async () => {
|
11 |
+
const response = await fetch("/api/collections", { method: "GET" })
|
12 |
+
const data = await response.json()
|
13 |
|
14 |
+
if (!response.ok) {
|
15 |
+
throw new Error(data.message)
|
16 |
+
}
|
17 |
+
return data.images;
|
18 |
+
},
|
19 |
+
{
|
20 |
+
refetchOnMount: false,
|
21 |
+
refetchOnWindowFocus: false,
|
22 |
+
refetchOnReconnect: false,
|
23 |
+
}
|
24 |
+
);
|
|
|
|
|
|
|
|
|
25 |
|
26 |
return {
|
27 |
collections,
|
components/main/hooks/useInputGeneration.ts
CHANGED
@@ -1,32 +1,49 @@
|
|
1 |
import { useState } from "react"
|
|
|
|
|
2 |
|
3 |
export const useInputGeneration = () => {
|
4 |
const [prompt, setPrompt] = useState<string>('')
|
5 |
-
const
|
6 |
-
|
7 |
-
const submit = (
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
}
|
17 |
-
|
18 |
-
|
19 |
-
.then(async res => res.json())
|
20 |
-
.then(data => {
|
21 |
-
console.log(data)
|
22 |
-
resolve(true)
|
23 |
})
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
27 |
})
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
return {
|
32 |
prompt,
|
|
|
1 |
import { useState } from "react"
|
2 |
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
3 |
+
import { Collection } from "@/type"
|
4 |
|
5 |
export const useInputGeneration = () => {
|
6 |
const [prompt, setPrompt] = useState<string>('')
|
7 |
+
const client = useQueryClient()
|
8 |
+
|
9 |
+
const { mutate: submit, isLoading: loading } = useMutation(
|
10 |
+
["generation"],
|
11 |
+
async () => {
|
12 |
+
client.setQueryData(["collections"], (old) => {
|
13 |
+
return [{
|
14 |
+
id: -1,
|
15 |
+
blob: {
|
16 |
+
type: "image/png",
|
17 |
+
data: new ArrayBuffer(0),
|
18 |
+
},
|
19 |
+
prompt
|
20 |
+
}, ...old as Collection[]]
|
|
|
|
|
|
|
|
|
21 |
})
|
22 |
+
|
23 |
+
const response = await fetch("/api", {
|
24 |
+
method: "POST",
|
25 |
+
body: JSON.stringify({
|
26 |
+
inputs: prompt,
|
27 |
+
}),
|
28 |
})
|
29 |
+
const data = await response.json()
|
30 |
+
|
31 |
+
if (!response.ok) {
|
32 |
+
throw new Error(data.message)
|
33 |
+
}
|
34 |
+
|
35 |
+
client.setQueryData(["collections"], (old) => {
|
36 |
+
const newArray = [...old as Collection[]]
|
37 |
+
const index = newArray.findIndex((item: Collection) => item.id === -1)
|
38 |
+
|
39 |
+
newArray[index] = data?.blob as Collection
|
40 |
+
|
41 |
+
return newArray
|
42 |
+
})
|
43 |
+
|
44 |
+
return data ?? []
|
45 |
+
},
|
46 |
+
)
|
47 |
|
48 |
return {
|
49 |
prompt,
|