This repository has been archived by the owner on Jan 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,60 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{app_title}</title> | ||
<script> | ||
if ('serviceWorker' in navigator) { | ||
navigator.serviceWorker.register( | ||
'/sw.js' | ||
); | ||
} | ||
</script> | ||
<link rel="manifest" href="manifest.json"> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta charset="UTF-8" /> | ||
{style_include} | ||
<title>{app_title}</title> | ||
<script> | ||
if ('serviceWorker' in navigator) { | ||
navigator.serviceWorker.register('/sw.js'); | ||
} | ||
</script> | ||
<link rel="manifest" href="manifest.json"> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta charset="UTF-8" /> | ||
{style_include} | ||
<style> | ||
#loading { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
font-size: 24px; | ||
} | ||
.spinner { | ||
width: 50px; | ||
height: 50px; | ||
border: 5px solid #f3f3f3; | ||
border-top: 5px solid #3498db; | ||
border-radius: 50%; | ||
animation: spin 1s linear infinite; | ||
margin-right: 10px; | ||
} | ||
@keyframes spin { | ||
0% { transform: rotate(0deg); } | ||
100% { transform: rotate(360deg); } | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="main"></div> | ||
<script type="module"> | ||
import init from "/{base_path}/assets/dioxus/{app_name}.js"; | ||
init("/{base_path}/assets/dioxus/{app_name}_bg.wasm").then(wasm => { | ||
if (wasm.__wbindgen_start == undefined) { | ||
wasm.main(); | ||
} | ||
}); | ||
</script> | ||
{script_include} | ||
<div id="loading"> | ||
<div class="spinner"></div> | ||
Loading... | ||
</div> | ||
<div id="main" style="display: none;"></div> | ||
<script type="module"> | ||
import init from "/{base_path}/assets/dioxus/{app_name}.js"; | ||
init("/{base_path}/assets/dioxus/{app_name}_bg.wasm").then(wasm => { | ||
if (wasm.__wbindgen_start == undefined) { | ||
wasm.main(); | ||
} | ||
// Hide loading indicator and show main content | ||
document.getElementById('loading').style.display = 'none'; | ||
document.getElementById('main').style.display = 'block'; | ||
}).catch(error => { | ||
console.error('Failed to load WASM:', error); | ||
document.getElementById('loading').innerHTML = 'Failed to load. Please try again.'; | ||
}); | ||
</script> | ||
{script_include} | ||
</body> | ||
</html> |