-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
73 lines (66 loc) · 2 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<script setup lang="ts">
const gTag = useGtag();
const runtimeConfig = useRuntimeConfig();
useHead({
htmlAttrs: {
lang: 'ja',
},
});
useSeoMeta({
googleSiteVerification: runtimeConfig.public.googleSiteVerification,
});
const enableGA = enableGoogleAnalytics();
// Cookieの有効/無効の変更を監視
watch(
() => enableGA.value, () => {
if (enableGA.value) {
gTag.initialize();
} else {
gTag.disableAnalytics();
}
},
{ deep: true },
);
const answerAnalytics = answerAnalyticsQuestion();
const onAnalytics = (value: boolean) => {
enableGA.value = value;
answerAnalytics.value = true;
};
</script>
<template>
<NuxtLayout>
<NuxtLoadingIndicator />
<NuxtPage />
</NuxtLayout>
<div class="fixed bottom-0 m-3">
<ClientOnly>
<div v-if="!answerAnalytics" role="alert" class="alert glass">
<div>
<h3 class="font-bold">当サイトでは、使用状況のデータの収集のために解析ツールなどを使用することがあります。</h3>
<div class="text-xs">
<span>このデータは匿名で収集されており、個人を特定するものではありません。データの収集に同意される場合は、「同意」ボタンを押してください。</span>
<br>
<span>この設定は、下部にある<Icon name="carbon:data-analytics" size="20px"></Icon>から変更することができます。</span>
<br>
<NuxtLink class="link" to="/privacy">プライバシーポリシー</NuxtLink>
</div>
</div>
<div class="flex flex-row gap-5">
<button class="btn btn-sm" @click="onAnalytics(false)">拒否</button>
<button class="btn btn-sm btn-primary" @click="onAnalytics(true)">同意</button>
</div>
</div>
</ClientOnly>
</div>
</template>
<style>
.page-enter-active,
.page-leave-active {
transition: opacity 0.3s;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
filter: blur(1rem);
}
</style>