feat(EnvelopeLocked): Timer mit CSS-Konfiguration und Javascript-Ereignis hinzugefügt.

- Ablauf über Home-Controller-Ansichtsdaten hinzugefügt
This commit is contained in:
Developer 02
2024-11-30 01:56:02 +01:00
parent cdec5485c6
commit fa44b82493
12 changed files with 99 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ document.querySelectorAll('.email-input').forEach(input => {
document.addEventListener('DOMContentLoaded', function () {
var dropdownItems = document.querySelectorAll('.culture-dropdown-item');
dropdownItems.forEach(function (item) {
item.addEventListener('click', async function(event) {
item.addEventListener('click', async function (event) {
event.preventDefault();
var language = this.getAttribute('data-language');
var flagCode = this.getAttribute('data-flag');
@@ -21,6 +21,30 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
const setTimer = (elementId, expirationTime) => {
const element = document.getElementById(elementId);
const interval = setInterval(function () {
var now = new Date();
var diffInMillis = expirationTime - now;
if (diffInMillis <= 0) {
element.textContent = "00:00";
clearInterval(interval);
}
var minutes = Math.floor(diffInMillis / 1000 / 60);
var seconds = Math.floor((diffInMillis / 1000) % 60);
var formattedMinutes = minutes.toString().padStart(2, '0');
var formattedSeconds = seconds.toString().padStart(2, '0');
var remainingTime = `${formattedMinutes}:${formattedSeconds}`;
element.textContent = remainingTime;
}, 1000);
}
const bsNotify = (message, options) => alertify.notify(
`<div class="alert ${options.alert_type ? 'alert-' + options.alert_type : ''}" role="alert"><span class="material-symbols-outlined">${options?.icon_name ?? ''}</span><p>${message}</p></div>`,
'custom',