Line data Source code
1 3 : <template>
2 : <Card
3 : data-testid="cloud-notification-dialog"
4 : class="relative grid h-full w-170 max-w-full grid-cols-5 shadow-lg"
5 : >
6 : <Button
7 : size="unset"
8 : variant="muted-textonly"
9 : class="absolute top-2.5 right-2.5 z-10 size-8 rounded-full p-0 text-white hover:bg-white/20"
10 : :aria-label="t('g.close')"
11 : @click="onDismiss"
12 : >
13 : <i class="icon-[lucide--x]" />
14 : </Button>
15 :
16 : <div
17 : class="relative col-span-2 flex items-center justify-center overflow-hidden rounded-sm"
18 : >
19 : <video
20 : autoplay
21 : loop
22 : muted
23 : playsinline
24 : class="ml-[-20%] h-full min-w-5/4 object-cover"
25 : >
26 : <source
27 : src="/assets/images/cloud-subscription.webm"
28 : type="video/webm"
29 : />
30 : </video>
31 : </div>
32 :
33 : <div class="col-span-3 flex flex-col justify-between p-8">
34 : <div>
35 : <div class="flex flex-col gap-4 text-sm">
36 : <DialogTitle class="m-0 text-sm">
37 : {{ t('cloudNotification.title') }}
38 : </DialogTitle>
39 : <p class="m-0 text-muted-foreground">
40 : {{ t('cloudNotification.message') }}
41 : </p>
42 : </div>
43 :
44 : <div class="mt-6 flex flex-col items-start gap-0 self-stretch">
45 9 : <div
46 : v-for="n in [2, 3, 4]"
47 : :key="n"
48 : class="flex items-center gap-2 py-2"
49 : >
50 : <i class="icon-[lucide--check] size-3" />
51 : <span class="text-sm">
52 : {{ t(`cloudNotification.feature${n}Title`) }}
53 : </span>
54 : </div>
55 : </div>
56 : </div>
57 :
58 : <div class="flex flex-col gap-2 pt-8">
59 : <Button
60 : variant="primary"
61 : size="lg"
62 : class="w-full font-bold"
63 : @click="onExplore"
64 : >
65 : {{ t('cloudNotification.exploreCloud') }}
66 : </Button>
67 : <Button variant="textonly" size="sm" class="w-full" @click="onDismiss">
68 : {{ t('cloudNotification.continueLocally') }}
69 : </Button>
70 : <p class="m-0 text-center text-xs text-muted-foreground">
71 : {{ t('cloudNotification.footer') }}
72 : </p>
73 : </div>
74 : </div>
75 : </Card>
76 : </template>
77 :
78 : <script setup lang="ts">
79 : import Card from '@comfyorg/design-system/card/Card'
80 : import { onMounted } from 'vue'
81 : import { useI18n } from 'vue-i18n'
82 :
83 : import Button from '@comfyorg/design-system/button/Button'
84 : import DialogTitle from '@comfyorg/design-system/dialog/DialogTitle'
85 : import { useTelemetry } from '@comfyorg/telemetry'
86 : import { useDialogStore } from '@/stores/dialogStore'
87 :
88 3 : const { t } = useI18n()
89 :
90 3 : onMounted(() => {
91 : // Impression event — uses trackUiButtonClicked as no dedicated impression tracker exists
92 3 : useTelemetry()?.trackUiButtonClicked({
93 : button_id: 'cloud_notification_modal_impression',
94 : element_group: 'cloud_notification'
95 : })
96 : })
97 :
98 1 : function onDismiss() {
99 1 : useTelemetry()?.trackUiButtonClicked({
100 : button_id: 'cloud_notification_continue_locally_clicked',
101 : element_group: 'cloud_notification'
102 : })
103 1 : useDialogStore().closeDialog()
104 : }
105 :
106 1 : function onExplore() {
107 1 : useTelemetry()?.trackUiButtonClicked({
108 : button_id: 'cloud_notification_explore_cloud_clicked',
109 : element_group: 'cloud_notification'
110 : })
111 :
112 1 : const params = new URLSearchParams({
113 : utm_source: 'desktop',
114 : utm_medium: 'onload-modal',
115 : utm_campaign: 'local-to-cloud-conversion',
116 : utm_id: 'desktop-onload-modal',
117 : utm_source_platform: 'mac-desktop'
118 : })
119 :
120 1 : window.open(
121 : `https://comfy.org/cloud/?${params}`,
122 : '_blank',
123 : 'noopener,noreferrer'
124 : )
125 1 : useDialogStore().closeDialog()
126 : }
127 : </script>
|