mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
chore: Update announcement bar
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type Ref, ref, onMounted } from 'vue';
|
||||
import { onMounted, type Ref, ref } from 'vue';
|
||||
|
||||
interface Taglines {
|
||||
label: string;
|
||||
@@ -8,29 +8,46 @@ interface Taglines {
|
||||
|
||||
const taglines: Taglines[] = [
|
||||
{
|
||||
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart',
|
||||
label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro',
|
||||
url: 'https://www.mermaidchart.com/mermaid-ai?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=aibundle',
|
||||
},
|
||||
{
|
||||
label: 'Diagram live with teammates in Mermaid Chart',
|
||||
label: 'Diagram live with teammates in Mermaid Pro',
|
||||
url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=team_collaboration',
|
||||
},
|
||||
];
|
||||
|
||||
const randomTagLines: Taglines[] = [
|
||||
{
|
||||
label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams',
|
||||
url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor',
|
||||
label: 'Customize your layout and design in Mermaid Chart’s whiteboard!',
|
||||
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard',
|
||||
},
|
||||
{
|
||||
label: 'Explore the Mermaid Whiteboard from the creators of Mermaid',
|
||||
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard',
|
||||
label: 'Customize your layout and design in Mermaid Chart’s visual editor!',
|
||||
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor',
|
||||
},
|
||||
{
|
||||
label: 'Customize your layout and design with Mermaid Chart’s GUI!',
|
||||
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=GUI',
|
||||
},
|
||||
{
|
||||
label: 'Customize your layout and design in Mermaid Chart!',
|
||||
url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_whiteboard_gui',
|
||||
},
|
||||
];
|
||||
|
||||
const index: Ref<number> = ref(0);
|
||||
const currentBannerSet = ref<Taglines[]>(taglines);
|
||||
|
||||
console.log('currentBannerSet:', currentBannerSet.value);
|
||||
|
||||
onMounted(() => {
|
||||
index.value = Math.floor(Math.random() * taglines.length);
|
||||
const newIndex = Math.floor(Math.random() * randomTagLines.length);
|
||||
console.log('newIndex:', newIndex);
|
||||
currentBannerSet.value = [...taglines, randomTagLines[newIndex]];
|
||||
index.value = Math.floor(Math.random() * currentBannerSet.value.length);
|
||||
setInterval(() => {
|
||||
index.value = (index.value + 1) % taglines.length;
|
||||
index.value = (index.value + 1) % currentBannerSet.value.length;
|
||||
}, 5_000);
|
||||
});
|
||||
</script>
|
||||
@@ -41,11 +58,11 @@ onMounted(() => {
|
||||
<transition name="fade" mode="out-in">
|
||||
<a
|
||||
:key="index"
|
||||
:href="taglines[index].url"
|
||||
:href="currentBannerSet?.[index]?.url"
|
||||
target="_blank"
|
||||
class="unstyled flex justify-center items-center gap-4 text-white tracking-wide plausible-event-name=bannerClick"
|
||||
>
|
||||
<span class="font-semibold">{{ taglines[index].label }}</span>
|
||||
<span class="font-semibold">{{ currentBannerSet?.[index]?.label }}</span>
|
||||
<button class="bg-[#1E1A2E] shrink-0 rounded-lg p-1.5 px-4 font-semibold tracking-wide">
|
||||
Try now
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user