In my spare time, I love to explore my creative side. Lately, I’ve been having a blast working with GPT-4, ChatGPT, and other AI language tools. They’ve helped me create everything from funny poems to collaborating on code projects that once seemed out of reach.
A Spark of Inspiration
My journey began with a fascination for Jackson Pollock’s drip paintings. I wondered if I could create digital versions of these mesmerizing works. With Python coding and another person’s web app, I produced a series of digital drip paintings and minted them as NFTs. Check out my previous NFT project, Dripping with Emotion.
AI to the Rescue
Here’s an example of some art that it generates:
A Look Behind the Curtain: GPT-4’s Collaboration
Interestingly, I barely touched any of the code behind this project. Most of it was written by GPT-4, and I just kept guiding it along to make the features I wanted. It’s incredible how AI has helped me achieve something that would have been much more difficult on my own. Let’s dive into some of the key aspects of the code:
getSeedFromURL(): This function extracts the seed word from the URL’s query parameters.
hashStringToSeed(s): This function takes a string as input and returns a hash value to seed the random number generators in the p5.js sketch.
Drips are generated using the
createDrips() function, which takes a p5.js instance and a number of drips to create as arguments. It uses the
DotDrip classes to create randomly positioned and sized drips in different colors.
Animation and Interaction
hideWarningAndOverlay() function is triggered when the user submits their seed word, which then calls the
regenerateDripsWithSeed() function to create a new set of drips based on the input seed.
The web app is also designed to be responsive, with CSS media queries adjusting font sizes and element widths for smaller devices. This ensures that the app looks great on all screen sizes.
It’s fascinating to see how GPT-4 played a significant role in creating this web app. With just a little guidance, it generated the code, and I was able to bring my vision to life.
It’s been a fantastic project, and I did it all in a weekend! I can’t wait to see what more I can accomplish.