Giter Site home page Giter Site logo

jackyzha0 / cursor-chat Goto Github PK

View Code? Open in Web Editor NEW
220.0 5.0 10.0 2.95 MB

๐Ÿ’ฌ cursor chat ร  la Figma for digital co-existing + presence

Home Page: https://jackyzha0.github.io/cursor-chat/

License: MIT License

HTML 12.39% TypeScript 72.68% CSS 11.63% JavaScript 3.30%
vite yjs cursor-chat p2p

cursor-chat's Introduction

cursor-chat

๐Ÿ’ฌ (63.4kB) lightweight cursor chat ร  la Figma for digital co-existing + presence

As a warning, this library is for experimental purposes and should not be used in production (but very suitable for personal websites and playful experiments!).

Built on top of yjs and perfect-cursors

For a React version of this library, check out y-presence.

Demo

Cursor Chat Demo

Press / to start chatting and esc

Usage

Include this fragment in your HTML somewhere to include the base HTML divs, the compiled JavaScript bundle, and the styling.

<div id="cursor-chat-layer">
  <input type="text" id="cursor-chat-box">
</div>
<script type="module">
  import { initCursorChat } from 'https://esm.sh/cursor-chat'
  initCursorChat("your-room-name-here")
</script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/cursor-chat/dist/style.css"/>

cursor-chat's People

Contributors

adambrangenberg avatar jackyzha0 avatar spencerc99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cursor-chat's Issues

improvements

  • should be able to type "/" while typing
  • should have some subtle indicator on webpage when there are multiple people in the same room that instructs using "/" to type to each other
  • the typing UX should match what other people see (also so you can see all that you have typed), with some subtle outline to indicate that its your active one
    Screenshot 2023-07-01 at 10 15 13 PM

Fix cursor-chat div expanding page size

When initializing all the cursors, some old cursors might have document height much larger than the current size. Either don't render new cursors right away or ignore cursor events outside of document size

Chat box is sometimes offset incorrectly

Should be fixed if you add the following:

  top: 0px;
  left: 0px;

to #cursor-chat-layer (too lazy to make a PR).

Example:
image

(My cursor is at the top right of the selected text)

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.