chore: Update coupon code
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$/components/ui/button';
|
||||
import * as Dialog from '$/components/ui/dialog';
|
||||
import { dismissEditorChooser, isOnMermaidAI } from '$/util/migration/domainMigration';
|
||||
import { dismissEditorChooser } from '$/util/migration/domainMigration';
|
||||
import { logEvent, logMermaidChartClick } from '$/util/stats';
|
||||
import { getCheckoutUrl } from '$/util/util';
|
||||
import CodeIcon from '~icons/custom/code';
|
||||
import OpenSourceIcon from '~icons/material-symbols/book-2-outline-rounded';
|
||||
import ChatIcon from '~icons/material-symbols/chat-outline-rounded';
|
||||
@@ -28,15 +29,8 @@
|
||||
logEvent('chooseEditor', { choice: 'plus' });
|
||||
logMermaidChartClick('editorPicker');
|
||||
close();
|
||||
const utmSource = isOnMermaidAI() ? 'mermaid_ai_live' : 'mermaid_live_editor';
|
||||
window.open(
|
||||
`https://mermaid.ai/app/user/billing/checkout?${new URLSearchParams({
|
||||
coupon: 'dmIuNbqx',
|
||||
tier: 'plus',
|
||||
utm_campaign: 'start_plus',
|
||||
utm_medium: '2_editor_selection',
|
||||
utm_source: utmSource
|
||||
}).toString()}`,
|
||||
getCheckoutUrl({ utmCampaign: 'start_plus', utmMedium: '2_editor_selection' }),
|
||||
'_blank'
|
||||
);
|
||||
};
|
||||
@@ -75,7 +69,7 @@
|
||||
<div class="mb-2 flex justify-center">
|
||||
<span
|
||||
class="rounded-full bg-pink-100 px-3 py-0.5 text-xs font-semibold text-pink-700 dark:bg-pink-950 dark:text-pink-300">
|
||||
Limited time: 10% off
|
||||
10% off with code JS26
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$/components/ui/button';
|
||||
import { isOnMermaidAI } from '$/util/migration/domainMigration';
|
||||
import { getCheckoutUrl } from '$/util/util';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
interface Props {
|
||||
@@ -9,15 +9,7 @@
|
||||
|
||||
let { closeBanner }: Props = $props();
|
||||
|
||||
const utmSource = isOnMermaidAI() ? 'mermaid_ai_live' : 'mermaid_live_editor';
|
||||
|
||||
const url = `https://mermaid.ai/app/user/billing/checkout?${new URLSearchParams({
|
||||
coupon: 'dmIuNbqx',
|
||||
tier: 'plus',
|
||||
utm_campaign: 'newyear',
|
||||
utm_medium: 'banner_ad',
|
||||
utm_source: utmSource
|
||||
}).toString()}`;
|
||||
const url = getCheckoutUrl({ utmCampaign: 'oss_coupon', utmMedium: 'banner_ad' });
|
||||
</script>
|
||||
|
||||
<div class="flex w-full items-center bg-[#E0095F] p-1.5" role="banner">
|
||||
@@ -27,11 +19,11 @@
|
||||
target="_blank"
|
||||
class="col-start-1 row-start-1 flex items-center justify-center gap-4 no-underline">
|
||||
<span class="text-base tracking-wider text-white">
|
||||
Limited time: 10% off Mermaid Advanced Editor with code NEWYEAR
|
||||
Try Mermaid Advanced Editor — OSS users get 10% off with code JS26
|
||||
</span>
|
||||
<Button
|
||||
class="shrink-0 rounded-md bg-[#1E1A2E] px-3 py-1.5 text-base font-semibold tracking-wide text-white hover:bg-[#261A56]">
|
||||
Claim discount
|
||||
Get started
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
@@ -5,7 +5,7 @@ import type { Component } from 'svelte';
|
||||
import { get, writable, type Writable } from 'svelte/store';
|
||||
import { localStorage, persist } from '../persist';
|
||||
import April2025 from './April2025.svelte';
|
||||
import NewYear2026 from './NewYear2026.svelte';
|
||||
import JS2026 from './JS2026.svelte';
|
||||
|
||||
dayjs.extend(duration);
|
||||
|
||||
@@ -17,10 +17,10 @@ interface Promotion {
|
||||
}
|
||||
|
||||
const promotions: Record<string, Promotion> = {
|
||||
'promo-newyear-2026': {
|
||||
'promo-js-2026': {
|
||||
startDate: new Date('2026-01-01'),
|
||||
endDate: new Date('2026-03-14'),
|
||||
component: NewYear2026,
|
||||
endDate: new Date('2026-12-31'),
|
||||
component: JS2026,
|
||||
hideDurationMs: dayjs.duration(1, 'week').asMilliseconds()
|
||||
},
|
||||
'promo-april-2025': {
|
||||
|
||||
@@ -40,6 +40,23 @@ export const MCBaseURL = env.isEnabledMermaidChartLinks
|
||||
? 'https://mermaid.ai' // 'http://localhost:5174'
|
||||
: 'https://example.com';
|
||||
|
||||
export const getCheckoutUrl = ({
|
||||
utmCampaign,
|
||||
utmMedium
|
||||
}: {
|
||||
utmCampaign: string;
|
||||
utmMedium: string;
|
||||
}): string => {
|
||||
const params = new URLSearchParams({
|
||||
coupon: 'arDfyFT8',
|
||||
tier: 'plus',
|
||||
utm_campaign: utmCampaign,
|
||||
utm_medium: utmMedium,
|
||||
utm_source: getUTMSource()
|
||||
});
|
||||
return `${MCBaseURL}/app/user/billing/checkout?${params.toString()}`;
|
||||
};
|
||||
|
||||
let count = 0;
|
||||
export const errorDebug = (limit = 1000) => {
|
||||
count += 1;
|
||||
|
||||
Reference in New Issue
Block a user