ui: Improve voxpeople with a dedicated menu

This commit is contained in:
nemunaire 2024-02-02 01:14:56 +01:00
parent 764f3be851
commit 9cd5930393
1 changed files with 69 additions and 5 deletions

View File

@ -33,22 +33,86 @@
export let routeId: string | null;
const instancename = encodeURIComponent(window.location.hostname);
let showCard = false;
</script>
{#if MODE == 'production'}
<a
{#if showCard}
<div
style="background-color: #0007; position: fixed; width: 100vw; height: 100vh; top:0; left: 0; z-index: 1050"
on:click={() => showCard = false}
/>
<div
class="card"
style="position: fixed; bottom: calc(7vh + max(1.7vw, 1.7vh)); right: calc(4vw + max(1.7vw, 1.7vh)); z-index: 1052; max-width: 400px;"
>
<div class="card-body row row-cols-2 justify-content-center align-items-center">
<div class="col d-flex mb-3 flex-fill">
<a
href="https://matrix.to/#/#happyDNS:matrix.org"
target="_blank"
rel="noreferrer"
class="btn btn-lg btn-light flex-fill"
on:click={() => showCard = false}
data-umami-event="vox-people-chat"
>
<Icon name="chat-text" /><br>
<small>Chat with us</small>
</a>
</div>
<div class="col d-flex mb-3">
<a
href="https://help.happydomain.org/{$locale}/"
target="_blank"
rel="noreferrer"
class="btn btn-lg btn-light flex-fill"
on:click={() => showCard = false}
data-umami-event="vox-people-help"
>
<Icon name="life-preserver" /><br>
<small>Online help</small>
</a>
</div>
<div class="col d-flex flex-fill">
<a
href="https://framaforms.org/quel-est-votre-avis-sur-happydns-1610366701?u={$userSession?$userSession.id:0}&amp;i={instancename}&amp;p={routeId}&amp;l={$locale}"
target="_blank"
rel="noreferrer"
class="btn btn-lg btn-light flex-fill fw-bolder"
on:click={() => showCard = false}
data-umami-event="vox-people-feedback"
>
<Icon name="pen" /><br>
<small>Write to us</small>
</a>
</div>
<div class="col d-flex">
<a
href="https://feedback.happydomain.org/"
target="_blank"
rel="noreferrer"
class="btn btn-lg btn-light flex-fill fw-bolder"
on:click={() => showCard = false}
data-umami-event="vox-people-feedback"
>
<Icon name="feather" /><br>
<small>Give your feedback</small>
</a>
</div>
</div>
</div>
{/if}
<button
id="voxpeople"
href="https://framaforms.org/quel-est-votre-avis-sur-happydns-1610366701?u={$userSession?$userSession.id:0}&amp;i={instancename}&amp;p={routeId}&amp;l={$locale}"
target="_blank"
rel="noreferrer"
title={$t('common.survey')}
class="d-flex btn btn-light justify-content-center align-items-center"
data-umami-event="vox-people"
on:click={() => showCard = !showCard}
>
<Icon
name="chat-right-text"
/>
</a>
</button>
{/if}
<style>