8
8
< link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/tailwind.min.css "
rel ="
stylesheet "
>
9
9
<!-- Font Awesome CDN -->
10
10
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
11
+ < style >
12
+ /* Additional CSS for floating copy button */
13
+ .copy-button {
14
+ position : absolute;
15
+ top : 0.5rem ;
16
+ right : 0.5rem ;
17
+ background-color : # f3f4f6 ;
18
+ color : # 4b5563 ;
19
+ border : none;
20
+ border-radius : 0.25rem ;
21
+ padding : 0.25rem 0.5rem ;
22
+ font-size : 0.875rem ;
23
+ cursor : pointer;
24
+ transition : background-color 0.3s ease;
25
+ }
26
+
27
+ .copy-button : hover {
28
+ background-color : # e5e7eb ;
29
+ }
30
+ </ style >
11
31
</ head >
12
32
< body class ="bg-gray-100 flex items-center justify-center min-h-screen ">
13
33
@@ -26,20 +46,20 @@ <h1 class="text-2xl font-bold text-center mb-6">Image to Text Converter</h1>
26
46
<!-- Display Selected File -->
27
47
< div id ="fileDetails " class ="mt-4 text-center text-gray-700 "> </ div >
28
48
29
- <!-- Convert and Reset Buttons -->
49
+ <!-- Reset and Convert Buttons (swapped positions) -->
30
50
< div class ="flex space-x-4 ">
31
51
< button type ="button " onclick ="resetForm() " class ="flex-1 bg-gray-300 text-gray-700 py-2 rounded-lg font-semibold hover:bg-gray-400 transition duration-200 "> < i class ="fas fa-redo "> </ i > Reset</ button >
32
- < button type ="submit " class ="flex-1 bg-blue-500 text-white py-2 rounded-lg font-semibold hover:bg-blue-600 transition duration-200 "> < i class ="fas fa-sync-alt "> </ i > Convert to Text</ button >
52
+ < button type ="submit " class ="flex-1 bg-blue-500 text-white py-2 rounded-lg font-semibold hover:bg-blue-600 transition duration-200 "> < i class ="fas fa-sync-alt "> </ i > Convert to Text</ button >
33
53
</ div >
34
54
</ form >
35
55
36
- <!-- Text Area to Display Extracted Text -->
37
- < div class ="mt-6 ">
56
+ <!-- Text Area to Display Extracted Text with Floating Copy Button -->
57
+ < div class ="relative mt-6 ">
38
58
< textarea id ="text " rows ="10 " class ="w-full p-3 border border-gray-300 rounded-lg bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 " readonly > </ textarea >
39
59
40
- <!-- Copy Text Button -->
41
- < button onclick ="copyText() " class ="mt-3 w-full bg-green-500 text-white py-2 rounded-lg font-semibold hover:bg-green-600 transition duration-200 ">
42
- < i class ="fas fa-copy "> </ i > Copy Text
60
+ <!-- Floating Copy Button inside Textarea -->
61
+ < button onclick ="copyText() " class ="copy-button ">
62
+ < i class ="fas fa-copy "> </ i > Copy
43
63
</ button >
44
64
</ div >
45
65
</ div >
@@ -136,4 +156,4 @@ <h1 class="text-2xl font-bold text-center mb-6">Image to Text Converter</h1>
136
156
</ script >
137
157
138
158
</ body >
139
- </ html >
159
+ </ html >
0 commit comments