Skip to content

Commit

Permalink
test interface avant depliage
Browse files Browse the repository at this point in the history
  • Loading branch information
gilboonet authored Nov 21, 2024
1 parent eefbca2 commit 534c0af
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
79 changes: 79 additions & 0 deletions deplieur2/Deplieur.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!--
Copyright (C) 2024 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
-->

<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!--Set visual viewport size for mobile devices to the device size,
witch results in a scale of 1 and a 1:1 mapping between CSS pixels
and Qt device independent pixels. -->
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=0"/>

<title>Deplieur</title>
<style>
/* Make the html body cover the entire (visual) viewport with no scroll bars. */
html, body { padding: 0; margin: 0; overflow: hidden; height: 100% }
#screen { width: 100%; height: 100%; }
</style>
</head>
<body onload="init()">
<figure style="overflow:visible;" id="qtspinner">
<center style="margin-top:1.5em; line-height:150%">
<img src="qtlogo.svg" width="320" height="200" style="display:block"></img>
<strong>Qt for WebAssembly: Deplieur</strong>
<div id="qtstatus"></div>
<noscript>JavaScript is disabled. Please enable JavaScript to use this application.</noscript>
</center>
</figure>
<div id="screen"></div>

<script type="text/javascript">
async function init()
{
const spinner = document.querySelector('#qtspinner');
const screen = document.querySelector('#screen');
const status = document.querySelector('#qtstatus');

const showUi = (ui) => {
[spinner, screen].forEach(element => element.style.display = 'none');
if (screen === ui)
screen.style.position = 'default';
ui.style.display = 'block';
}

try {
showUi(spinner);
status.innerHTML = 'Loading...';

const instance = await qtLoad({
qt: {
onLoaded: () => showUi(screen),
onExit: exitData =>
{
status.innerHTML = 'Application exit';
status.innerHTML +=
exitData.code !== undefined ? ` with code ${exitData.code}` : '';
status.innerHTML +=
exitData.text !== undefined ? ` (${exitData.text})` : '';
showUi(spinner);
},
entryFunction: window.Deplieur_entry,
containerElements: [screen],

}
});
} catch (e) {
console.error(e);
console.error(e.stack);
}
}
</script>
<script src="Deplieur.js"></script>
<script type="text/javascript" src="qtloader.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions deplieur2/Deplieur.js

Large diffs are not rendered by default.

Binary file added deplieur2/Deplieur.wasm
Binary file not shown.

0 comments on commit 534c0af

Please sign in to comment.