## Inspiration

I don't even go to Stanford, but I think it's well-known that Stanford's unofficial mascot is a tree. "Fear the tree," I'd hear growing up. You know how people dress up as mascots at sports games? Well, I recently found out that the Stanford tree as a mascot is...a sight to see. For example, [this](https://tinyurl.com/24l99kbt). So, while I was brainstorming fun solo projects for TreeHacks this year (I had other commitments this weekend and didn't want to drag down a team), my brother suggested this idea as a joke. Turns out, I'm a total clown and actually implemented it. 🤡

## What it does

This is a random generator that randomly cycles through various designs of trees, eyes, and mouths. When you click "Generate," the generator randomly cycles through designs while gradually slowing down until it settles on the final design. This exciting moment is marked by confetti! 🥳You can also lock one or more features via the buttons on the bottom. When a feature is locked, it will remain in the design even if you hit "Generate" again. Once you see a design you like, you can hit the save button to download a PNG of the design.

## How I built it

I first designed the UI in Figma, then I made a React app to bring the design to life. The website originally just generated a design with no animation when a button was clicked. Since I still had time, I added features one by one while learning a lot about React along the way. I created SVGs of the various design in Vectornator. Some were just icons that were free to use, and others were drawn by me in the app. Finally, I deployed it to Heroku since only having it locally isn't that exciting.

## Challenges I ran into

I wanted to rerender the design each time the random number generator updated the state so that new images would be displayed, and I initially tried to do this with a simple onClick event handler. However, turns out React batches the state updates and only rerenders once at the end of the event handler. You learn something new every day! I got around this by using ComponentDidUpdate() combined with a timer. It was an interesting problem to tackle, and I was pleasantly surprised by the challenge since I initially thought this project would be very straightforward.

## Accomplishments that I'm proud of

I'm proud of getting a somewhat functional version deployed on Heroku—in so many cases, my project works fine locally, but once it's deployed, oftentimes, it still doesn't behave quite as I want it to! This project was no different, and the random generator animation that looked so satisfying locally made my computer look like it was spazzing on Heroku. I addressed this by forcing images to load in the beginning and be cached, and also changing the image type to SVG so that the file size would be smaller. I admit, the version on Heroku still looks a little sus, but at least it's better than before!

## What I learned

I became more comfortable working with React, and one of my biggest takeaways was how ComponentDidUpdate() works. This played a crucial role in the random generator animation. I also learned how to add confetti to a webpage, and hey, who doesn't like confetti? 🎊

## What's next for which sTaNfoRD tree are you?

Some future improvements I have in mind include:

* Making sure the random generator animation runs smoothly on all browsers (it currently performs best locally)
* Fixing save function to support SVG inputs
* Adding more designs and accessories (like hats)
* Allowing the user to browse all of the designs and choose whatever they want
* Creating a random name generator to accompany the designs, inspired by the Tabby Cat extension

Frankly, this project is not going to help the world besides providing some people with a little entertainment, so I plan to move onto other projects. I definitely had fun building this and learning more about React, and I'm excited to apply this new knowledge in the future!
## Inspiration

We wanted to do a super fun and really technically challenging project, so we decided to do something combining our passions: Computer Vision, Electrical Engineering, and Controls. We decided to make a nerf gun turret that recognizes faces, points in the direction of the recognized face, and shoots.

## What it does

It recognizes a face, and points the turret in their direction, then shoots nerf darts at them.

## How we built it

The turret has an OpenCV facial detection program running on a Mate 10 Pro. The Mate sends the coordinates of any faces found to a raspberry pi which reads the input from the Android Developer Bridge and forwards the data over a serial port to the Arduino which runs the controls for aiming and firing the turret.

## Challenges we ran into

The biggest challenge we ran into was the lack of electrical supplies. Ideally, we would use a NEMA 23 or NEMA 34 stepper motor to drive our turret's rotation, but we could only get a NEMA 17. This caused our turret to be underpowered when it turned and caused very jerky motion control. We can fix this issue by simply upgrading the stepper.

## Accomplishments that we're proud of

We are extremely pleased with our vision system. We got a full face detection algorithm working on an Android phone. We are really proud of our algorithm too because we achieved 250ms latency from when the image is taken to when the coordinates are sent to the RPI. Additionally, we are really happy that we got the full coordinate communication system working; we got the Mate to communicate smoothly with the Raspberry Pi, and then we managed to get the Pi talking to the Arduino, creating a pipeline of coordinate information. We are also really proud of how well our shooting logic works. The nerf gun's sequence shooting was well refined and worked very smoothly.

## What we learned

We learned how to write OpenCV code for an Android phone. We also learned that we should plan our electrical components ahead of time, and be more proactive about making sure we have the exact parts we need, and that the parts are capable of doing what we need.

## What's next for Nerf Turret

We'd love to upgrade the rotational motor so we can implement PID control on the rotational motor. This would enable us to get really precise shooting and take full advantage of our low latency vision algorithm.
## Inspiration

Initially, we struggled to find a project idea. After circling through dozens of ideas and the occasional hacker's block, we were still faced with a huge ***blank space***. In the midst of all our confusion, it hit us that this feeling of desperation and anguish is familiar to all thinkers and creators. There came our inspiration - the search for inspiration. Tailor is a tool that enables artists to overcome their mental blocks in a fun and engaging manner, while leveraging AI technology. AI is very powerful, but finding the right prompt can sometimes be tricky, especially for children or those with special needs. With our easy to use app, anyone can find inspiration as swiftly as possible.

## What it does

The site generates prompts artists to generate creative prompts for DALLE. By clicking the "add" button, a react component containing a random noun is added to the main container. Users can then specify the color and size of this noun. They can add as many nouns as they want, then specify the style and location of the final artwork. After hitting submit, a prompt is generated and sent to OpenAI's API, which returns an image.

## How we built it

It was built using React Remix, OpenAI's API, and a random noun generator API. TailwindCSS was used for styling which made it easy to create beautiful components.

## Challenges we ran into

Getting tailwind installed, and installing dependencies in general. Sometimes our API wouldn't connect, and OpenAI rotated our keys since we were developing together. Even with tailwind, it was sometimes hard for the CSS to do what we wanted it to. Passing around functions and state between parent and child components in react was also difficult. We tried to integrate twiliio with an API call but it wouldn't work, so we had to setup a separate backend on Vercel and manually paste the image link and phone number. Also, we learned Remix can't use react-speech libraries so that was annoying.

## Accomplishments that we're proud of

* Great UI/UX!
* Connecting to the OpenAI Dalle API
* Coming up with a cool domain name
* Sleeping more than 2 hours this weekend

## What we learned

We weren't really familiar with React as none of use had really used it before this hackathon. We really wanted to up our frontend skills and selected Remix, a metaframework based on React, to do multipage routing. It turned out to be a little overkill, but we learned a lot and are thankful to mentors. They showed us how to avoid overuse of Hooks, troubleshoot API connection problems, and use asynchrous functions. We also learned many more tailwindcss classes and how to use gradients.

## What's next for Tailor

It would be cool to have this website as a browser extension, maybe just to make it more accessible, or even to have it scrape websites for AI prompts. Also, it would be nice to implement speech to text, maybe through AssemblyAI