From 0b573a2a8613ce34ab85b944e87be431e40b25af Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Mon, 30 Jun 2025 16:50:16 -0400 Subject: [PATCH] implement class-based initialization system and DRY refactoring for uncloseai.js - Add .uncloseai class support with data-features configuration - Create shared utility functions for buttons, chat messages, TTS controls, voice selects, and modal headers - Refactor class-based feature creators to use shared utilities - Add comprehensive documentation for class-based integration in index.html - Add live examples of class-based usage in demo.html - Maintain backward compatibility with existing floating button and API functions --- demo.html | 117 ++++++++++ index.html | 57 ++++- uncloseai.js | 640 ++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 800 insertions(+), 14 deletions(-) diff --git a/demo.html b/demo.html index a4f09c5..383254d 100644 --- a/demo.html +++ b/demo.html @@ -72,6 +72,123 @@ +

Class-Based Integration Examples

+

You can now embed AI features directly into your HTML using CSS classes and data attributes:

+ +

Full AI Interface

+

Add a complete AI chat interface with all features:

+
+ +

Custom Feature Selection

+

Choose specific features you want:

+ +
Chat Only
+
+ +
Buttons Only (TTS + Upload + Read)
+
+ +
TTS Only
+
+ +

Individual Function Examples

+

You can also call uncloseai.js functions directly from your own buttons and interfaces:

+ +

Direct AI Chat

+ + + +

Text-to-Speech

+ + +
+ +

Page Reading

+ + +

File Upload (if you have files)

+ + + + + +