c
cozyscreenshot
Beautiful screenshots · in seconds
55%
drop anywhere
</>App.tsx
{}constants.ts
.cssglobals.css
cozyscreenshot
📁 src/app
📁 _components
App.tsx
Canvas.tsx
Controls.tsx
constants.ts
layout.tsx
page.tsx
globals.css
outline
TAppState
ƒhandleImage
ƒonExport
1
// cozyscreenshot — paste → customize → export
2
import { useState, useCallback } from "react";
3
import { toPng } from "html-to-image";
4
5
export default function App() {
6
const [image, setImage] = useState<string | null>(null);
7
const paste = useCallback(async () => {
8
const [item] = await navigator.clipboard.read();
9
const blob = await item.getType("image/png");
10
setImage(URL.createObjectURL(blob));
11
}, []);
12
13
const download = async () => {
14
const node = document.getElementById("bs-capture-root")!;
15
const url = await toPng(node, { pixelRatio: 2 });
16
// → cozyscreenshot-1713…png 💾
17
};
18
}
⎇ main 0 errorsTypeScript 5.6.3Ln 10, Col 34UTF-8LF
cozyscreenshot.com