Building an AI Hindi Poem Generator

Akrati VermaAkrati Verma
2 min read

Have you ever wanted to create a project that combines the beauty of poetry with the power of technology? I recently built a Hindi Poem Generator that uses HTML, CSS, JavaScript, an API, Axios, and the typewriter effect to create and display beautiful Hindi poems. This project was both a fun and educational experience, and I'm excited to share how I built it. This post will walk you through the process and the key elements of the project.

Project Overview

The AI Hindi Poem Generator is a web application that generates Hindi poems and displays them in a visually appealing way. Users can click a button to generate a new poem, which is then displayed using a typewriter effect, adding a dynamic and engaging feel to the app.

Setting Up the Project

  • HTML Structure📝

    The HTML structure is straightforward, focusing on the container for the poem and the button to generate a new poem.

  • Styling with CSS🎨

    The CSS provides a clean and simple design, focusing on readability and aesthetics.

  • JavaScript and API Integration🔗

    The JavaScript code handles the API call to fetch the poem and the typewriter effect to display it dynamically.

API Integration

I used the SheCodes AI API to fetch Hindi poems. The API endpoint returns a poem in JSON format, which I then process and display in the app. If you don't have a specific API in mind, you can create a simple one using a service like MockAPI or even hardcode some poems for testing purposes.

Typewriter Effect

The typewriter effect adds a charming touch to the app, simulating the experience of a poem being written out in real-time. This effect is achieved using a simple JavaScript function that gradually reveals each character of the poem.

Conclusion

Building the Hindi Poem Generator was a rewarding experience that allowed me to combine my love for poetry with my coding skills. I hope this walkthrough inspires you to create your own projects and explore the creative possibilities of web development.

You can check out the live version of the Hindi Poem Generator here.

Feel free to leave any questions or feedback in the comments below.

Happy coding!💜

#AIForTommorow

0
Subscribe to my newsletter

Read articles from Akrati Verma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Akrati Verma
Akrati Verma