diff options
Diffstat (limited to 'website/benchmarks.html')
-rw-r--r-- | website/benchmarks.html | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/website/benchmarks.html b/website/benchmarks.html index 2432fedce..2f3a55cc8 100644 --- a/website/benchmarks.html +++ b/website/benchmarks.html @@ -9,6 +9,9 @@ <meta content="width=device-width, initial-scale=1.0" name="viewport" /> </head> <body> + <div id="spinner-overlay"> + <div class="spinner"></div>` + </div> <main> <a href="/"><img src="images/deno_logo_3.svg" width=200></a> <h1>Deno Continuous Benchmarks</h1> @@ -153,10 +156,26 @@ <script type="module"> import { drawCharts } from "./app.js"; window.chartWidth = 800; + const overlay = document.getElementById("spinner-overlay") - let u = window.location.hash.match("all") ? "./data.json" : "recent.json"; + function showSpinner () { + overlay.style.display = "block"; + } - drawCharts(u); + function hideSpinner () { + overlay.style.display = "none"; + } + + function updateCharts () { + const u = window.location.hash.match("all") ? "./data.json" : "recent.json"; + + showSpinner() + + drawCharts(u).finally(hideSpinner) + } + updateCharts() + + window.onhashchange = updateCharts </script> </body> </html> |