Skip to content

Commit

Permalink
added keys
Browse files Browse the repository at this point in the history
  • Loading branch information
athi committed Jan 13, 2024
1 parent 59e7252 commit 86bb1ca
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 57 deletions.
37 changes: 20 additions & 17 deletions components/DownloadPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<v-row justify="center">
<div :class="{ cta: !isSimple }" class="my-md-4 pa-8">
<div v-if="!isSimple" class="text-h3 font-weight-bold pb-4">
Download all Graphs at once!
{{ $t("downloadAllGraphs") }}
</div>
<div v-if="!isSimple" class="text-body-1 pb-2">
Share them with your friends, all free just for you ❤️️
{{ $t("shareWithFriends") }}
</div>
<v-dialog v-model="dialog" width="600">
<template #activator="{ on }">
Expand All @@ -18,7 +18,7 @@
v-on="on"
>
<v-icon class="mr-2">mdi-download</v-icon>
Download Results
{{ $t("downloadResults") }}
</v-btn>
</template>

Expand Down Expand Up @@ -83,7 +83,8 @@
<div v-if="!isSimple" class="text-text-h3 my-4">
<v-col>
<div v-if="!isSimple" class="text-body-1 pb-2">
Looking for <b>PDF download</b>?
{{ $t("lookingFor") }} <b>{{ $t("pdfDownload") }}</b
>?
</div>

<v-btn
Expand All @@ -95,12 +96,9 @@
$vuetify.goTo('#payButton', { duration: 300, offset: 100 });
"
>
<v-icon class="mr-2">mdi-arrow-right
</v-icon
>
<v-icon class="mr-2">mdi-arrow-right </v-icon>
{{ $t("goToPDF") }}
</v-btn
>
</v-btn>
</v-col>
</div>
</div>
Expand All @@ -111,24 +109,29 @@
<script>
import html2canvas from "html2canvas";
import { downloadBase64File } from "~/functions/utils";
import { GTAG_INTERACTION, GTAG_PAYMENT, GTAG_RESULTS, gtagEvent } from "~/functions/gtagValues";
import {
GTAG_INTERACTION,
GTAG_PAYMENT,
GTAG_RESULTS,
gtagEvent,
} from "~/functions/gtagValues";
export default {
name: "DownloadPopup",
props: {
chat: { type: Object },
isSimple: { default: false, type: Boolean }
isSimple: { default: false, type: Boolean },
},
data() {
return {
dialog: false,
loading: false,
suffix: this.isSimple ? "-top" : "",
GTAG_INTERACTION
GTAG_INTERACTION,
};
},
methods: {
download: function() {
download: function () {
this.loading = true;
gtagEvent("download_image", GTAG_RESULTS);
Expand All @@ -151,13 +154,13 @@ export default {
scrollX: 0,
scrollY: -window.scrollY,
height: normalHeight + additionalHeight + negativeHeight,
onclone: function(clonedDoc) {
onclone: function (clonedDoc) {
let nonVisibleStuff = clonedDoc.querySelectorAll(
".only-visible-to-html2canvas"
);
nonVisibleStuff.forEach((y) => (y.style.display = "block"));
return clonedDoc;
}
},
});
let names = this.chat.messagesPerPerson
Expand All @@ -176,7 +179,7 @@ export default {
paypalButtonPressed() {
gtagEvent("donation_download_results", GTAG_PAYMENT, 5);
},
gtagEvent
}
gtagEvent,
},
};
</script>
24 changes: 12 additions & 12 deletions components/charts/Results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<GlobalHeader class="only-visible-to-html2canvas" />
<DownloadPopup
:chat="chat"
isSimple
is-simple
class="my-5"
data-html2canvas-ignore
remove-height-in-html2-canvas
/>
<div class="text-h2 font-weight-bold pb-10">Chat Timeline</div>
<div>Messages per Day</div>
<div class="text-h2 font-weight-bold pb-10">{{ $t("chatTimeline") }}</div>
<div>{{ $t("messagesPerDay") }}</div>
<Share id="chat-timeline">
<ChartsLineChart :chartdata="chat" />
</Share>
Expand All @@ -36,20 +36,20 @@
remove-height-in-html2-canvas
/>
<!-- Make dropdown -> messages or words -->
<div class="text-h3 font-weight-bold py-10">Messages per</div>
<div class="text-h3 font-weight-bold py-10">{{ $t("messagesPer") }}</div>
<v-row>
<v-col cols="12" md="6">
<div class="text-h4 font-weight-bold">Person</div>
<div class="text-h4 font-weight-bold">{{ $t("person") }}</div>
<Share id="messages-per-person">
<ChartsDonughtChart :chartdata="chat" class="py-10" />
</Share>
</v-col>
<v-col cols="12" md="6">
<div class="text-h4 font-weight-bold">Time of Day</div>
<div class="text-h4 font-weight-bold">{{ $t("timeOfDay") }}</div>
<Share id="messages-per-time-of-day">
<ChartsBarChart
:chartdata="chat"
dataGrouping="hourly"
data-grouping="hourly"
class="py-10"
/>
</Share>
Expand All @@ -58,28 +58,28 @@

<v-row>
<v-col cols="12" sm="6">
<div class="text-h4 font-weight-bold">Month</div>
<div class="text-h4 font-weight-bold">{{ $t("month") }}</div>
<Share id="radar-month">
<ChartsRadarChart
:chartdata="chat"
dataGrouping="weekly"
data-grouping="weekly"
class="py-10"
/>
</Share>
</v-col>
<v-col cols="12" sm="6">
<div class="text-h4 font-weight-bold">Weekday</div>
<div class="text-h4 font-weight-bold">{{ $t("weekday") }}</div>
<Share id="radar-day">
<ChartsRadarChart
:chartdata="chat"
dataGrouping="daily"
data-grouping="daily"
class="py-10"
/>
</Share>
</v-col>
</v-row>

<div class="text-h3 font-weight-bold pt-10">Word Cloud</div>
<div class="text-h3 font-weight-bold pt-10">{{ $t("wordCloud") }}</div>
<ChartsWordCloud id="wordcloud" :chartdata="chat" class="px-10" />

<DownloadPopup
Expand Down
Loading

0 comments on commit 86bb1ca

Please sign in to comment.