From abf80da2c19fde1064307ccb35f158c3a0e2459c Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Thu, 13 Feb 2025 03:46:28 -0800 Subject: [PATCH 1/6] wip --- src/lib/components/Navbar.svelte | 3 +- src/lib/util/promos/January2025.svelte | 142 +++++++++++++++++++++---- 2 files changed, 120 insertions(+), 25 deletions(-) diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 15ee452a..b3ec50f6 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -60,8 +60,7 @@ {#if activePromotion} -
+
tagline.name.startsWith(selectedSet)); + let index = Math.floor(Math.random() * taglines.length); let currentTagline = $state(taglines[index]); const interval = setInterval(() => { index = (index + 1) % taglines.length; currentTagline = taglines[index]; - }, 5000); + }, 2000); onDestroy(() => { clearInterval(interval); }); -
- {#key currentTagline} - - {currentTagline.label} - - - {/key} -
+{#key currentTagline} + +{/key} From 23bb5d63dc7435fdb26d758751019c1c5bb75d71 Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Thu, 13 Feb 2025 03:57:41 -0800 Subject: [PATCH 2/6] update urls --- src/lib/util/promos/January2025.svelte | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lib/util/promos/January2025.svelte b/src/lib/util/promos/January2025.svelte index 31503bde..abcc448d 100644 --- a/src/lib/util/promos/January2025.svelte +++ b/src/lib/util/promos/January2025.svelte @@ -13,98 +13,98 @@ { name: 'A AI Bundle', design: '1', - label: '1 Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart', - url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_A' + label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart', + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=AIbundle_A' }, { name: 'B AI Bundle', design: '2', label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Chart', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_B' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=AIbundle_B' }, { name: 'C AI Bundle', design: '1', - label: '1 Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_C' + label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro', + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=AIbundle_C' }, { name: 'D AI Bundle', design: '2', label: 'Replace ChatGPT Pro, Mermaid.live, and Lucid Chart with Mermaid Pro', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=AIbundle_D' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=AIbundle_D' }, { name: 'A Teams', design: '1', - label: '1 Diagram live with teammates in Mermaid Chart', - url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_A' + label: 'Diagram live with teammates in Mermaid Chart', + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=teams_A' }, { name: 'B Teams', design: '2', label: 'Diagram live with teammates in Mermaid Chart', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_B' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=teams_B' }, { name: 'C Teams', design: '1', - label: '1 Diagram live with teammates in Mermaid Pro', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_C' + label: 'Diagram live with teammates in Mermaid Pro', + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=teams_C' }, { name: 'D Teams', design: '2', label: 'Diagram live with teammates in Mermaid Pro', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=teams_D' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=teams_D' }, { name: 'A Visual Editor', design: '1', - label: '1 Use the Visual Editor in Mermaid Chart to design and build diagrams', - url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_A' + label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams', + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=visual_editor_A' }, { name: 'B Visual Editor', design: '2', label: 'Use the Visual Editor in Mermaid Chart to design and build diagrams', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_B' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=visual_editor_B' }, { name: 'C Visual Editor', design: '1', - label: '1 Use the Visual Editor in Mermaid Pro to design and build diagrams', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_C' + label: 'Use the Visual Editor in Mermaid Pro to design and build diagrams', + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=visual_editor_C' }, { name: 'D Visual Editor', design: '2', label: 'Use the Visual Editor in Mermaid Pro to design and build diagrams', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=visual_editor_D' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=visual_editor_D' }, { name: 'A Whiteboard', design: '1', - label: '1 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_A' + label: 'Explore the Mermaid Whiteboard from the creators of Mermaid', + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard_A' }, { name: 'B Whiteboard', design: '2', label: 'Explore the Mermaid Whiteboard from the creators of Mermaid', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_A' + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard_A' }, { name: 'C Whiteboard', design: '1', - label: '1 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_B' + label: 'Explore the Mermaid Whiteboard from the creators of Mermaid', + url: 'https://www.mermaidchart.com/whiteboard?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard_B' }, { name: 'D Whiteboard', design: '2', label: 'Explore the Mermaid Whiteboard from the creators of Mermaid', - url: 'https://www.mermaidchart.com/play?utm_source=mermaid_js&utm_medium=banner_ad&utm_campaign=whiteboard_B' + url: 'https://www.mermaidchart.com/play?utm_source=mermaid_live_editor&utm_medium=banner_ad&utm_campaign=whiteboard_B' } ]; From bb224b486a0e6f9c37c34deccb8c682841c32e11 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 13 Feb 2025 18:26:26 +0530 Subject: [PATCH 3/6] fix: Position of text when switching, data structure for links --- src/lib/components/Navbar.svelte | 2 +- src/lib/util/promos/January2025.svelte | 228 ++++++++++++------------- 2 files changed, 106 insertions(+), 124 deletions(-) diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index b3ec50f6..e2474035 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -60,7 +60,7 @@ {#if activePromotion} -
+
tagline.name.startsWith(selectedSet)); + const { design, taglines } = + Object.values(allTaglines)[Math.floor(Math.random() * Object.values(allTaglines).length)]; let index = Math.floor(Math.random() * taglines.length); let currentTagline = $state(taglines[index]); @@ -126,26 +110,24 @@ }); -{#key currentTagline} - -{/key} +
+ {#key currentTagline} + + {currentTagline.label} + + + {/key} +
From 942840fb6283c2374e00881e7b70a2af65603d75 Mon Sep 17 00:00:00 2001 From: Steph <35910788+huynhicode@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:41:19 -0800 Subject: [PATCH 4/6] update interval --- src/lib/util/promos/January2025.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/util/promos/January2025.svelte b/src/lib/util/promos/January2025.svelte index ec8a7cb0..f1f1a424 100644 --- a/src/lib/util/promos/January2025.svelte +++ b/src/lib/util/promos/January2025.svelte @@ -103,7 +103,7 @@ const interval = setInterval(() => { index = (index + 1) % taglines.length; currentTagline = taglines[index]; - }, 2000); + }, 5000); onDestroy(() => { clearInterval(interval); From 8ddf56191d00bfd4500309942cc3735c14296eeb Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 14 Feb 2025 13:27:22 +0530 Subject: [PATCH 5/6] chore: Add padding to link --- src/lib/util/promos/January2025.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/util/promos/January2025.svelte b/src/lib/util/promos/January2025.svelte index ec8a7cb0..b5f3272f 100644 --- a/src/lib/util/promos/January2025.svelte +++ b/src/lib/util/promos/January2025.svelte @@ -112,18 +112,18 @@