source.app
Types 1
structFlags
Fields
bool helpbool bettercbool releasebool buildFunctions 3
fn
int main(string[] args)fn
string getImportPathFromDub(string packageName, string packageSourceName = "source")fn
int run(string[] args...)Variables 2
enumvar
helpText = "
Usage:
dub run parin:web -- [flags] [libs]
Flags:
-help Show this.
-betterc Use the `-betterC` flag.
-release Use the `-release` flag.
-build Avoid emrun after a successful build.
Libs:
Any non-flag argument is linked as an extra library.
Example: dub run parin:web -- web/libbox2d.a
"[1 .. $ - 1]enumvar
shellText = `
<!doctype html>
<html lang="EN-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<title>App</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🧶</text></svg>">
<style>
body { margin: 0px; overflow: hidden; }
canvas.emscripten { border: 0px none; background-color: black; }
loading {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex; /* Center content horizontally and vertically */
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
z-index: 100; /* Ensure loading indicator sits above content */
}
.spinner {
border: 16px solid #c0c0c0; /* Big */
border-top: 16px solid #343434; /* Small */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
}
.center {
position: fixed;
inset: 0px;
width: 120px;
height: 120px;
margin: auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
canvas {
display: none; /* Initially hide the canvas */
}
</style>
</head>
<body>
<div id="loading">
<div class="center">
<div class="spinner"></div>
</div>
</div>
<canvas class=emscripten id=canvas oncontextmenu=event.preventDefault() tabindex=-1></canvas>
<p id="output" />
<script>
var Module = {
canvas: (function() {
var canvas = document.getElementById('canvas');
return canvas;
})(),
preRun: [function() {
// Show loading indicator
document.getElementById("loading").style.display = "block";
}],
postRun: [function() {
// Hide loading indicator and show canvas
document.getElementById("loading").style.display = "none";
document.getElementById("canvas").style.display = "block";
}]
};
</script>
{{{ SCRIPT }}}
</body>
</html>
`[1 .. $ - 1]