This guide demonstrates how to display a progress bar, embedded within the window frame container. Resizing the window frame also resizes the progress bar proportionately; hovering over the progress bar with the mouse logs the event to the console.
<!DOCTYPE html> <!-- Copyright (c) 2026 by Javaika Technologies -->
<html lang = "en-AU"> <!-- Set the primary language to en-AU -->
<head>
<title>Progress Bar</title> <!-- Set the page title -->
<meta name = "robots" content = "noindex, follow">
</head>
<body>
<!-- Include the framework script tag -->
<script type = "module" src = "https://www.javaika.com/frame/web-interface@main/api.js"></script>
<!-- Run the demo as an ES Module -->
<script type = "module">
// Initialize a shorter prefix for referencing.
const jwi = window.javaika.webInterface;
let progressBarControl; // Declare progress bar control.
// Initialize the developer token endpoint.
jwi.init({
tokenEndpoint: "https://www.javaika.com/pscript/jwt-access.php"
});
// Authenticate before using the framework.
jwi.requestToken({
framework: "web_interface" // Specify the framework for token issuance.
});
// Authenticate callback handler.
function onAuthenticate(event)
{
jwi.refreshToken(); // Refresh the authentication token.
console.log('[Web Interface] Authentication received callback:', event);
}
// Window frame resized callback handler.
function onWindowFrameResized(event)
{
jwi.scaleInterfaceControls(event.detail.scaleFactor);
}
// Progress bar initialized callback handler.
function onProgressBarInitialized(event)
{
progressBarControl.setSizeFactor(1.5); // Increase initial size.
progressBarControl.setIndeterminateText("PROCESSING"); // Set indeterminate text.
progressBarControl.setEvent('mouseover', onMouseOver); // Bind mouseover event.
progressBarControl.setEvent('mouseout', onMouseOut); // Bind mouseout event.
console.log('[Web Interface] Progress bar initialized callback:', event);
}
// Mouse over callback handler.
function onMouseOver(event)
{
progressBarControl.setIndeterminateMode(true);
const indeterminateText = progressBarControl.getIndeterminateText();
const indeterminateMode = progressBarControl.isIndeterminateMode();
console.log('[Web Interface] Mouse over callback:', event);
console.log('[Web Interface] The indeterminate text is:', indeterminateText);
console.log('[Web Interface] The indeterminate mode is:', indeterminateMode);
}
// Mouse out callback handler.
function onMouseOut(event)
{
progressBarControl.setDeterminateMode(true);
progressBarControl.setDeterminatePercentage(75);
const determinatePercentage = progressBarControl.getDeterminatePercentage();
const determinateMode = progressBarControl.isDeterminateMode();
console.log('[Web Interface] Mouse out callback:', event);
console.log('[Web Interface] The determinate percentage is:', determinatePercentage);
console.log('[Web Interface] The determinate mode is:', determinateMode);
}
// Initialized callback handler.
function onInitialized(event)
{
// Define the controls for the interface.
let windowFrame = new jwi.WindowFrame();
progressBarControl = new jwi.ProgressBar("Pending");
// Add initial styles for the progress bar.
progressBarControl.addStyle('left', '24%');
progressBarControl.addStyle('top', '45%');
// Add progress bar component to the window frame.
windowFrame.addProgressBarElement(progressBarControl);
// Enable manual resizing of the container window.
jwi.setContainerManuallyResizable(true);
jwi.setMaintainAspectRatio(true);
// Set handle offsets from the container window.
jwi.setContainerOffsetHeight(50);
jwi.setContainerOffsetWidth(50);
// Render interface to the browser window.
jwi.renderInterface(windowFrame);
console.log('[Web Interface] Framework initialized callback:', event);
}
// Callback event after authenticate.
document.addEventListener
(
'javaika.webInterface.authenticate', onAuthenticate
);
// Callback event after initialized.
document.addEventListener
(
'javaika.webInterface.initialized', onInitialized
);
// Callback event after progress bar initialized.
document.addEventListener
(
'javaika.webInterface.progressBarInitialized', onProgressBarInitialized
);
// Callback event after window frame resize.
document.addEventListener
(
'javaika.webInterface.windowFrameResized', onWindowFrameResized
);
</script>
</body>
</html>
/* Standard class styles */
.javaika-progress-bar
{
background: linear-gradient(to bottom, #F0F0F0, #FAFAFA, #F0F0F0);
box-sizing: border-box;
user-select: none;
animation: none;
border: 1px solid;
border-color: #AAA;
position: absolute;
overflow: hidden;
font-size: 14px;
padding: 2px;
height: 30px;
width: 200px;
display: none;
}
.javaika-progress-bar-box
{
background-color: #E0E0E0;
height: 100%;
width: 0;
}
.javaika-progress-bar-text
{
transform: translate(-50%, -50%);
text-align: center;
position: absolute;
font-weight: bold;
width: 100%;
left: 50%;
top: 50%;
}
/* Adjoined class styles */
.javaika-progress-bar.disabled
{
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
}
/* Pseudo class styles */
.javaika-progress-bar:focus
{
outline: none;
}
.javaika-progress-bar:focus-visible
{
outline: 2px solid #809DFF;
outline-offset: 3px;
}
@keyframes cycle
{
0%
{
transform: translateX(0%); /* Start to the left */
}
50%
{
transform: translateX(300%); /* Move to the right */
}
100%
{
transform: translateX(0%); /* Move back to the left */
}
}
Next capability: Demonstrate how to incorporate a Titled Border.