File tree Expand file tree Collapse file tree 3 files changed +32
-54
lines changed
MyDevTools/Components/Pages Expand file tree Collapse file tree 3 files changed +32
-54
lines changed Original file line number Diff line number Diff line change 11@using Microsoft .AspNetCore .Components
22
3- <div class =" col-md-4 offset-md-4" >
4- <label >Results</label >
5- <div class =" container" >
6- <textarea @bind =" OutputText" rows =" 6" ></textarea >
7-
8- </div >
9-
10- <div class =" container" >
11- <button class =" btn btn-primary" @onclick =" CopyToClipboard" >Copy to Clipboard</button >
12-
3+ <div class =" col-md-6 offset-md-3 mt-5" >
4+ <div class =" card shadow-sm" >
5+ <div class =" card-header bg-primary text-white" >
6+ <h5 class =" mb-0" >Results</h5 >
7+ </div >
8+ <div class =" card-body" >
9+ <textarea class =" form-control mb-3" @bind =" OutputText" rows =" 6" placeholder =" Your output will appear here..." ></textarea >
10+ <button class =" btn btn-success w-100" @onclick =" CopyToClipboard" >Copy to Clipboard</button >
11+ <div class =" mt-3" >
12+ <span class =" text-success" >@copyConfirmationMessage </span >
13+ </div >
14+ </div >
1315 </div >
14-
15- <br />
16- <div class =" container" >
17- <label class =" btn-success" >@copyConfirmationMessage </label >
18- </div >
19-
2016</div >
2117
2218@code {
Original file line number Diff line number Diff line change 1- /*.output-pane {
2- overflow: hidden;
3- resize: none;*/ /* Prevent manual resizing */
4- /*min-height: 2em;*/ /* Minimum height */
5- /*box-sizing: border-box;*/ /* Include padding in the height calculation */
6- /*}*/
7-
8- .textarea {
1+ .textarea {
92 overflow : hidden;
103 resize : none; /* Prevent manual resizing */
4+ min-height : 6em ; /* Set a more appropriate minimum height */
5+ box-sizing : border-box; /* Include padding in the height calculation */
6+ padding : 10px ; /* Add padding for better appearance */
7+ font-size : 1rem ; /* Set a readable font size */
8+ border : 1px solid # d1d1d1 ; /* Subtle border color */
9+ border-radius : 4px ; /* Add border radius for smoother edges */
1110}
1211
1312.text-success {
14- color : green;
13+ color : # 6c757d ; /* Subtle gray color */
14+ font-weight : bold; /* Make the text bold for better visibility */
15+ margin-top : 10px ; /* Add margin to separate from other elements */
1516}
1617
1718.button {
1819 padding : 10px 20px ;
19- background-color : # 007bff ;
20+ background-color : # 6c757d ; /* Subtle gray color */
2021 color : # fff ;
2122 border : none;
2223 border-radius : 5px ;
2324 cursor : pointer;
25+ font-size : 1rem ; /* Set a readable font size */
26+ transition : background-color 0.3s ease; /* Smooth transition for hover effect */
2427}
2528
26- .button : hover {
27- background-color : # 0056b3 ;
28- }
29+ .button : hover {
30+ background-color : # 5a6268 ; /* Slightly darker gray on hover */
31+ }
2932
3033.label {
3134 margin-left : 10px ;
35+ color : # adb5bd ; /* Subtle gray color */
36+ font-size : 0.875rem ; /* Set a smaller font size for labels */
37+ font-weight : 500 ; /* Medium font weight for better readability */
3238}
Original file line number Diff line number Diff line change 11@page " /URLEncoderDecoder"
22@inherits Base .BasePage
3- @inject Services .IClipboardService ClipboardService
43@inject NavigationManager NavigationManager
54
65
1615
1716 <button class =" btn btn-primary btn-block" @onclick =" EncodeUrl" >Encode URL</button >
1817 <button class =" btn btn-warning btn-block" @onclick =" DecodeUrl" >Decode URL</button >
19- <button class =" btn btn-success btn-block" @onclick =" CopyToClipboard" >Copy to Clipboard</button >
2018 </div >
2119 </div >
2220
2321 @if (! string .IsNullOrEmpty (processedUrl ))
2422 {
25- <div class =" row mt-4" >
26- <div class =" col-md-6 offset-md-3" >
27- <div class =" alert alert-success" role =" alert" >
28- <strong >Processed URL : </strong >
29- <textarea readonly class =" form-control" rows =" 3" >@processedUrl </textarea >
30- <div class =" mt-2 text-success" >@copyConfirmationMessage </div >
31- </div >
32- </div >
33- </div >
23+ <OutputAndCopyToClipboard OutputText =" @processedUrl" />
3424 }
3525</div >
3626
3727@code {
3828 private string inputUrl = " " ;
3929 private string processedUrl = " " ;
40- private string copyConfirmationMessage = " " ;
4130
4231 protected override async Task OnInitializedAsync ()
4332 {
7564 processedUrl = " Error: " + ex .Message ;
7665 }
7766 }
78-
79- private async Task CopyToClipboard ()
80- {
81- try
82- {
83- await ClipboardService .CopyToClipboardAsync (processedUrl );
84- copyConfirmationMessage = " Text copied to clipboard!" ;
85- }
86- catch (Exception ex )
87- {
88- copyConfirmationMessage = " Error: " + ex .Message ;
89- }
90- }
9167}
You can’t perform that action at this time.
0 commit comments