diff --git a/examples/common/bootstrap.js b/examples/common/bootstrap.js index a3c5914..3ea2c47 100644 --- a/examples/common/bootstrap.js +++ b/examples/common/bootstrap.js @@ -139,6 +139,7 @@ export class Bootstrap { if (options.debug?.statistics) { if (!this.#statsElement) { this.#statsElement = document.createElement("pre"); + this.#statsElement.className = "stats-block"; document.body.appendChild(this.#statsElement); } @@ -371,17 +372,6 @@ export class Bootstrap { const {dpr} = CommonUtils.initCanvas(this.#auxCanvas); this.#auxCtx = this.#auxCanvas.getContext("2d"); this.#auxCtx.scale(dpr, dpr) - - if (this.#statsElement) { - this.#statsElement.className = "stats-block"; - this.#statsElement.style.pointerEvents = "none"; - this.#statsElement.style.position = "absolute"; - this.#statsElement.style.left = "1rem"; - this.#statsElement.style.bottom = "1rem"; - this.#statsElement.style.margin = "0"; - this.#statsElement.style.fontSize = "0.6rem"; - this.#statsElement.style.textShadow = "0 0 2px white, 0 0 2px white, 0 0 2px white, 0 0 2px white"; - } } #step() { diff --git a/examples/common/styles/common.css b/examples/common/styles/common.css index 9d8cbf6..1726f54 100644 --- a/examples/common/styles/common.css +++ b/examples/common/styles/common.css @@ -54,6 +54,18 @@ body { overflow: hidden; font: 13px Helvetica Neue, Lucida Grande, Arial; + background: black; + color: rgb(200, 200, 200); +} + +.stats-block { + pointer-events: none; + position: absolute; + left: 1rem; + bottom: 1rem; + margin: 0; + + color: white; } button { diff --git a/examples/common/styles/themes/white.css b/examples/common/styles/themes/white.css index c968828..d40d212 100644 --- a/examples/common/styles/themes/white.css +++ b/examples/common/styles/themes/white.css @@ -3,6 +3,10 @@ body.white-theme { background: #ece9e9 linear-gradient(180deg, #fff, #ece9e9) no-repeat; } +.white-theme .stats-block { + color: black; +} + .white-theme button { color: black; } diff --git a/examples/gravity/style.css b/examples/gravity/style.css index c72de1f..87ef77b 100644 --- a/examples/gravity/style.css +++ b/examples/gravity/style.css @@ -6,12 +6,6 @@ body { box-sizing: border-box; margin: 0; padding: 1rem; - background: black; - color: rgb(200, 200, 200); -} - -.stats-block { - color: black; } #canvas { diff --git a/examples/particles/style.css b/examples/particles/style.css index d062f90..e9ad1d6 100644 --- a/examples/particles/style.css +++ b/examples/particles/style.css @@ -9,6 +9,11 @@ body { background: radial-gradient(circle at 10% 20%, #bc8fab 0%, #404972 80%) !important; } +.stats-block { + color: #fff !important; + text-shadow: 0 0 2px black, 0 0 2px black, 0 0 2px black, 0 0 2px black; +} + #canvas { width: 100%; height: 100%; diff --git a/examples/snow/index.html b/examples/snow/index.html index d0fb594..148b791 100644 --- a/examples/snow/index.html +++ b/examples/snow/index.html @@ -2,8 +2,10 @@ - + physics.js: Snow Demo + diff --git a/examples/snow/style.css b/examples/snow/style.css index 401c9b1..879747c 100644 --- a/examples/snow/style.css +++ b/examples/snow/style.css @@ -13,12 +13,17 @@ html, body { body { box-sizing: border-box; - padding: 0; - margin: 0; + padding: 0 !important; + margin: 0 !important; user-select: none; -webkit-user-select: none; } +.stats-block { + color: black; + text-shadow: 0 0 2px white, 0 0 2px white, 0 0 2px white, 0 0 2px white; +} + .bg-gradient { background: radial-gradient(circle at var(--sun-position-x) var(--sun-position-y), var(--bg-color-1) 3%, var(--bg-color-2) 3%, var(--bg-color-3) 80%); }