From 695a0424bcbaa957ac841118a558a1ff4150388e Mon Sep 17 00:00:00 2001 From: Michal Vrba Date: Sun, 14 Dec 2025 12:21:21 +0100 Subject: [PATCH] Add DonateButton component with PayPal support Introduced a new DonateButton component that displays a styled "Donate" button with a PayPal icon and opens a PayPal donation link in a new tab using JS interop. Added responsive CSS for the component. Integrated the DonateButton into Home.razor below the feature list to encourage user support. Updated _Imports.razor to make the component available app-wide. --- TuneRipper/Components/DonateButton.razor | 23 ++++ TuneRipper/Components/DonateButton.razor.css | 109 +++++++++++++++++++ TuneRipper/Pages/Home.razor | 2 + TuneRipper/_Imports.razor | 1 + 4 files changed, 135 insertions(+) create mode 100644 TuneRipper/Components/DonateButton.razor create mode 100644 TuneRipper/Components/DonateButton.razor.css diff --git a/TuneRipper/Components/DonateButton.razor b/TuneRipper/Components/DonateButton.razor new file mode 100644 index 0000000..2f1dfc9 --- /dev/null +++ b/TuneRipper/Components/DonateButton.razor @@ -0,0 +1,23 @@ +@inject IJSRuntime JSRuntime + + + +@code { + private async Task OpenPayPalDonation() + { + var paypalUrl = "https://paypal.me/vrbaone"; + await JSRuntime.InvokeVoidAsync("open", paypalUrl, "_blank"); + } +} \ No newline at end of file diff --git a/TuneRipper/Components/DonateButton.razor.css b/TuneRipper/Components/DonateButton.razor.css new file mode 100644 index 0000000..57f5e22 --- /dev/null +++ b/TuneRipper/Components/DonateButton.razor.css @@ -0,0 +1,109 @@ +.donate-section { + margin-top: 25px; + display: flex; + justify-content: center; +} + +.donate-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; +} + +.donate-header { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + margin-bottom: 12px; +} + +.donate-icon { + font-size: 1rem; +} + +.donate-title { + color: white; + margin: 0; + font-size: 1.2rem; + font-weight: 600; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.donate-description { + color: rgba(255, 255, 255, 0.9); + margin: 0 0 16px 0; + font-size: 0.875rem; + line-height: 1.5; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); +} + +.donate-btn { + background: #0070ba; + color: white; + border: none; + padding: 10px 20px; + border-radius: 8px; + font-size: 0.9rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s ease; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + box-shadow: 0 2px 4px rgba(0, 112, 186, 0.2); +} + +.donate-btn:hover { + background: #005ea6; + transform: translateY(-1px); + box-shadow: 0 4px 8px rgba(0, 112, 186, 0.3); +} + +.donate-btn:active { + transform: translateY(0); +} + +.paypal-icon { + display: flex; + align-items: center; + justify-content: center; +} + +.donate-note { + color: rgba(255, 255, 255, 0.8); + font-style: italic; +} + +/* Responsive Design */ +@media (max-width: 640px) { + .donate-container { + padding: 16px; + margin: 0 10px; + } + + .donate-title { + font-size: 1.1rem; + } + + .donate-description { + font-size: 0.8rem; + } + + .donate-btn { + padding: 8px 16px; + font-size: 0.85rem; + } + + .donate-header { + flex-direction: column; + gap: 8px; + } + + .paypal-icon svg { + width: 14px; + height: 14px; + } +} \ No newline at end of file diff --git a/TuneRipper/Pages/Home.razor b/TuneRipper/Pages/Home.razor index e5943fa..4271a57 100644 --- a/TuneRipper/Pages/Home.razor +++ b/TuneRipper/Pages/Home.razor @@ -185,6 +185,8 @@ Completely Free + + diff --git a/TuneRipper/_Imports.razor b/TuneRipper/_Imports.razor index cb30bbd..a3dc077 100644 --- a/TuneRipper/_Imports.razor +++ b/TuneRipper/_Imports.razor @@ -10,5 +10,6 @@ @using TuneRipper.Layout @using TuneRipper.Services @using TuneRipper.Extensions +@using TuneRipper.Components @using TuneRipper.Shared.Models @using TuneRipper.Shared.Configuration