Giter Club home page Giter Club logo

deftio / yackbox Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 156 KB

yackbox is a simple vanilla (no dependancies) JavaScript chat control that can be easily integrated into web applications. It provides a customizable chat interface with support for adding, updating, and removing messages, along with multi-user support and message history controls

Home Page: https://deftio.github.io/yackbox

License: Other

HTML 76.13% JavaScript 23.87%
chat-control chatbot chatui javascript

yackbox's Introduction

yackbox.js

~ ~ note: alpha version frequent changes ~ ~ yackbox is a simple vanilla (no dependancies) JavaScript chat control that can be easily integrated into web applications. It provides a customizable chat interface with support for adding, updating, and removing messages, along with multi-user support and message history controls.

Features

Add messages with customizable user and alignment options. Update existing messages with new content. Remove messages from the chat interface. Retrieve the chat log. Log contains timestamps for all messages. Callback function for message events. Responsive design for various screen sizes.

Installation

To use yackbox in your project, follow these steps:

Include the yackbox.js JavaScript file in your project. Link the yackbox.css stylesheet to style the chat interface. html

<script src="./path/to/yackbox.js"></script>
<link rel="stylesheet" href="yackbox.css">

Create a container element in your HTML where you want the chat interface to appear:

<div id="chat-container"></div>

Initialize yackbox in your JavaScript code by providing the container element and a callback function for message events:

const chat = new yackbox('#chat-container', messageCallback);
//Use the provided methods to interact with the chat control:

// Add a message
chat.addMessage('Hello!', 'User', 'left');  // user should appear left or right justified

// Update a message
chat.updateMessage(1, 'New content');

// Remove a message
chat.removeMessage(1);

// Get the chat log
const log = chat.getLog();
console.log(log);

Usage

Yackbox is highly customizable and can be integrated into various web applications. You can modify the appearance and behavior of the chat interface by adjusting the CSS styles and JavaScript code according to your requirements.

Examples

Included are several examples including: Example Code

  • UMD and ESM usage in browser
  • Multiuser and multiple instance setups
  • Using message history and stats
  • Streaming and completions based LLM use

Building from Source

Make sure to run npm install. Then run npm run build. Note that at run time yackbox has no dependancies, but at build time several tools are used for packing and minifying code.

Contributors

License

yackbox is licensed under the BSD-2 License.

yackbox's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.