diff --git a/public/heart.png b/public/heart.png new file mode 100644 index 000000000..c44a21301 Binary files /dev/null and b/public/heart.png differ diff --git a/resources/views/components/popup.blade.php b/resources/views/components/popup.blade.php index afcb773eb..ace85425d 100644 --- a/resources/views/components/popup.blade.php +++ b/resources/views/components/popup.blade.php @@ -6,29 +6,30 @@ x-transition:enter-start="translate-y-full" x-transition:enter-end="translate-y-0" x-transition:leave="transition ease-in duration-300" x-transition:leave-start="translate-y-0" x-transition:leave-end="translate-y-full" x-init="setTimeout(() => { bannerVisible = true }, bannerVisibleAfter);" - 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="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