JavaScript超好看手绘风格的注释组件—rough
简要介绍
roughnotation是一款web页面目标元素标记动画注释的组件,该组件十分适合展示类的场景。它非常轻巧,只有3.8kb大小。它在github拥有5.3k颗星,足可以见其受欢迎的程度。它的注释方式多样,包括:下划线、盒状、圆圈、高亮、水平划除线、X型划除线、方括号。
Github地址
https://github.com/rough-stuff/rough-notation
安装
npm install --save rough-notation
引用
import { annotate } from 'rough-notation';
// Or using unpkg
// import { annotate } from 'https://unpkg.com/rough-notation?module';
效果
const e = document.querySelector('#myElement');
const annotation = annotate(e, { type: 'underline' });
annotation.show();