Skip to content

Commit 53a699a

Browse files
committed
feat: make bundle and modal scalable via font scaling approach
1 parent 91f59bd commit 53a699a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bundle/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ function BundleComponent({
5050

5151
const normalizedScale = Math.max(Math.min(fontScale, 2.0), 1.0);
5252
const scalingStatement = `
53-
document.body.style.zoom = ${normalizedScale};
53+
document.documentElement.style.fontSize = ${normalizedScale} * 16 + 'px';
5454
const zoomedIn = 'narrow';
55-
if(document.body.offsetWidth <= 300) {
55+
if(${normalizedScale} > 1.4) {
5656
document.body.classList.add(zoomedIn);
5757
} else {
5858
document.body.classList.remove(zoomedIn);
@@ -143,7 +143,7 @@ function BundleComponent({
143143
message.startsWith('bundleResized') &&
144144
(newBundleSize = message.split(': ')[1])
145145
) {
146-
const newHeight = parseInt(newBundleSize, 10) * normalizedScale;
146+
const newHeight = parseInt(newBundleSize, 10);
147147
setProofPointsHeight(newHeight);
148148
if (onResized) onResized(newHeight);
149149
}

0 commit comments

Comments
 (0)