Skip to content

🚗 Developing some lightweight front-end libraries. 记录一些轻量级的前端库 (造轮子)。👉 主打 "简洁、通用、无依赖"。

Notifications You must be signed in to change notification settings

Marinerer/jotter

Repository files navigation

Jotter

Developing some lightweight front-end libraries (build wheels). Mainly "simple, generic, no dependencies".

记录一些轻量级的前端库 (造轮子)。👉 主打 "简洁、通用、无依赖"。

全部来自工作中开发的源码,非常适合项目中实现一些简单功能。

📦 Packages

Package Version Description
@jotter/websocket version Modern and useful WebSocket wrapper, with standard WebSocket API.
@jotter/animator version Animator is an animation playback controller.
@jotter/drag version Lightweight "drag-and-drop" library of draggable elements within a specified range.
dom-event-emit version A type-safe, flexible DOM event emitter for browser environments.
@jotter/emitter version Simple and modern event emitter library.
@jotter/dateformat version A date/time formatting function.
@jotter/from-now version A relative time formatting functions.
@jotter/position version Positioning a DOM element relative to another DOM element.

@jotter/websocket

📚 Document

Modern and useful WebSocket API wrapper class with additional features such as auto-reconnect, message queuing and Keep-alive detection.

标准且实用的 WebSocket 包装器,具有标准 WebSocket API。支持心跳检测,异常消息处理和自动重连机制。

  • ⏰ With Standard WebSocket API
  • 🧬 Automatic Reconnection
  • 💓 Keep-alive (Ping) Support
  • 📮 Message Queuing
  • 🌐 Flexible Configuration

@jotter/animator

📚 Document

A lightweight animation controller library for managing time-based animation progress.

一个轻量级的动画控制库,用于管理基于时间的动画进度。

  • ⏯ Pause/Resume support
  • 🔄 Loop animation support
  • 🚥 Progress Control
  • 🚌 Rate Control
  • ⏱ Forward/Backward control
  • 🎯 Custom Animation

@jotter/drag

📚 Document

A lightweight, flexible drag-and-drop library for making DOM elements draggable with mouse and touch support.

一个轻量级的拖拽库,允许你快速而轻松地使DOM元素在指定区域内拖动。

  • 🎯 Directional constraints (horizontal/vertical/free)
  • 📱 Mouse and touch support
  • 🔒 Customizable drag boundaries
  • 🎨 Position or transform-based movement
  • 🎮 Custom drag handles
  • 📦 Zero dependencies

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.