From 3d4162d3dc3c735ec3c7e00a4d496762bac41b14 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:00:39 +0200 Subject: [PATCH] feat(ui): add heart icon and enhance popup messaging for sponsorship support --- public/heart.png | Bin 0 -> 3972 bytes resources/views/components/popup.blade.php | 21 +++--- .../views/livewire/layout-popups.blade.php | 64 ++++++++++++++---- 3 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 public/heart.png diff --git a/public/heart.png b/public/heart.png new file mode 100644 index 0000000000000000000000000000000000000000..c44a21301660dda6cd6e5a6fb64f8c0ed8738cb7 GIT binary patch literal 3972 zcmeH~`CAj`7RQq~(U25bLlDYRP@_gbQNV&AAWK03Yh@TMl7U`|N?D{J2xM^-sT9=8 z#RXZkSZ&Qz#tkf694Jy2L9~E^5V#Z&0Ru(WK+-q2{R8d~_wng{p8G?dIhlFS=X>5a z=gc`dwaedIlWD}HP$-%{A9?JiP^jy{$B?lU+!;LI*bFYzFL!&pQ*JfCKTM%$Is16H z?MVt5>khqj?LOPHHH_(jxmCyhVtxwx#Qcz(g(tOD=G0MqdMrnluz$Lz)M3>>H?3%KJ||3&VnLMy6U*{@${PNt?h@br3%yXiuWovx{@>zf?i(4dL{&>euX}62zOh2#GVWyY8|ROSjF+QoZGEez zw4mD}&!=<%6AkxpYozh=I16OI%fgNs7c*ff`$HX|Dh!>fA7@D#PoW8O;M$VTM?C%2 z`g}xSyHNf5Pmk)?lYJccn`|~|#9pXLlEq%oiX2!lXyI7RIII&rEg7to>O3yl}Ga{=~DvnnuHDL3^+5?JeJZWJ%I}1oh=W$CkTZrj?V5R znc@<8Axe)6$}F*I%5cysT#HbjOfTx;u5U70r_=UM4EAlJ^C+EFB8>gZ{*9eg8+bii zQ?H|R*RGiWg7y>7tBdn_?d9|qeVlUO-3P_T0v@%k znp{-e5t$6O8_Xk_)bpw(n}pp1%NXzr8UtQ`ZJr}sC~MTx#_!OzapWts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_*?l{AOOK2dU_3*Q@D3H%9 zICy3unzj&a%)y&Lr7S?a-x9lk0V<`Ri+mvM0>&m#DPW43>$bN>E`ds!)qsDImjEM^ z1wRTP+=Zne6Fvu(BE;Cgmq!5ukl(3OqnnS?GWZ#EU>uFf`!@9sFfFI`Cd(0GMj+ zupEUpo)zjPv11zOF=p?&RD?8fJI$_uS*qh*6tB3%nb-V-C9bk?qT5 z0mSn2<*yE6_Zj$Sssb^(=xkXy%LhY%Wset_luin}Yz*+IwlUFRvQyR;AS>}}>+fJ9X_$aa + class="fixed bottom-0 right-0 w-full h-auto duration-300 ease-out sm:px-5 sm:pb-5 w-full z-999" x-cloak>
+ class="flex lg:items-center flex-col justify-between w-full h-full max-w-4xl p-6 mx-auto bg-white border shadow-lg lg:border-t dark:border-coolgray-300 dark:bg-coolgray-100 lg:p-8 lg:flex-row sm:rounded-sm">
@if (isset($icon)) - {{ $icon }} + @endif

{{ $title }}

-

{{ $description }}

+

{{ $description }}

- + class="w-full px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-200 rounded-md bg-neutral-100 hover:bg-neutral-200 dark:bg-coolgray-200 lg:w-auto dark:text-neutral-200 dark:hover:bg-coolgray-300 focus:shadow-outline focus:outline-hidden"> + {{ $buttonText }} +
diff --git a/resources/views/livewire/layout-popups.blade.php b/resources/views/livewire/layout-popups.blade.php index c639b4627..5fc17bdde 100644 --- a/resources/views/livewire/layout-popups.blade.php +++ b/resources/views/livewire/layout-popups.blade.php @@ -4,9 +4,11 @@ notification: true, realtime: false, }, + isDevelopment: {{ isDev() ? 'true' : 'false' }}, init() { - this.popups.sponsorship = localStorage.getItem('popupSponsorship') !== 'false'; - this.popups.notification = localStorage.getItem('popupNotification') !== 'false'; + console.log(this.isDevelopment); + this.popups.sponsorship = this.shouldShowMonthlyPopup('popupSponsorship'); + this.popups.notification = this.shouldShowMonthlyPopup('popupNotification'); this.popups.realtime = localStorage.getItem('popupRealtime'); let checkNumber = 1; @@ -31,6 +33,35 @@ } }, 2000); } + }, + shouldShowMonthlyPopup(storageKey) { + const disabledTimestamp = localStorage.getItem(storageKey); + + // If never disabled, show the popup + if (!disabledTimestamp || disabledTimestamp === 'false') { + return true; + } + + // If disabled timestamp is not a valid number, show the popup + const disabledTime = parseInt(disabledTimestamp); + if (isNaN(disabledTime)) { + return true; + } + + const now = new Date(); + const disabledDate = new Date(disabledTime); + + {{-- if (this.isDevelopment) { + // In development: check if 10 seconds have passed + const timeDifference = now.getTime() - disabledDate.getTime(); + const tenSecondsInMs = 10 * 1000; + return timeDifference >= tenSecondsInMs; + } else { --}} + // In production: check if we're in a different month or year + const isDifferentMonth = now.getMonth() !== disabledDate.getMonth() || + now.getFullYear() !== disabledDate.getFullYear(); + return isDifferentMonth; + {{-- } --}} } }"> @auth @@ -59,20 +90,23 @@ - Love Coolify as we do? + Would you like to help us to make more cool things? - + - Please - consider donating on GitHub or OpenCollective.

- It enables us to keep creating features without paywalls, ensuring our work remains free and - open. +
+ We are already profitable, but we would like to scale even further. +
Please + consider donating on one (or both) of the following platforms.

GitHub + Sponsors (registration required)

+ OpenCollective (no registration + required).
+
Disable This Popup @@ -128,11 +162,13 @@ @endif