-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { running } from '../../states'; | ||
let ref: HTMLDialogElement; | ||
let timedOut = false; | ||
onMount(() => { | ||
if (localStorage.getItem('leaved-a-star')) { | ||
return; | ||
} | ||
setTimeout(() => { | ||
timedOut = true; | ||
}, 60 * 1000); | ||
}); | ||
$: if (!$running && timedOut) { | ||
ref.showModal(); | ||
} | ||
const click = () => { | ||
localStorage.setItem('leaved-a-star', 'yup'); | ||
ref.close(); | ||
}; | ||
</script> | ||
|
||
<dialog | ||
id="leave_a_star" | ||
class="modal modal-bottom sm:modal-middle" | ||
{...$$restProps} | ||
bind:this={ref} | ||
> | ||
<div class="modal-box"> | ||
<h3 class="text-lg font-bold"> | ||
⭐️ Support This Project by Leaving a Star! | ||
</h3> | ||
<p class="py-4"> | ||
If you find this project helpful or inspiring, consider showing your | ||
support by leaving a star on GitHub. Your feedback motivates us to keep | ||
improving! | ||
</p> | ||
<div class="modal-action"> | ||
<a | ||
href="https://github.com/mszula/visual-sorting" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
class="btn btn-primary" | ||
on:click={click} | ||
> | ||
⭐️ Star on GitHub | ||
</a> | ||
<form method="dialog"> | ||
<button class="btn">Maybe Later</button> | ||
</form> | ||
</div> | ||
</div> | ||
</dialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters