release: bump version to 0.46.0
This commit is contained in:
@@ -44,6 +44,87 @@
|
||||
|
||||
document.documentElement.style.setProperty("--hud-scale", clampedScale.toFixed(3));
|
||||
})();
|
||||
|
||||
(function applyInitialToolbarLayout() {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
var toolbarBaseWidth = 620;
|
||||
var toolbarMinScale = 0.68;
|
||||
var orbSizeBase = 46;
|
||||
var hubSizeBase = 58;
|
||||
var orbGapBase = 12;
|
||||
var archSpanBase = 232;
|
||||
var archRiseBase = 40;
|
||||
var sidePaddingBase = 12;
|
||||
var bottomClearanceBase = 34;
|
||||
var extraHeightBase = 34;
|
||||
var visibleOrbCount = 8;
|
||||
var toolbarWidth = Math.min(toolbarBaseWidth, Math.max(0, width - 40));
|
||||
var viewportScale = Math.min(width / 1920, height / 1080);
|
||||
var toolbarScale = Math.max(
|
||||
toolbarMinScale,
|
||||
Math.min(1, Math.min(toolbarWidth / toolbarBaseWidth, viewportScale)),
|
||||
);
|
||||
var orbSize = orbSizeBase * toolbarScale;
|
||||
var desiredGap = orbGapBase * toolbarScale;
|
||||
var span = archSpanBase * toolbarScale;
|
||||
var rise = archRiseBase * toolbarScale;
|
||||
var minSpanForSpacing =
|
||||
visibleOrbCount > 1
|
||||
? (visibleOrbCount - 1) * (orbSize + desiredGap)
|
||||
: orbSize;
|
||||
var maxSpanByWidth =
|
||||
toolbarWidth - orbSize - sidePaddingBase * 2 * toolbarScale;
|
||||
|
||||
if (minSpanForSpacing > maxSpanByWidth) {
|
||||
toolbarScale = Math.max(
|
||||
toolbarMinScale,
|
||||
Math.min(toolbarScale, maxSpanByWidth / minSpanForSpacing),
|
||||
);
|
||||
orbSize = orbSizeBase * toolbarScale;
|
||||
desiredGap = orbGapBase * toolbarScale;
|
||||
span = archSpanBase * toolbarScale;
|
||||
rise = archRiseBase * toolbarScale;
|
||||
minSpanForSpacing =
|
||||
visibleOrbCount > 1
|
||||
? (visibleOrbCount - 1) * (orbSize + desiredGap)
|
||||
: orbSize;
|
||||
maxSpanByWidth =
|
||||
toolbarWidth - orbSize - sidePaddingBase * 2 * toolbarScale;
|
||||
}
|
||||
|
||||
span = Math.max(minSpanForSpacing, Math.min(maxSpanByWidth, span));
|
||||
rise = Math.min(rise, span * 0.32);
|
||||
|
||||
var hubSize = hubSizeBase * toolbarScale;
|
||||
var maxVerticalReach = rise + orbSize * 0.5;
|
||||
var toolbarHeight =
|
||||
maxVerticalReach +
|
||||
hubSize +
|
||||
bottomClearanceBase * toolbarScale +
|
||||
extraHeightBase * toolbarScale;
|
||||
var rootStyle = document.documentElement.style;
|
||||
var roundedOrbSize = Math.round(orbSize);
|
||||
var roundedHubSize = Math.round(hubSize);
|
||||
|
||||
rootStyle.setProperty("--initial-toolbar-scale", toolbarScale.toFixed(3));
|
||||
rootStyle.setProperty("--initial-toolbar-orb-size", roundedOrbSize + "px");
|
||||
rootStyle.setProperty("--initial-toolbar-hub-size", roundedHubSize + "px");
|
||||
rootStyle.setProperty("--initial-toolbar-height", Math.ceil(toolbarHeight) + "px");
|
||||
rootStyle.setProperty(
|
||||
"--initial-toolbar-arc-width",
|
||||
Math.ceil(span + orbSize + sidePaddingBase * 2 * toolbarScale) + "px",
|
||||
);
|
||||
rootStyle.setProperty(
|
||||
"--initial-toolbar-arc-height",
|
||||
Math.ceil(rise + orbSize * 0.95) + "px",
|
||||
);
|
||||
rootStyle.setProperty("--initial-toolbar-inner-arc-width", Math.ceil(span * 0.72) + "px");
|
||||
rootStyle.setProperty(
|
||||
"--initial-toolbar-inner-arc-height",
|
||||
Math.ceil(hubSize * 0.8 + desiredGap * 0.5) + "px",
|
||||
);
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="css/base.css">
|
||||
<link rel="stylesheet" href="css/hud.css">
|
||||
|
||||
Reference in New Issue
Block a user