Super) Update 2
Super) Update 2
$("<style>")
.prop("type", "text/css")
.html(`
@keyframes backgroundAnimation {
0% { background: #a7fad5; }
25% { background: #c868f7; }
50% { background: #f7e58b; }
75% { background: #cdfaac; }
100% { background: #f2fa57; }
}
`)
.appendTo("head");
const style = document.createElement('style');
style.textContent = `
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
from { opacity: 1; transform: translateY(0); }
to { opacity: 0; transform: translateY(-10px); }
}
`;
document.head.appendChild(style);
buttonPanel.appendChild(btnContainer);
container.appendChild(buttonPanel);
document.body.appendChild(container);
function updateStatus(...messages) {
let statusBar = document.querySelector(".virtual-h3");
if (!statusBar) {
// Create the element if it doesn't exist yet
statusBar = document.createElement("div");
statusBar.classList.add("virtual-h3");
document.body.appendChild(statusBar);
}
try {
// Apply styles to the virtual h3 (div)
statusBar.style.textAlign = 'center'; // Center align text
statusBar.style.background = 'black';
statusBar.style.color = 'white';
statusBar.style.border = '2px solid green';
statusBar.style.maxHeight = '150px';
statusBar.style.width = '100vw';
statusBar.style.marginLeft = '20px';
statusBar.style.padding = '0';
statusBar.style.position = 'absolute';
statusBar.style.top = '45px';
statusBar.style.left = '0';
statusBar.style.overflowY = 'scroll'; // Enable scrolling
statusBar.style.fontSize = '15px';
statusBar.style.zIndex = '9999';
statusBar.style.visibility = 'visible';
statusBar.appendChild(messageDiv);
});
} catch (e) {
console.error(e); // Log any errors for debugging
}
}
stepDiv.appendChild(checkboxInput);
stepDiv.appendChild(label);
return stepDiv;
}
padding: 4px;
margin: 4px;
border: 5px solid #fff;
border-radius: 5px;
display:flex;
flex-direction:row;
align-items:center;
}
.step:nth-child(1) {
background-color: lightblue; /* Color for the first step */
}
.step:nth-child(2) {
background-color: lightgreen; /* Color for the second step */
}
.step:nth-child(3) {
background-color: lightcoral; /* Color for the third step */
}
input[type="checkbox"] {
width: 20px; /* Medium size */
height: 20px; /* Medium size */
margin-right: 10px; /* Space between checkbox and label */
}
input[type="checkbox"]:checked + label {
color: green; /* Change text color when checked */
font-weight: bold; /* Make text bold when checked */
}
input[type="checkbox"]:checked {
background-color: lightgreen; /* Color when checked */
}
input[type="checkbox"]:indeterminate {
background-color: yellow; /* Color for indeterminate state */
}
input[type="checkbox"]:not(:checked) {
background-color: lightcoral; /* Color when unchecked */
}
`;
document.head.appendChild(style);
}
// Function to initialize the steps and insert them into the specified container
function initializeSteps() {
// Create a container for the steps
const stepContainer = document.createElement('div');
stepContainer.style.cssText = `
display: flex;
position: relative;
font-size: 13px;
height: 55%;
margin-bottom: 40px;
`;
if (isProcessStopped) {
updateStatus("Application_Info stopped.");
return false;
}
try {
const response = await sendApplicationInfo(abortController.signal); //
Pass the signal
updateStatus(JSON.stringify(response));
try {
const response = await fetch('https://payment.ivacbd.com/application-info-
submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload),
signal // Attach the abort signal
});
try {
const response = await sendPersonalInfo(abortController.signal); //
Pass the signal
updateStatus(JSON.stringify(response));
try {
const response = await fetch('https://payment.ivacbd.com/personal-info-
submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload1),
signal // Attach the abort signal
});
try {
const response = await sendOverviewInfo(abortController.signal); //
Pass the signal
updateStatus(JSON.stringify(response));
if (isProcessStopped) {
updateStatus("Process stopped after ApplicationSent
sending.");
return;
}
if (isProcessStopped) {
updateStatus("Process stopped after Personalsent
verification.");
try { enableButtonc($("#totalauto")); } catch (e) {}
return;
}
} catch (error) {
updateStatus("Error during auto-processing: " + error.message);
}
}
function stopProcess() {
const step1Check = document.getElementById('mycheckbox1');
step1Check.checked = true;
const step2Check = document.getElementById('mycheckbox2');
step2Check.checked = true; // Corrected the typo here
const step3Check = document.getElementById('mycheckbox3');
step3Check.checked = true; // Corrected the typo here
};