Micro AI Tool
Text Tone Converter
This project rewrites any draft text into a different tone without using a database.
What It Does
- Takes any original message or draft as input.
- Converts it into a target tone such as professional, friendly, direct, premium, or bold.
- Returns a primary rewrite, a shorter version, and an alternative version.
- Also includes notes about what changed in the tone.
- Shows the final result inside a focused modal popup for fast copying.
Setup
- Open
functions/config.local.php. - Add your OpenAI API key to
openai_api_key. - Keep or change the default model in
openai_model. - Optional: add
adsense_clientandadsense_sidebar_slotto activate the right sidebar ad area. - Make sure PHP
curlis available on the server. - Load
/TextToneConverter/in your browser through MAMP.
How To Use
- Paste the original text.
- Select the target tone, intent, and format.
- Add optional context or a communication goal.
- Click
Convert Tone. - Review and copy the result from the popup modal.
Folder Structure
index.php– main UI entry pointcss/style.css– interface stylingjs/app.js– browser-side interactions and modal flowfunctions/lib.php– converter logic, OpenAI requests, validation, rate limitingfunctions/api.php– backend API endpointfunctions/config.local.php– local API key, model, and ad settingsstorage/logs– error and debug logs
Security Notes
- The
functionsandstoragefolders are protected with.htaccess. - Requests use a CSRF token.
- A simple file-based rate limit reduces abuse without a database.
Troubleshooting
- If conversion fails, check
functions/config.local.phpfor the API key. - If the API returns an error, inspect the generated log file under
storage/logs. - If the popup does not open, make sure JavaScript is enabled.
- If folder protection does not work, make sure Apache allows
.htaccessoverrides.