Skip to content

TakumiHendricksDev/ai-js-data-attribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

It umm allows you to add an ai data attribute to html to generate js code on build. Why would you do this? You wouldn't...

How to use?

Create a .env file and put in your openapi key as follows:

OPENAI_API_KEY=######

Then simply run npm install

Then run npm run dev

How to edit?

Just edit the index.html file. When ever you want raw js to be generated use the ai="" data attribute on an html element and give it an id.

For example lets say you wanted a button that changed the background color of anything with the class change-color to red just do

<button id="change-background-color" ai="When pressed change the background color of any class with change-color to red">Change color</button>

Having js errors?

Sorry no luck here... You can update the ai-generated.js but thats temp until rebuilding...

About

Please dont use this...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published