Website: Add site-wide CTA to bring users back to the /start questionnaire (#19393)

Closes: #18530

Changes: 
- Added a collapsable sitewide CTA to bring users who have not completed
the get started questionnaire back to the /start page.
- Added a new action (`account/updateStartCtaVisibility`) to set a
timestamp of when the CTA will be visible (not collapsed) in a user's
session when they close the CTA

---------

Co-authored-by: Mike Thomas <78363703+mike-j-thomas@users.noreply.github.com>
This commit is contained in:
Eric
2024-05-31 18:44:13 -05:00
committed by GitHub
co-authored by Mike Thomas
parent 329f3e7873
commit bf239ecc78
10 changed files with 368 additions and 13 deletions
@@ -0,0 +1,37 @@
module.exports = {
friendlyName: 'Update start CTA visibility',
description: 'Sets a timestamp to determine when we should show the user the start CTA after they have dismissed it.',
inputs: {
},
exits: {
},
fn: async function () {
if(!this.req.session){
throw new Error('Consistency violation. When a user sent a request to the update start CTA visibility endpoint, a session is missing.');
}
if(this.req.session.expandCtaAt) {
// Expand the CTA.
this.req.session.expandCtaAt = 0;
} else {
// collapse CTA for 24 hours.
let nowAt = Date.now();
let tomorrowAt = nowAt + (24 * 60 * 60 * 1000);
this.req.session.expandCtaAt = tomorrowAt;
}
return;
}
};
+15
View File
@@ -284,6 +284,21 @@ will be disabled and/or hidden in the UI.
// Include information about the primary buying situation
// If set in the session (e.g. from an ad), use the primary buying situation for personalization.
res.locals.primaryBuyingSituation = req.session.primaryBuyingSituation || undefined;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// FUTURE: Only show this CTA to users who are below psyStage 6.
// > The code below is so we don't bother users who have completed the questionnaire
// Determine if this user should see the CTA to bring them to the /start questionnaire using the user's last submitted questionnaire answer.
res.locals.showStartCta = !['how-many-hosts','will-you-be-self-hosting','managed-cloud-for-growing-deployments','self-hosted-deploy', 'whats-left-to-get-you-set-up'].includes(req.me.lastSubmittedGetStartedQuestionnaireStep);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// If an expandCtaAt timestamp is set in the user's sesssion, check the value to see if we should expand the CTA.
if(req.session.expandCtaAt && req.session.expandCtaAt > Date.now()) {
res.locals.collapseStartCta = true;
} else {
res.locals.collapseStartCta = false;
}
}//fi
return next();
Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+1 -1
View File
@@ -13,7 +13,7 @@
Cloud.setup({
/* eslint-disable */
methods: {"downloadSitemap":{"verb":"GET","url":"/sitemap.xml","args":[]},"downloadRssFeed":{"verb":"GET","url":"/rss/:categoryName","args":["categoryName"]},"receiveUsageAnalytics":{"verb":"POST","url":"/api/v1/webhooks/receive-usage-analytics","args":["anonymousIdentifier","fleetVersion","licenseTier","numHostsEnrolled","numUsers","numTeams","numPolicies","numLabels","softwareInventoryEnabled","vulnDetectionEnabled","systemUsersEnabled","hostsStatusWebHookEnabled","numWeeklyActiveUsers","numWeeklyPolicyViolationDaysActual","numWeeklyPolicyViolationDaysPossible","hostsEnrolledByOperatingSystem","hostsEnrolledByOrbitVersion","hostsEnrolledByOsqueryVersion","storedErrors","numHostsNotResponding","organization","mdmMacOsEnabled","mdmWindowsEnabled","liveQueryDisabled","hostExpiryEnabled"]},"receiveFromGithub":{"verb":"GET","url":"/api/v1/webhooks/github","args":["botSignature","action","sender","repository","changes","issue","comment","pull_request","label","release"]},"receiveFromStripe":{"verb":"POST","url":"/api/v1/webhooks/receive-from-stripe","args":["id","type","data","webhookSecret"]},"deliverContactFormMessage":{"verb":"POST","url":"/api/v1/deliver-contact-form-message","args":["emailAddress","firstName","lastName","message"]},"sendPasswordRecoveryEmail":{"verb":"POST","url":"/api/v1/entrance/send-password-recovery-email","args":["emailAddress"]},"signup":{"verb":"POST","url":"/api/v1/customers/signup","args":["emailAddress","password","organization","firstName","lastName","signupReason"]},"updateProfile":{"verb":"POST","url":"/api/v1/account/update-profile","args":["firstName","lastName","organization","emailAddress"]},"updatePassword":{"verb":"POST","url":"/api/v1/account/update-password","args":["oldPassword","newPassword"]},"updateBillingCard":{"verb":"POST","url":"/api/v1/account/update-billing-card","args":["stripeToken","billingCardLast4","billingCardBrand","billingCardExpMonth","billingCardExpYear"]},"login":{"verb":"POST","url":"/api/v1/customers/login","args":["emailAddress","password","rememberMe"]},"logout":{"verb":"GET","url":"/api/v1/account/logout","args":[]},"createQuote":{"verb":"POST","url":"/api/v1/customers/create-quote","args":["numberOfHosts"]},"saveBillingInfoAndSubscribe":{"verb":"POST","url":"/api/v1/customers/save-billing-info-and-subscribe","args":["quoteId","organization","firstName","lastName","paymentSource"]},"updatePasswordAndLogin":{"verb":"POST","url":"/api/v1/entrance/update-password-and-login","args":["password","token"]},"deliverDemoSignup":{"verb":"POST","url":"/api/v1/deliver-demo-signup","args":["emailAddress"]},"createOrUpdateOneNewsletterSubscription":{"verb":"POST","url":"/api/v1/create-or-update-one-newsletter-subscription","args":["emailAddress","subscribeTo"]},"unsubscribeFromAllNewsletters":{"verb":"GET","url":"/api/v1/unsubscribe-from-all-newsletters","args":["emailAddress"]},"buildLicenseKey":{"verb":"POST","url":"/api/v1/admin/build-license-key","args":["numberOfHosts","organization","expiresAt","partnerName"]},"createVantaAuthorizationRequest":{"verb":"POST","url":"/api/v1/create-vanta-authorization-request","args":["emailAddress","fleetInstanceUrl","fleetApiKey"]},"deliverMdmBetaSignup":{"verb":"POST","url":"/api/v1/deliver-mdm-beta-signup","args":["emailAddress","fullName","jobTitle","numberOfHosts"]},"getHumanInterpretationFromOsquerySql":{"verb":"POST","url":"/api/v1/get-human-interpretation-from-osquery-sql","args":["sql"]},"deliverAppleCsr":{"verb":"POST","url":"/api/v1/deliver-apple-csr","args":["unsignedCsrData"]},"deliverMdmDemoEmail":{"verb":"POST","url":"/api/v1/deliver-mdm-demo-email","args":["emailAddress"]},"provisionSandboxInstanceAndDeliverEmail":{"verb":"POST","url":"/api/v1/admin/provision-sandbox-instance-and-deliver-email","args":["userId"]},"deliverTalkToUsFormSubmission":{"verb":"POST","url":"/api/v1/deliver-talk-to-us-form-submission","args":["emailAddress","firstName","lastName","organization","numberOfHosts","primaryBuyingSituation"]},"saveQuestionnaireProgress":{"verb":"POST","url":"/api/v1/save-questionnaire-progress","args":["currentStep","formData"]}}
methods: {"downloadSitemap":{"verb":"GET","url":"/sitemap.xml","args":[]},"downloadRssFeed":{"verb":"GET","url":"/rss/:categoryName","args":["categoryName"]},"receiveUsageAnalytics":{"verb":"POST","url":"/api/v1/webhooks/receive-usage-analytics","args":["anonymousIdentifier","fleetVersion","licenseTier","numHostsEnrolled","numUsers","numTeams","numPolicies","numLabels","softwareInventoryEnabled","vulnDetectionEnabled","systemUsersEnabled","hostsStatusWebHookEnabled","numWeeklyActiveUsers","numWeeklyPolicyViolationDaysActual","numWeeklyPolicyViolationDaysPossible","hostsEnrolledByOperatingSystem","hostsEnrolledByOrbitVersion","hostsEnrolledByOsqueryVersion","storedErrors","numHostsNotResponding","organization","mdmMacOsEnabled","mdmWindowsEnabled","liveQueryDisabled","hostExpiryEnabled"]},"receiveFromGithub":{"verb":"GET","url":"/api/v1/webhooks/github","args":["botSignature","action","sender","repository","changes","issue","comment","pull_request","label","release"]},"receiveFromStripe":{"verb":"POST","url":"/api/v1/webhooks/receive-from-stripe","args":["id","type","data","webhookSecret"]},"deliverContactFormMessage":{"verb":"POST","url":"/api/v1/deliver-contact-form-message","args":["emailAddress","firstName","lastName","message"]},"sendPasswordRecoveryEmail":{"verb":"POST","url":"/api/v1/entrance/send-password-recovery-email","args":["emailAddress"]},"signup":{"verb":"POST","url":"/api/v1/customers/signup","args":["emailAddress","password","organization","firstName","lastName","signupReason"]},"updateProfile":{"verb":"POST","url":"/api/v1/account/update-profile","args":["firstName","lastName","organization","emailAddress"]},"updatePassword":{"verb":"POST","url":"/api/v1/account/update-password","args":["oldPassword","newPassword"]},"updateBillingCard":{"verb":"POST","url":"/api/v1/account/update-billing-card","args":["stripeToken","billingCardLast4","billingCardBrand","billingCardExpMonth","billingCardExpYear"]},"login":{"verb":"POST","url":"/api/v1/customers/login","args":["emailAddress","password","rememberMe"]},"logout":{"verb":"GET","url":"/api/v1/account/logout","args":[]},"createQuote":{"verb":"POST","url":"/api/v1/customers/create-quote","args":["numberOfHosts"]},"saveBillingInfoAndSubscribe":{"verb":"POST","url":"/api/v1/customers/save-billing-info-and-subscribe","args":["quoteId","organization","firstName","lastName","paymentSource"]},"updatePasswordAndLogin":{"verb":"POST","url":"/api/v1/entrance/update-password-and-login","args":["password","token"]},"deliverDemoSignup":{"verb":"POST","url":"/api/v1/deliver-demo-signup","args":["emailAddress"]},"createOrUpdateOneNewsletterSubscription":{"verb":"POST","url":"/api/v1/create-or-update-one-newsletter-subscription","args":["emailAddress","subscribeTo"]},"unsubscribeFromAllNewsletters":{"verb":"GET","url":"/api/v1/unsubscribe-from-all-newsletters","args":["emailAddress"]},"buildLicenseKey":{"verb":"POST","url":"/api/v1/admin/build-license-key","args":["numberOfHosts","organization","expiresAt","partnerName"]},"createVantaAuthorizationRequest":{"verb":"POST","url":"/api/v1/create-vanta-authorization-request","args":["emailAddress","fleetInstanceUrl","fleetApiKey"]},"deliverMdmBetaSignup":{"verb":"POST","url":"/api/v1/deliver-mdm-beta-signup","args":["emailAddress","fullName","jobTitle","numberOfHosts"]},"getHumanInterpretationFromOsquerySql":{"verb":"POST","url":"/api/v1/get-human-interpretation-from-osquery-sql","args":["sql"]},"deliverAppleCsr":{"verb":"POST","url":"/api/v1/deliver-apple-csr","args":["unsignedCsrData","deliveryMethod"]},"deliverMdmDemoEmail":{"verb":"POST","url":"/api/v1/deliver-mdm-demo-email","args":["emailAddress"]},"provisionSandboxInstanceAndDeliverEmail":{"verb":"POST","url":"/api/v1/admin/provision-sandbox-instance-and-deliver-email","args":["userId"]},"deliverTalkToUsFormSubmission":{"verb":"POST","url":"/api/v1/deliver-talk-to-us-form-submission","args":["emailAddress","firstName","lastName","organization","numberOfHosts","primaryBuyingSituation"]},"saveQuestionnaireProgress":{"verb":"POST","url":"/api/v1/save-questionnaire-progress","args":["currentStep","formData"]},"updateStartCtaVisibility":{"verb":"POST","url":"/api/v1/account/update-start-cta-visibility","args":[]}}
/* eslint-enable */
});
+219 -9
View File
@@ -39,6 +39,137 @@ html, body {
transition-duration: 500ms;
}
[purpose='continue-banner'] {
z-index: 199;
position: fixed;
bottom: 24px;
left: 24px;
[purpose='banner-body'].invisible {
transform: translateY(200px);
}
[purpose='banner-body'] {
transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
[purpose='banner-close-button'] {
width: 18px;
height: 18px;
display: flex;
justify-content: center;
align-items: center;
padding: 4px;
font-size: 20px;
line-height: 24px;
cursor: pointer;
}
width: 260px;
position: relative;
border-radius: 12px;
border: 1px solid #E2E4EA;
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);
padding: 8px;
background: #FFFFFF;
[purpose='banner-text'] {
width: 100%;
padding: 0 0 0 16px;
strong {
font-size: 13px;
}
p {
color: #192147;
font-size: 12px;
font-style: normal;
line-height: 18px; /* 150% */
margin-bottom: 0;
}
[purpose='form-progress-bar'] {
height: 6px;
margin-bottom: 16px;
width: 100%;
background: #E2E4EA;
border-radius: 3px;
[purpose='current-progress'] {
background-color: #3DB67B;
height: 6px;
border-radius: 3px;
}
}
[purpose='continue-button'] {
padding-right: 4px;
font-size: 12px;
color: @core-fleet-black;
font-weight: 600;
cursor: pointer;
position: relative;
width: auto;
user-select: none;
transition: 0.2s ease-in-out;
-o-transition: 0.2s ease-in-out;
-ms-transition: 0.2s ease-in-out;
-moz-transition: 0.2s ease-in-out;
-webkit-transition: 0.2s ease-in-out;
&:hover {
text-decoration: none;
}
&:before {
content: url('/images/arrow-right-red-16x16@2x.png');
transform: scale(0.25);
position: absolute;
top: -10px;
left: 80%; // <--- here
transition: 0.2s ease-in-out;
-o-transition: 0.2s ease-in-out;
-ms-transition: 0.2s ease-in-out;
-moz-transition: 0.2s ease-in-out;
-webkit-transition: 0.2s ease-in-out;
}
&:hover:before {
left: 85%; // <--- here
transition: 0.2s ease-in-out;
-o-transition: 0.2s ease-in-out;
-ms-transition: 0.2s ease-in-out;
-moz-transition: 0.2s ease-in-out;
-webkit-transition: 0.2s ease-in-out;
}
}
}
[purpose='continue-chevron'] {
display: none;
}
[purpose='banner-image'] {
height: 80px;
min-width: 80px;
background-image: url('/images/continue-thumbnail.png');
background-size: cover;
}
}
[purpose='banner-body'].collapsed {
[purpose='banner-image'] {
height: 100px;
min-width: 100px;
}
[purpose='banner-text'] {
display: none;
}
&:hover {
transform: scale(0.9);
}
transform: scale(0.8);
cursor: pointer;
min-height: unset;
overflow: hidden;
border-radius: 50%;
border: 4px solid #FFF;
padding: 0;
background: #EEF9FE;
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);
width: 100px;
height: 100px;
&.invisible {
transform: translateY(200px);
}
}
}
[purpose='header-ribbon-cta'] {
background-color: #7487C2;
p {
@@ -456,6 +587,93 @@ body.detected-mobile {
margin-bottom: 32px;
}
}
[purpose='continue-banner'] {
position: fixed;
bottom: 70px;
height: 0px;
left: 0;
right: unset;
width: 100%;
[purpose='banner-body'].invisible {
transform: translateY(200px);
}
[purpose='banner-body'] {
transition: transform 1s ease-in-out;
[purpose='banner-close-button'] {
display: none;
}
height: 70px;
min-height: unset;
width: 100%;
margin-right: 0px;
position: relative;
border-radius: 0px;
border: 1px solid #E2E4EA;
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);
padding: 8px;
background: #FFFFFF;
cursor: pointer;
[purpose='banner-text'] {
width: 100%;
margin-right: 24px;
padding: 8px 8px 8px 16px;
p {
font-size: 12px;
line-height: 18px;
margin-bottom: 0;
}
[purpose='form-progress-bar'] {
height: 6px;
margin-bottom: 4px;
width: 100%;
background: #E2E4EA;
border-radius: 3px;
[purpose='current-progress'] {
background-color: #3DB67B;
height: 6px;
border-radius: 3px;
}
}
[purpose='continue-button'] {
display: none;
}
}
[purpose='continue-chevron'] {
display: block;
img {
width: 5px;
height: 10px;
margin-right: 8px;
}
}
[purpose='banner-image'] {
height: 54px;
min-width: 54px;
background-image: url('/images/continue-thumbnail.png');
background-size: cover;
}
}
[purpose='banner-body'].collapsed {
[purpose='banner-text'] {
display: flex;
}
transform: none;
transition: none;
&:hover {
transform: none;
}
height: 70px;
min-height: unset;
width: 100%;
margin-right: 0px;
position: relative;
border-radius: 0px;
border: 1px solid #E2E4EA;
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.15);
padding: 8px;
background: #FFFFFF;
}
}
}
@media (max-width: 767px) {
@@ -526,15 +744,7 @@ body.detected-mobile {
[purpose='license-information'] {
margin-bottom: 32px;
}
// For hiding the hubspot chat widget on mobile devices.
#hubspot-messages-iframe-container iframe[aria-label='Chat Widget'] {
display: none !important;//lesshint-disable-line importantRule
}
html.hs-messages-widget-open, html.hs-messages-mobile.hs-messages-widget-open {// Shows the hubspot chat widget when the widget is opened from a "Talk to an expert" button.
#hubspot-messages-iframe-container iframe[aria-label='Chat Widget'] {
display: initial !important;//lesshint-disable-line importantRule
}
}
}
@media (max-width: 375px) {
+2 -1
View File
@@ -937,7 +937,8 @@
}
[purpose='back-to-top-button-container'] {
position: sticky;
bottom: 107px;
bottom: 200px;
right: 0px;
overflow-x: hidden;
pointer-events: none;
}
+11
View File
@@ -87,6 +87,7 @@ module.exports.routes = {
skipAssets: false,
action: 'docs/view-basic-documentation',// Meta title and description set in view action
locals: {
hideStartCTA: true,
currentSection: 'documentation',
}
},// handles /docs and /docs/foo/bar
@@ -111,6 +112,7 @@ module.exports.routes = {
locals: {
hideHeaderLinks: true,
hideFooterLinks: true,
hideStartCTA: true,
pageTitleForMeta: 'Get Fleet Premium | Fleet',
pageDescriptionForMeta: 'Generate your quote and start using Fleet Premium today.',
}
@@ -138,6 +140,7 @@ module.exports.routes = {
locals: {
hideHeaderLinks: true,
hideFooterLinks: true,
hideStartCTA: true,
pageTitleForMeta: 'Customer dashboard | Fleet',
pageDescriptionForMeta: 'View and edit information about your Fleet Premium license.',
}
@@ -147,6 +150,7 @@ module.exports.routes = {
locals: {
hideHeaderLinks: true,
hideFooterLinks: true,
hideStartCTA: true,
pageTitleForMeta: 'Forgot password | Fleet',
pageDescriptionForMeta: 'Recover the password for your Fleet customer account.',
}
@@ -156,6 +160,7 @@ module.exports.routes = {
locals: {
hideHeaderLinks: true,
hideFooterLinks: true,
hideStartCTA: true,
pageTitleForMeta: 'New password | Fleet',
pageDescriptionForMeta: 'Change the password for your Fleet customer account.',
}
@@ -190,6 +195,7 @@ module.exports.routes = {
locals: {
hideFooterLinks: true,
showAdminLinks: true,
hideStartCTA: true,
},
},
@@ -199,6 +205,7 @@ module.exports.routes = {
locals: {
hideFooterLinks: true,
showAdminLinks: true,
hideStartCTA: true,
},
},
@@ -207,6 +214,7 @@ module.exports.routes = {
locals: {
hideFooterLinks: true,
showAdminLinks: true,
hideStartCTA: true,
},
},
@@ -222,6 +230,7 @@ module.exports.routes = {
locals: {
hideFooterLinks: true,
showAdminLinks: true,
hideStartCTA: true,
}
},
@@ -284,6 +293,7 @@ module.exports.routes = {
locals: {
hideFooterLinks: true,
hideGetStartedButton: true,
hideStartCTA: true,
pageTitleForMeta: 'Start | Fleet',
pageDescriptionForMeta: 'Get Started with Fleet. Spin up a local demo or get your Premium license key.',
}
@@ -583,4 +593,5 @@ module.exports.routes = {
'POST /api/v1/admin/provision-sandbox-instance-and-deliver-email': { action: 'admin/provision-sandbox-instance-and-deliver-email' },
'POST /api/v1/deliver-talk-to-us-form-submission': { action: 'deliver-talk-to-us-form-submission' },
'POST /api/v1/save-questionnaire-progress': { action: 'save-questionnaire-progress' },
'POST /api/v1/account/update-start-cta-visibility': { action: 'account/update-start-cta-visibility' },
};
+4 -2
View File
@@ -9,7 +9,7 @@
var hideFooterLinks;// Hides footer links, reduces the height of the footer to 60px;
var showAdminLinks;// Shows links to admin pages to admin users.
var hideGetStartedButton;// Hides the 'Get started' button in the website's navigation header.
var hideStartCTA;
// Applies personalization for who people come from ads, so that the website makes more sense for them:
var primaryBuyingSituation;
var defaultMetaTitle = 'Fleet | Open-source '+(primaryBuyingSituation === 'mdm' ? 'device management' : primaryBuyingSituation === 'vm' ? 'vulnerability management' : 'endpoint ops');
@@ -426,8 +426,10 @@
</div>
</div>
<% } %>
<%if(!hideStartCTA){%>
<%- partial('../partials/continue.partial.ejs') %>
<%}%>
</div>
<% /*
Client-side JavaScript
========================
+79
View File
@@ -0,0 +1,79 @@
<%if(me && showStartCta){%>
<div purpose="continue-banner" class="d-flex justify-content-end">
<div purpose="banner-body" class="d-flex flex-row align-items-center invisible <%- collapseStartCta ? 'collapsed' : ''%>">
<div purpose="banner-image">
</div>
<div purpose="banner-text" class="d-flex flex-column justify-content-center">
<% if(['2 - Aware', '3 - Intrigued'].includes(me.psychologicalStage)) { %>
<strong>Tried Fleet yet?</strong>
<p>Get started with Fleet</p>
<% } else if(['4 - Has use case', '5 - Personally confident'].includes(me.psychologicalStage)) { %>
<strong>Feeling confident?</strong>
<p>Get set up with Fleet</p>
<% } else if (me.psychologicalStage === '6 - Has team buy-in') {%>
<strong>Talk to the team</strong>
<p>Lets get you set up!</p>
<% } %>
<div>
<a purpose="continue-button" href="/start">Continue</a>
</div>
</div>
<a purpose="continue-chevron" href="/start"> <img alt="continue" src="/images/chevron-core-fleet-black-7x12@2x.png"> </a>
<div class="d-flex flex-column align-self-start">
<div purpose="banner-close-button">&times;</div>
</div>
</div>
</div>
<script>
if (window._hasAlreadyLoadedContinuePartialScript) {
throw new Error('continue.partial.ejs should never be included in the HTML more than once.');
}
window._hasAlreadyLoadedContinuePartialScript = true;
document.addEventListener('DOMContentLoaded', () => {
// Toggle 'collapsed' on banner body when close button is clicked
$('[purpose="banner-close-button"]').click((event)=>{
event.stopPropagation(); // Prevent the event from triggering the event listener that removes the collapsed class from running.
Cloud.updateStartCtaVisibility().exec();
$('[purpose="banner-body"]').addClass('collapsed');
});//œ
// Toggle 'collapsed' on banner body when it is clicked (if it has the class)
$('[purpose="banner-body"]').click((event)=> {
if(window.innerWidth < 991) {// If the mobile version of the CTA is visible, the entire body is a clickable link.
window.location = '/start';
} else {
let $el = $(event.currentTarget);
if ($el.hasClass('collapsed')) {
Cloud.updateStartCtaVisibility().exec();
$el.removeClass('collapsed');
}
}
});//œ
if(SAILS_LOCALS.isHomepage){
// If this is on the Fleet homepage, remove the invisible class after the user scrolls the height of their viewport.
let lastScrollTop = 0;
let banner = document.querySelector('[purpose="banner-body"]');
window.addEventListener('scroll', ()=>{
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if(scrollTop > lastScrollTop && scrollTop > window.innerHeight) {
// If the user scrolls 1.5x the height of their browser window, hide the page banner.
banner.classList.remove('invisible');
lastScrollTop = scrollTop;
}
});//œ
} else {
// OTehrwise, remove the 'invisible' class 1 second after page loads
setTimeout(() => {
$('[purpose="banner-body"]').toggleClass('invisible');
}, 1000);;//œ
}
});//œ
</script>
<% } %>