Skip to content

Commit

Permalink
Apply the loading spinner from the plotter example to the memory game
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Aug 12, 2021
1 parent 7fef85b commit a0a3e6e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion examples/memory/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,36 @@

<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<style>
/* beautify ignore:start */
.spinner:before {
content: ''; box-sizing: border-box; position: absolute;
top: 50%; left: 50%; width: 100px; height: 100px;
margin-top: -10px; margin-left: -10px;
border-radius: 50%; border: 2px solid transparent;
border-top-color: #07d; border-bottom-color: #07d;
animation: spinner 1s ease infinite;
}
@keyframes spinner { to { transform: rotate(360deg); } }
/* beautify ignore:end */
</style>
</head>

<body>
<p>This is the SixtyFPS Memory Game compiled to WebAssembly.</p>
<div id="spinner" style="position: relative;">
<div class="spinner">Loading...</div>
</div>
<canvas id="canvas"></canvas>
<p>
<a href="https://github.com/sixtyfpsui/sixtyfps/blob/master/examples/memory/main.rs">
View Source Code on GitHub</a>
</p>
<script type="module">
import init from "./pkg/memory.js";
init();
init().finally(() => {
document.getElementById("spinner").remove();
});
</script>
</body>

Expand Down

0 comments on commit a0a3e6e

Please sign in to comment.