Skip to content

Commit 12afab1

Browse files
committed
more visuals changes
1 parent 7c56453 commit 12afab1

File tree

3 files changed

+32
-54
lines changed

3 files changed

+32
-54
lines changed

MyDevTools/Components/Pages/OutputAndCopyToClipboard.razor

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
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 {
Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
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
}

MyDevTools/Components/Pages/UrlEncoderDecoder.razor

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@page "/URLEncoderDecoder"
22
@inherits Base.BasePage
3-
@inject Services.IClipboardService ClipboardService
43
@inject NavigationManager NavigationManager
54

65

@@ -16,28 +15,18 @@
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
{
@@ -75,17 +64,4 @@
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
}

0 commit comments

Comments
 (0)