Glide
The caret is drawn by the page, not the browser, so it springs between positions and blinks the soft iOS way.
커서가 스프링처럼 미끄러지고 부드럽게 깜빡입니다.
Morph
Selection boxes grow out of the caret, one per line, and fold back into it when you tap away.
선택 영역이 커서에서 자라나고 다시 접힙니다.
Handles + loupe
Lollipop handles you can drag. Hold or drag and a magnifier shows the caret and selection up close.
손잡이를 끌거나 꾹 누르면 돋보기가 나옵니다.
Edit menu
Cut, Copy, Paste, Select All, in English or Korean. Works with the system clipboard, with a fallback.
오려두기 · 복사하기 · 붙여넣기 · 전체 선택.
Use it
import { caret } from './caret.js'
const c = caret(document.querySelector('[contenteditable]'), {
tint: '#0a84ff', // caret, handles, selection
loupe: 'glass', // 'glass' | 'flat' | 'off'
menu: true, // Cut · Copy · Paste · Select All
glide: true, // spring between positions
lang: 'auto', // 'en' | 'ko' | 'auto'
})
c.set({ tint: '#bf5af2' }) // change anything live
c.destroy()
One file, no dependencies, MIT. Works with mouse, touch and keyboard, in Chrome, Safari and Firefox. Korean input works as usual.