Skip to content

Commit

Permalink
fix: image quality
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Jul 16, 2023
1 parent 2b3afdf commit e70f2d9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 61 deletions.
120 changes: 61 additions & 59 deletions pages/s/[id]/analytics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,68 +82,70 @@ useSeoMeta({
v-else-if="survey"
>
<div class="w-[135px]">
<NuxtImg preload height="135px" width="auto" densities="x1 x2 x3" src="/images/logo.webp" />
<NuxtImg preload width="135px" densities="x1 x2 x3" quality="100" src="/images/logo.webp" />
</div>

<h1 v-if="survey" mt8 text-xl font-bold>
Responses for {{ survey.title }}
</h1>
</div>

<Skeleton v-if="surveyPending || responsesPending" height="500px" />
<DashboardError v-else-if="responsesError" v-bind="responsesError" />
<TabView v-else-if="responses" class="mt-10">
<TabPanel header="Data table">
<DataTable :value="responses" table-class="w-full">
<Column field="id" header="ID" />
<Column field="timestamp" header="Timestamp" />
<Column header="Respondent">
<template #body="bodySlot">
<span v-if="bodySlot.data.respondent.name">
{{ bodySlot.data.respondent.name }}
</span>
<span v-else>
Unregistered
</span>
</template>
</Column>
<Column header="Expand">
<template #body="bodySlot">
<Button icon="" link @click="responsePreview.idx = bodySlot.index; responsePreview.visible = true">
<div i-tabler-arrow-up-right text-xl />
</Button>
</template>
</Column>
</DataTable>
</TabPanel>
<TabPanel header="Charts">
<Skeleton v-if="chartPending" height="300px" />
<DashboardError v-if="chartError" v-bind="chartError" />
<div v-else-if="chart" flex flex-col gap6>
<div
v-for="(qnChartData, idx) in chart"
:key="idx"
>
<div
v-if="qnChartData.labels.length > 0"
>
<span font-semibold>
{{ survey?.questions[idx].title }}
</span>
<Chart
type="bar" :data="qnChartData" :options="{
scales: {
y: {
beginAtZero: true,
},
},
}"
/>
</div>
</div>
</div>
</TabPanel>
</TabView>
<h1 v-if="survey" mt8 text-xl font-bold>
Responses for {{ survey.title }}
</h1>
</main>
</div>

<Skeleton v-if="surveyPending || responsesPending" height="500px" />
<DashboardError v-else-if="responsesError" v-bind="responsesError" />
<TabView v-else-if="responses" class="mt-10">
<TabPanel header="Data table">
<DataTable :value="responses" table-class="w-full">
<Column field="id" header="ID" />
<Column field="timestamp" header="Timestamp" />
<Column header="Respondent">
<template #body="bodySlot">
<span v-if="bodySlot.data.respondent.name">
{{ bodySlot.data.respondent.name }}
</span>
<span v-else>
Unregistered
</span>
</template>
</Column>
<Column header="Expand">
<template #body="bodySlot">
<Button icon="" link @click="responsePreview.idx = bodySlot.index; responsePreview.visible = true">
<div i-tabler-arrow-up-right text-xl />
</Button>
</template>
</Column>
</DataTable>
</TabPanel>
<TabPanel header="Charts">
<Skeleton v-if="chartPending" height="300px" />
<DashboardError v-if="chartError" v-bind="chartError" />
<div v-else-if="chart" flex flex-col gap6>
<div
v-for="(qnChartData, idx) in chart"
:key="idx"
>
<div
v-if="qnChartData.labels.length > 0"
>
<span font-semibold>
{{ survey?.questions[idx].title }}
</span>
<Chart
type="bar" :data="qnChartData" :options="{
scales: {
y: {
beginAtZero: true,
},
},
}"
/>
</div>
</div>
</div>
</TabPanel>
</TabView>
</main>

Check failure on line 149 in pages/s/[id]/analytics.vue

View workflow job for this annotation

GitHub Actions / ci

Parsing error: x-invalid-end-tag
</div>

Check failure on line 150 in pages/s/[id]/analytics.vue

View workflow job for this annotation

GitHub Actions / ci

Parsing error: x-invalid-end-tag
</template>
2 changes: 1 addition & 1 deletion pages/s/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function submit() {
<template v-else-if="survey">
<div mx-auto max-w-3xl container>
<div class="w-[135px]">
<NuxtImg preload height="135px" width="auto" densities="x1 x2 x3" src="/images/logo.webp" />
<NuxtImg preload width="135px" densities="x1 x2 x3" quality="100" src="/images/logo.webp" />
</div>

<div mt10>
Expand Down
2 changes: 1 addition & 1 deletion pages/thanks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function create() {
<div p-6 lg:px-30>
<main flex flex-col gap10>
<div class="w-[135px]">
<NuxtImg preload width="135px" densities="x1 x2 x3" src="/images/logo.webp" />
<NuxtImg preload width="135px" densities="x1 x2 x3" quality="100" src="/images/logo.webp" />
</div>

<section>
Expand Down

0 comments on commit e70f2d9

Please sign in to comment.