-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmermaidjs-client-flows-charts.html
More file actions
227 lines (204 loc) · 11.5 KB
/
mermaidjs-client-flows-charts.html
File metadata and controls
227 lines (204 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html lang="en">
<head>
<style>
html,
body {
height: 100%;
}
.page {
display: flex;
flex-wrap: nowrap;
height: 100%;
overflow-x: auto;
overflow-y: hidden;
}
main {
width: 100%;
}
.mermaid {
/* This property simulates loading */
visibility: hidden;
text-align: center;
overflow-y: scroll;
height: 100%;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0.5;
background-color: #000;
}
.loading-spinner {
width: 7rem !important;
height: 7rem !important;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="page">
<nav class="d-flex flex-column flex-shrink-0 p-3 bg-light" style="width: 280px;">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
<span class="fs-4">Client flows</span>
</a>
<hr>
<ul class="nav nav-pills flex-column mb-auto" id="nav">
<li class="nav-item">
<a href="" class="nav-link active" aria-current="page" data-bs-toggle="tab" data-bs-target="#registration" role="tab" aria-controls="registration" aria-selected="true">Sign up</a>
</li>
<li class="nav-item">
<a href="" class="nav-link" aria-current="page" data-bs-toggle="tab" data-bs-target="#login" role="tab" aria-controls="login" aria-selected="true">Sign in</a>
</li>
<li class="nav-item">
<a href="" class="nav-link" aria-current="page" data-bs-toggle="tab" data-bs-target="#subscription" role="tab" aria-controls="subscription" aria-selected="false">Subscription</a>
</li>
<li>
<a href="" class="nav-link" aria-current="page" data-bs-toggle="tab" data-bs-target="#re-subscription" role="tab" aria-controls="re-subscription" aria-selected="false">Re-subscription</a>
</li>
<li>
<a href="" class="nav-link" aria-current="page" data-bs-toggle="tab" data-bs-target="#dashboard" role="tab" aria-controls="dashboard" aria-selected="false">Dashboard</a>
</li>
</ul>
</nav>
<main class="tab-content">
<!-- make all tabs active by default, for mermaid.js init to work properly -->
<div class="mermaid tab-pane active" id="registration">
flowchart LR;
REGISTRATION["Sign up"] --> BASIC["Email, phone and password"];
BASIC --> SUBSCRIPTION[<a href='' data-go-to-tab="subscription">Subscription</a>];
SUBSCRIPTION --> DASHBOARD["Dashboard"];
BASIC@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/5.sign-up.jpg", w: 100, constraint: "on"};
SUBSCRIPTION@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/8.plan.jpg", w: 100, constraint: "on"};
DASHBOARD@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/33.dashboard.jpg", w: 100, constraint: "on"};
</div>
<!-- make all tabs active by default, for mermaid.js init to work properly -->
<div class="mermaid tab-pane active" id="login">
flowchart TD;
LOGIN["Sign in"] --> DASHBOARD["Dashboard"];
</div>
<!-- make all tabs active by default, for mermaid.js init to work properly -->
<div class="mermaid tab-pane active" id="subscription">
flowchart LR;
SUBSCRIPTION["Subscription"] --> PLAN{"Plan selection"};
PLAN --> LOCAL["LO-CAL"];
PLAN --> OPTIMEAL["OPTI-MEAL"];
PLAN --> FULLON["FULL-ON"];
LOCAL & OPTIMEAL & FULLON --> DURATION["Duration selection"];
DURATION --> DELIVERY_DAYS["Delivery days selection"];
DELIVERY_DAYS --> ALLERGIES["Allergies selection"];
ALLERGIES --> DISHES["Dishes selection"];
DISHES --> PROFILE_DETAILS["Profile clarification"];
PROFILE_DETAILS --> ADDRESSES["Addresses management"];
ADDRESSES --> CONFIRMATION["Order confirmation and discount code"];
CONFIRMATION --> SKIPCASH_CHECKOUT["SkipCash checkout"];
SKIPCASH_CHECKOUT --> PAYMENT_CONFIRMATION["Payment confirmation & Invoice download"];
PLAN@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/8.plan.jpg", w: 100, constraint: "on"};
LOCAL@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/9.plan-details.jpg", w: 100, constraint: "on"};
OPTIMEAL@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/9.plan-details.jpg", w: 100, constraint: "on"};
FULLON@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/9.plan-details.jpg", w: 100, constraint: "on"};
DURATION@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/10.subscription-duration.jpg", w: 100, constraint: "on"};
DELIVERY_DAYS@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/12.delivery-days.jpg", w: 100, constraint: "on"};
ALLERGIES@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/13.allergies.jpg", w: 100, constraint: "on"};
DISHES@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/14.pick-dishes.jpg", w: 100, constraint: "on"};
PROFILE_DETAILS@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/17.profile-details.jpg", w: 100, constraint: "on"};
ADDRESSES@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/18.addresses.jpg", w: 100, constraint: "on"};
CONFIRMATION@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/23.order-confirmation.jpg", w: 100, constraint: "on"};
SKIPCASH_CHECKOUT@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/24.skipcash-1.jpg", w: 100, constraint: "on"};
PAYMENT_CONFIRMATION@{img: "https://storage.googleapis.com/savvy_eats/documentation/client-app/screenshots/31.payment-confirmation.jpg", w: 100, constraint: "on"};
</div>
<!-- make all tabs active by default, for mermaid.js init to work properly -->
<div class="mermaid tab-pane active" id="re-subscription">
flowchart TD;
RE_SUBSCRIPTION["Re-subscription"] --> PLAN{"Plan selection"};
PLAN --> LOCAL["LO-CAL"];
PLAN --> OPTIMEAL["OPTI-MEAL"];
PLAN --> FULLON["FULL-ON"];
LOCAL & OPTIMEAL & FULLON --> DURATION["Duration selection"];
DURATION --> DELIVERY_DAYS["Delivery days selection"];
DELIVERY_DAYS --> ALLERGIES["Allergies selection"];
ALLERGIES --> DISHES["Dishes selection"];
DISHES --> CONFIRMATION["Order confirmation and discount code"];
CONFIRMATION --> SKIPCASH_CHECKOUT["SkipCash checkout"];
SKIPCASH_CHECKOUT --> PAYMENT_CONFIRMATION["Payment confirmation & Invoice download"];
</div>
<!-- make all tabs active by default, for mermaid.js init to work properly -->
<div class="mermaid tab-pane active" id="dashboard">
flowchart TD;
DASHBOARD["Dashboard"] --> HOME["Home"];
DASHBOARD --> MY_PLAN["My Plan"];
DASHBOARD --> DELIVERIES["Deliveries"];
DASHBOARD --> SUPPORT["Support"];
DASHBOARD --> ACCOUNT["Account"];
</div>
</main>
</div>
<div class="overlay" id="loading">
<div class="d-flex flex-column min-vh-100 justify-content-center align-items-center">
<div class="spinner-border loading-spinner" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3/dist/svg-pan-zoom.min.js"></script>
<script type="importmap">
{
"imports": {
"@popperjs/core": "https://cdn.jsdelivr.net/npm/@popperjs/core@2/dist/umd/popper.min.js",
"bootstrap": "https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.esm.min.js"
}
}
</script>
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.esm.min.mjs';
import * as bootstrap from 'bootstrap';
(async function() {
mermaid.initialize({ startOnLoad: false });
// adds pan zoom to mermaid.js SVGs
const $mermaidNodes = Array.from(document.getElementsByClassName('mermaid'));
for (const $mermaid of $mermaidNodes) {
const svgId = `${$mermaid.id}-svg`;
let { svg } = await mermaid.render(svgId, $mermaid.textContent);
svg = svg.replace(/ *max-width:[ 0-9.]*px;/i, '');
svg = svg.replace(/(<svg.*?)width\s*=\s*"[^"]*"(.*?>)/, '$1width="100%" height="100%"$2');
$mermaid.innerHTML = svg;
setTimeout(function() {
svgPanZoom(`#${svgId}`, {
zoomEnabled: true,
controlIconsEnabled: true,
fit: true,
center: true,
zoomScaleSensitivity: 0.5
});
});
$mermaid.style.visibility = 'visible';
}
// run everything related to the MermaidJS charts, after initialization
// FIX THE INITIAL ACTIVE STATE
document.querySelectorAll('.tab-pane').forEach((pane, index) => {
if (index > 0) {
pane.classList.remove('active');
}
});
// SETUP CLICK HANDLERS FOR IN-DIAGRAM LINKS
document.querySelectorAll('[data-go-to-tab]').forEach(($node) => {
$node.addEventListener('click', (event) => {
event.preventDefault(); // Stop the link from navigating
const targetTabId = $node.dataset.goToTab;
// Find the actual Bootstrap tab TRIGGER in the nav menu
const $triggerLink = document.querySelector(`#nav [data-bs-target="#${targetTabId}"]`);
if ($triggerLink) {
// Get or create a Tab instance from the trigger link and show it
bootstrap.Tab.getOrCreateInstance($triggerLink).show();
}
});
});
document.getElementById('loading').remove();
})();
</script>
</body>
</html>