Skip to content

Commit

Permalink
Merge pull request #1367 from mermaid-js/janPromo
Browse files Browse the repository at this point in the history
feat: Jan 2024 Promo
  • Loading branch information
sidharthv96 committed Jan 11, 2024
2 parents 1412bed + 65587a6 commit 488f655
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

{#if activePromotion}
<div
class="z-10 w-full top-bar bg-gradient-to-r from-[#bd34fe] to-[#ff3670] flex items-center text-center justify-center p-1 text-white">
class="z-10 w-full h-fit top-bar bg-gradient-to-r from-[#bd34fe] to-[#ff3670] flex items-center text-center justify-center p-1 text-white">
<div class="flex flex-grow" on:click={trackBannerClick} on:keypress={trackBannerClick}>
<svelte:component this={activePromotion.component} />
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/lib/util/promos/Jan2024.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts">
const taglines = [
'Try diagramming with ChatGPT at Mermaid Chart',
"Try Mermaid's Visual Editor at Mermaid Chart",
'Enjoy live collaboration with teammates at Mermaid Chart'
];
</script>

<a
href="https://www.mermaidchart.com/"
target="_blank"
class="tracking-wide flex-grow justify-center align-middle flex gap-6">
{taglines[Math.floor(Math.random() * taglines.length)]}
<button class="font-light text-sm p-1 rounded bg-gray-800 px-4">Try it now</button>
</a>
9 changes: 8 additions & 1 deletion src/lib/util/promos/promo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { writable, type Writable, get } from 'svelte/store';
import { persist, localStorage } from '../persist';
import Holiday2023 from './Holiday2023.svelte';
import Jan2024 from './Jan2024.svelte';

interface Promotion {
id: string;
Expand All @@ -13,8 +14,14 @@ const promotions: Promotion[] = [
{
id: 'holiday-2023',
startDate: new Date('2023-11-27'),
endDate: new Date('2024-01-01'),
endDate: new Date('2024-01-10'),
component: Holiday2023
},
{
id: 'jan-2024',
startDate: new Date('2024-01-10'),
endDate: new Date('2024-06-01'),
component: Jan2024
}
];

Expand Down

0 comments on commit 488f655

Please sign in to comment.