Javascript only component to handle session timeout.
scopeEl - Define the scope of the entire componentpromptTime - Time limit in seconds of when to prompt user with SessionTimeoutUIcontinueRetryLimit - The amount of times the script attempt to notify the server of user continuing sessionsessionExpiredUrl - URL of where to take the user after session has expiredexpireSessionUrl - URL to notify server of session timeoutsessionContinueUrl - URL of where to notify server of session continuationanimation - Countable-type animation instancehandleSave - Event handler to handle user click sign out
<div class="dialog js-dialog js-timeout-container" id="dialog" aria-hidden="true">
<!-- <div class="dialog js-dialog" id="dialog" aria-hidden="true" {helpers.track('visible', 'Timeout', 'Timeout window visible')}> -->
<div class="dialog__overlay" tabindex="-1"></div>
<div class="dialog__body" role="dialog" aria-labelledby="dialog-title">
<div role="document">
<div class="mars u-mb-s">Survey or Service name</div>
<h1 class="saturn dialog__title" id="dialog-title" tabindex="0">Your session is about to expire</h1>
<div class="time js-timeout">
<svg class="time__visual" width="80px" height="80px" viewBox="0 0 80 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<circle cx="40" cy="40" r="40" stroke="#D3D3D3" stroke-width="6" fill="none"></circle>
<circle class="time__circle js-timeout-circle" cx="40" cy="40" r="40" transform="rotate(-90 40 40)" fill="none" stroke="red" stroke-width="6" stroke-linecap="round"></circle>
</svg>
<div class="time__text venus js-timeout-time">0:00</div>
</div>
<form class="" action="/" method="post">
<button class="btn js-timeout-continue" type="button" data-loading-msg="Continuing…">Continue survey</button>
<br/>
<button class="btn btn--secondary js-timeout-save" type="submit">Save and sign out</button>
</form>
</div>
</div>
</div>
{
"survey_title": "Survey or Service name",
"width": "40",
"widthDouble": "80"
}