From 26b685d3064ee2a229d654463efbab7a42dda698 Mon Sep 17 00:00:00 2001 From: Aishwaria Lakshmi Date: Wed, 15 Apr 2026 19:12:44 +0530 Subject: [PATCH] My project code --- src/App.css | 38 +++++++++++++++++++++++ src/App.tsx | 8 +++++ src/Editor.tsx | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 src/App.css create mode 100644 src/App.tsx create mode 100644 src/Editor.tsx 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 +

+ +