feat(pwa): add install PWA widget (#1451)
This commit is contained in:
parent
3c888d3914
commit
f96cdae1ba
8 changed files with 73 additions and 1 deletions
22
components/pwa/PwaInstallPrompt.client.vue
Normal file
22
components/pwa/PwaInstallPrompt.client.vue
Normal file
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<div
|
||||
v-if="$pwa?.showInstallPrompt && !$pwa?.needRefresh"
|
||||
m-2 p5 bg="primary-fade" relative
|
||||
rounded-lg of-hidden
|
||||
flex="~ col gap-3"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<h2 flex="~ gap-2" items-center>
|
||||
{{ $t('pwa.install_title') }}
|
||||
</h2>
|
||||
<div flex="~ gap-1">
|
||||
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="$pwa.install()">
|
||||
{{ $t('pwa.install') }}
|
||||
</button>
|
||||
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="$pwa.cancelInstall()">
|
||||
{{ $t('pwa.dismiss') }}
|
||||
</button>
|
||||
</div>
|
||||
<div i-material-symbols:install-desktop-rounded absolute text-6em bottom--2 inset-ie--2 text-primary dark:text-white op10 dark:op45 class="-z-1 rtl-flip" />
|
||||
</div>
|
||||
</template>
|
|
@ -16,6 +16,6 @@
|
|||
{{ $t('pwa.dismiss') }}
|
||||
</button>
|
||||
</div>
|
||||
<div i-ri-arrow-down-circle-line absolute text-8em bottom--10 inset-ie--10 text-primary op10 class="-z-1" />
|
||||
<div i-ri-arrow-down-circle-line absolute text-8em bottom--10 inset-ie--10 text-primary dark:text-white op10 dark:op45 class="-z-1" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue