diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 53da4e7b..37a16b7b 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -73,6 +73,7 @@ { dismissPromotion(activePromotion?.id); @@ -88,17 +89,6 @@ Mermaidv{version} Live Editor - - - + import { onDestroy } from 'svelte'; + import { fade } from 'svelte/transition'; + + interface Taglines { + label: string; + url: string; + } + + const taglines: Taglines[] = [ + { + label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams', + url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=visual_editor' + }, + { + label: 'Diagram live with teammates in Mermaid Chart', + url: 'https://www.mermaidchart.com/landing?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=teams' + }, + { + label: 'Skip the rough draft with Mermaid AI in Mermaid Chart', + url: 'https://www.mermaidchart.com/mermaid-ai?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=mermaid_ai' + } + ]; + + let index = Math.floor(Math.random() * taglines.length); + let currentTagline = taglines[index]; + + const interval = setInterval(() => { + index = (index + 1) % taglines.length; + currentTagline = taglines[index]; + }, 60_000); + + onDestroy(() => { + clearInterval(interval); + }); + + + + {#key currentTagline} + + {currentTagline.label} + Try it now + + {/key} + diff --git a/src/lib/util/promos/Holiday2023.svelte b/src/lib/util/promos/Holiday2023.svelte deleted file mode 100644 index b723ac3e..00000000 --- a/src/lib/util/promos/Holiday2023.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - Get AI, team collaboration, storage, and more with - Mermaid Chart Pro. Start free trial today & get 25% off. - diff --git a/src/lib/util/promos/Jan2024.svelte b/src/lib/util/promos/Jan2024.svelte deleted file mode 100644 index 3d3a662c..00000000 --- a/src/lib/util/promos/Jan2024.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - {tagline} - Try it now - diff --git a/src/lib/util/promos/promo.ts b/src/lib/util/promos/promo.ts index 20e540a8..45630714 100644 --- a/src/lib/util/promos/promo.ts +++ b/src/lib/util/promos/promo.ts @@ -1,7 +1,6 @@ import { writable, type Writable, get } from 'svelte/store'; import { persist, localStorage } from '../persist'; -import Holiday2023 from './Holiday2023.svelte'; -import Jan2024 from './Jan2024.svelte'; +import August2024 from './August2024.svelte'; interface Promotion { id: string; @@ -12,16 +11,10 @@ interface Promotion { const promotions: Promotion[] = [ { - id: 'holiday-2023', - startDate: new Date('2023-11-27'), - endDate: new Date('2024-01-09'), - component: Holiday2023 - }, - { - id: 'jan-2024', - startDate: new Date('2024-01-10'), + id: 'promo-2024', + startDate: new Date('2024-08-01'), endDate: new Date('2024-12-31'), - component: Jan2024 + component: August2024 } ];