Skip to content

Commit ce68da3

Browse files
committed
update promo bar content
1 parent 41a737f commit ce68da3

File tree

1 file changed

+17
-101
lines changed
  • packages/mermaid/src/docs/.vitepress/components

1 file changed

+17
-101
lines changed

packages/mermaid/src/docs/.vitepress/components/TopBar.vue

+17-101
Original file line numberDiff line numberDiff line change
@@ -6,122 +6,38 @@ interface Taglines {
66
url: string;
77
}
88
9-
const allTaglines: { [key: string]: { design: number; taglines: Taglines[] } } = {
10-
A: {
11-
design: 1,
12-
taglines: [
13-
{
14-
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart',
15-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_A',
16-
},
17-
{
18-
label: 'Diagram live with teammates in Mermaid Chart',
19-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_A',
20-
},
21-
{
22-
label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams',
23-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_A',
24-
},
25-
{
26-
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
27-
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_A',
28-
},
29-
],
9+
const taglines: Taglines[] = [
10+
{
11+
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart',
12+
url: 'https://www.mermaidchart.com/mermaid-ai?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=aibundle',
3013
},
31-
B: {
32-
design: 2,
33-
taglines: [
34-
{
35-
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart',
36-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_B',
37-
},
38-
{
39-
label: 'Diagram live with teammates in Mermaid Chart',
40-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_B',
41-
},
42-
{
43-
label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams',
44-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_B',
45-
},
46-
{
47-
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
48-
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_B',
49-
},
50-
],
14+
{
15+
label: 'Diagram live with teammates in Mermaid Chart',
16+
url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=team_collaboration',
5117
},
52-
C: {
53-
design: 1,
54-
taglines: [
55-
{
56-
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro',
57-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_C',
58-
},
59-
{
60-
label: 'Diagram live with teammates in Mermaid Pro',
61-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_C',
62-
},
63-
{
64-
label: 'Use the Visual Editor in Mermaid Pro to design and build diagrams',
65-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_C',
66-
},
67-
{
68-
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
69-
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_A',
70-
},
71-
],
18+
{
19+
label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams',
20+
url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor',
7221
},
73-
D: {
74-
design: 2,
75-
taglines: [
76-
{
77-
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro',
78-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_D',
79-
},
80-
{
81-
label: 'Diagram live with teammates in Mermaid Pro',
82-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_D',
83-
},
84-
{
85-
label: 'Use the Visual Editor in Mermaid Pro to design and build diagrams',
86-
url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_D',
87-
},
88-
{
89-
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
90-
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_B',
91-
},
92-
],
22+
{
23+
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
24+
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard',
9325
},
94-
};
95-
96-
// Initialize with default values
97-
const design: Ref<number> = ref(1);
98-
const taglines: Ref<Taglines[]> = ref([]);
99-
const index: Ref<number> = ref(0);
26+
];
10027
28+
let index = ref(Math.floor(Math.random() * taglines.length));
10129
onMounted(() => {
102-
// Select a random variant on client side
103-
const variant =
104-
Object.values(allTaglines)[Math.floor(Math.random() * Object.values(allTaglines).length)];
105-
design.value = variant.design;
106-
taglines.value = variant.taglines;
107-
index.value = Math.floor(Math.random() * taglines.value.length);
108-
109-
// Set up the interval for cycling through taglines
11030
setInterval(() => {
111-
index.value = (index.value + 1) % taglines.value.length;
31+
index.value = (index.value + 1) % taglines.length;
11232
}, 5_000);
11333
});
11434
</script>
11535

11636
<template>
117-
<div
118-
:class="[design === 1 ? 'bg-gradient-to-r from-[#bd34fe] to-[#ff3670] ' : 'bg-[#E0095F]']"
119-
class="mb-4 w-full top-bar flex p-2"
120-
>
37+
<div class="mb-4 w-full top-bar flex p-2 bg-[#E0095F]">
12138
<p class="w-full tracking-wide fade-text text-sm">
12239
<transition name="fade" mode="out-in">
12340
<a
124-
v-if="taglines.length > 0 && taglines[index]"
12541
:key="index"
12642
:href="taglines[index].url"
12743
target="_blank"

0 commit comments

Comments
 (0)