+9
-2
@@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Tecdo 消耗与余额</title>
|
||||
<link rel="icon" href="data:,">
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
@@ -405,8 +406,14 @@ Promise.all([
|
||||
err.textContent = '数据加载失败:' + e.message;
|
||||
});
|
||||
|
||||
let resizeTimer;
|
||||
addEventListener('resize', () => { clearTimeout(resizeTimer); resizeTimer = setTimeout(drawCharts, 120); });
|
||||
let resizeTimer, lastWidth = 0;
|
||||
new ResizeObserver(entries => {
|
||||
const w = Math.round(entries[0].contentRect.width);
|
||||
if (w === lastWidth) return;
|
||||
lastWidth = w;
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(drawCharts, 120);
|
||||
}).observe(document.querySelector('main'));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user