diff --git a/src/App.css b/src/App.css new file mode 100644 index 000000000..74b5e0534 --- /dev/null +++ b/src/App.css @@ -0,0 +1,38 @@ +.App { + text-align: center; +} + +.App-logo { + height: 40vmin; + pointer-events: none; +} + +@media (prefers-reduced-motion: no-preference) { + .App-logo { + animation: App-logo-spin infinite 20s linear; + } +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 000000000..55b45c9f0 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,8 @@ +import React from "react"; +import Editor from "./Editor"; + +function App() { + return ; +} + +export default App; \ No newline at end of file diff --git a/src/Editor.tsx b/src/Editor.tsx new file mode 100644 index 000000000..dad9b192d --- /dev/null +++ b/src/Editor.tsx @@ -0,0 +1,82 @@ +import React, { useState } from "react"; + +const Editor = () => { + const [text, setText] = useState(""); + const [pasteEvents, setPasteEvents] = useState< + { length: number; time: string }[] + >([]); + + const handlePaste = (e: React.ClipboardEvent) => { + const pastedText = e.clipboardData.getData("text"); + + const newEvent = { + length: pastedText.length, + time: new Date().toLocaleTimeString(), + }; + + setPasteEvents((prev) => [...prev, newEvent]); + + alert("📋 Paste detected!"); + }; + + return ( + + Vi-Notes Editor + + Detecting pasted content for authenticity verification + + + setText(e.target.value)} + onPaste={handlePaste} + /> + + + Paste Activity + + Total Pastes: {pasteEvents.length} + + {pasteEvents.length === 0 ? ( + No paste detected + ) : ( + pasteEvents.map((event, index) => ( + + 📋 {event.length} characters at {event.time} + + )) + )} + + + ); +}; + +const styles = { + container: { + textAlign: "center" as const, + padding: "20px", + fontFamily: "Arial", + }, + title: { + color: "#333", + }, + textarea: { + width: "80%", + height: "200px", + padding: "10px", + fontSize: "16px", + borderRadius: "10px", + border: "1px solid #ccc", + outline: "none", + }, + logBox: { + marginTop: "20px", + background: "#f5f5f5", + padding: "10px", + borderRadius: "10px", + }, +}; + +export default Editor; \ No newline at end of file
+ Detecting pasted content for authenticity verification +
Total Pastes: {pasteEvents.length}
No paste detected
+ 📋 {event.length} characters at {event.time} +