kodadot / frames

Repository for Farcaster frames, tailored for KodaDot
0 stars 0 forks source link

Minting frame with various generations #4

Open yangwao opened 4 months ago

yangwao commented 4 months ago
vikiival commented 4 months ago

ahh I got your point :)

I made the same thing on ETHDenver

d6101636-689a-4fbc-bacf-bad16e553580 c65e71a0-3dda-46d8-a91a-16e50ccfc697

The base minting contract

Has basically "pre-made" generations so we can help with rendering tbh

the code for base minting frame is here

Complexlity commented 4 months ago

I made the same thing on ETHDenver

d6101636-689a-4fbc-bacf-bad16e553580 ![c65e71a0-3dda-46d8-a91a-16e50ccfc697](https://private-user-images.githubusercontent.com/22471030/320441805-91c91d8b-ae86-4b9f-9d08-290cfd54a16b.jpeg?

Not sure how to make the Create Iteration. Is the frame code to this open? Couldn't find it in the uniframe repo.

vikiival commented 4 months ago

Not sure how to make the Create Iteration. Is the frame code to this open? Couldn't find it in the uniframe repo.

https://github.com/vikiival/uniframe/blob/26efc4379952ff37cc72fa458f10786de0db8210/frames/src/routes/genart.tsx#L39

Complexlity commented 4 months ago

Thanks. I figured. Been playing around with it. For some reason it works for this:

uri = 'ipfs://bafybeiadxh5cyyu25lyg5rxvkr3gpkxbs6xuo3ay47nw3tje4p5e7m7ba4' (this is the collection used in the uniframe repo)

But not this:

uri = "ipfs://bafybeidsrzf3zbuopqdta5qmuduhcr5iiejfy3cakctygkvsrfg7fsbng4"; (this is the vortices collection used in the based-frame repo)

Maybe I'm missing something but will update when I figure

vikiival commented 4 months ago

You can run your own capture service https://github.com/vikiival/vercelgl

Complexlity commented 4 months ago

Oh wow. Cool. I'll do that

Complexlity commented 4 months ago

Update: The Vortices art (used in based-frame. uri: ipfs://bafybeidsrzf3zbuopqdta5qmuduhcr5iiejfy3cakctygkvsrfg7fsbng4) does not return different variations. It just returns the same thing no matter the hash use.

Example: UrlWithHash1: https://image-beta.w.kodadot.xyz/ipfs/bafybeidsrzf3zbuopqdta5qmuduhcr5iiejfy3cakctygkvsrfg7fsbng4/?hash=0x8651f9471193069d32dd9fc4eaa47e90fdb6364c33c98ec5efa9a8afb5616af5

UrlwithHash2: https://image-beta.w.kodadot.xyz/ipfs/bafybeidsrzf3zbuopqdta5qmuduhcr5iiejfy3cakctygkvsrfg7fsbng4/?hash=0x4d615ce89fb9c4386d48ea32d6d44dbbfd4eea20afdc531ca2cc370530892a04

Click the link to see the art. Also, could be characteristics of this art that makes the capture service to fail. The image link does not have a canvas element similar to the uniframe one. Only an img. I assume the reload icon would need to be composable with any kodadot are but this behaviour seems inconsistent. Possible solution would be to find canvas then img

In contrast, here's the images generated for the uniframe one Example: UrlWithHash1: https://image-beta.w.kodadot.xyz/ipfs/bafybeiadxh5cyyu25lyg5rxvkr3gpkxbs6xuo3ay47nw3tje4p5e7m7ba4/?hash=0x7fa5fc57f9da7af1b4a3c018a5e489955b10a75311a3133b5e9e866f0f3580ec

UrlwithHash2: https://image-beta.w.kodadot.xyz/ipfs/bafybeiadxh5cyyu25lyg5rxvkr3gpkxbs6xuo3ay47nw3tje4p5e7m7ba4/?hash=0x7a5ede3bbdda89af5327cef31494f1ae13c3f9e89f1ccce83489de44004027a3

vikiival commented 4 months ago

@Complexlity how did you get the url?

the generator url is different (animation_url)

{
    "name": "Vortices #0",
    "description": "**Vortices** is an abstract generative collection featuring interconnected loops and swirls that resemble fluid dynamics or organic patterns found in nature. The intricate blue lines create a sense of movement and rhythm across the canvas, inviting the viewer to get lost in the mesmerizing repetition and flow of the shapes. Crafted with p5.js.",
    "image": "https://dyndata.deno.dev/base/image/0x1b60a7ee6bba284a6aafa1eca0a1f7ea42099373/0",
    "animation_url": "ipfs://bafybeiexwsrhle2f4gjaptc5b3fm2rfo4ztfy5unsxointkqzyoarbpmsy/?hash=0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
    "external_url": "https://kodadot.xyz/"
}
Complexlity commented 4 months ago

Here: https://github.com/vikiival/based-frog-frame/blob/717578113cca0b440dd2ad345d4c1c540e2128d6/src/routes/gallery.tsx#L14

From the based frog frame repo

Update: I used that and it worked!!. Thanks

Complexlity commented 4 months ago

The base minting contract

The repo seem to be private. I assume what yangwao wants is to be able to mint a different variation as well. Not sure how to do that. I see the safe mint only takes and address.

Or do I just make it works the same way (since it mints a random token Id anyway). But then the user can see possible outcomes (which may or may not turn out exactly). Seems that's the instruction

would be perfect for adding [Reload - clockwise icon] on the left with the ability to see 30-50 possible outcomes

vikiival commented 4 months ago

The repo seem to be private

Expected delivery:

  1. Initial frame - as it is + add Reload - clockwise icon

    would be perfect for adding [Reload - clockwise icon] on the left with the ability to see 30-50 possible outcomes

  2. for each reload you will just "show" new picture :)

Complexlity commented 4 months ago

Here: https://github.com/vikiival/based-frog-frame/pull/1

It should work as expected. I tried to deploy a sample version but I'm hit with cloudflare's script too large

kodadot

Update: I deployed it using node/railway and tried to run on warpcast, and it seems the generated image is too large for warpcast (but works fine on frog dev)

Complexlity commented 4 months ago

Update. I've been able to hack it together.

  1. Modified the code to use node deploy rather than cloudflare as I kept getting files too large trying to deploy with wrangler (Source: https://github.com/Complexlity/based-frog-frame/tree/node)
  2. Modified the capture service. It used to a). return a buffer which did not work directly with the frog image. b). Take the highest quality screenshot which made the image size too large (>1mb) while the acceptable size was 256kb. Now, it returns the base64 compatible with frog image and also takes screenshot in jpeg which is way smaller. (Source: https://github.com/Complexlity/vercelgl)

Here : Warpcast Frame Dev Tool Original Url to paste in Warpcast: https://based-frog-frame.up.railway.app/ Check it out. cc: @yangwao