按周更新
也可能按月,反正会持续更新
目录
- daily
- 2024-2-23=> 2024-2-29
- 2024-05-26=>2024-05-31
- 2024-06-01=>2024-06-07
- 2024-07-17=>2024-07-26
- 2024-08-02=>2024-08-18
- 2024-08-18=>2024-09-08
- 2024-09-08 13:41:26=>2024-10-11 10:58:29
- 2024-10-11 10:58:29=>2024-12-11 17:55:24
- 2024-12-11 17:55:24=>********
- LLM
daily
2024-2-23=> 2024-2-29
2024-05-26=>2024-05-31
2024-06-01=>2024-06-07
简单使用
npm install --save signature_pad
import { useEffect, useRef } from "react";
import SignaturePad from "signature_pad";
import { Button } from "@shadcn/ui/button";
const signaturePadDemo = () => {
const canvasRef = useRef<HTMLCanvasElement>(null);
let signaturePad: SignaturePad | null;
useEffect(() => {
const canvas = canvasRef.current;
if (canvas) {
signaturePad = new SignaturePad(canvasRef.current!, {
backgroundColor: "rgb(255, 255, 255)",
});
console.log("signaturePad:", signaturePad);
function resizeCanvas() {
const ratio = Math.max(window.devicePixelRatio || 1, 1);
canvas.width = canvas.offsetWidth * ratio;
canvas.height = canvas.offsetHeight * ratio;
canvas.getContext("2d").scale(ratio, ratio);
signaturePad.clear();
}
resizeCanvas();
addEventListener("resize", resizeCanvas);
}
});
const downloadPng = () => {
const data = signaturePad?.toDataURL();
if (data) {
const link = document.createElement("a");
link.download = "signature.png";
link.href = data;
link.click();
}
};
const downloadSvg = () => {
const data = signaturePad?.toDataURL("image/svg+xml");
if (data) {
const link = document.createElement("a");
link.download = "signature.svg";
link.href = data;
link.click();
}
};
return (
<>
<canvas ref={canvasRef} className="w-full h-40"></canvas>
<div className="ope flex gap-5 justify-center pt-2">
<Button variant="outline" onClick={downloadPng}>
下载png
</Button>
<Button variant="outline" onClick={downloadSvg}>
下载svg
</Button>
<Button
variant="outline"
onClick={() => {
signaturePad?.clear();
}}
>
清空
</Button>
</div>
</>
);
};
export default signaturePadDemo;
2024-07-17=>2024-07-26
2024-08-02=>2024-08-18
Click to expand
2024-08-18=>2024-09-08
how to use
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
<a
data-tooltip-id="my-tooltip"
data-tooltip-content="Hello world!"
data-tooltip-place="top"
>
◕‿‿◕
</a>
<Tooltip client:load id="my-tooltip" />
<a className="my-anchor-element">◕‿‿◕</a>
<a className="my-anchor-element">◕‿‿◕</a>
<a className="my-anchor-element">◕‿‿◕</a>
<Tooltip anchorSelect=".my-anchor-element" place="top">
Hello world!
</Tooltip>
2024-09-08 13:41:26=>2024-10-11 10:58:29
v0 ai 初次使用
hello darkness my old friend, I’m coming to you now 👋 again
- react 19 cheatsheet
- ts in vue
- math vs js
- material ui like app with vue3
- cesium 文档
- wasm介绍
- hugging face finevideo
- wasm-pack
- awesome-wasm
- wasm-explorer
- next blog
2024-10-11 10:58:29=>2024-12-11 17:55:24
- astro toggle theme
- openprocessing-p5js相关创意设计
- emscripten-sqljs使用的wasm complier
- tutorialkit-for Coding Tutorials
- chrome129 calc-size interpolate-size
- player.style video player style
- plainvanillaweb-使用web component 以及原生JS的实践
- 根据图片获取颜色
- 不健康图片检测
- 条形码扫描sdk-@pixelverse/strichjs-sdk
- 和弦符号解析和渲染仓库-no-chris/chord-symbol
- cesium api 文档
- threejs结合手势识别
- playcode
- mono repo tool chain
- daisyui
- convert svg
2024-12-11 17:55:24=>********
emoji domain
others
基本信息 | 详细信息 | |||
---|---|---|---|---|
ID | 名 | 访问次数 | 状态 | 进度 |
第 1 页,
共 0 页