Skip to content

Commit 18abaa1

Browse files
Refine mobile mosaic and code card
1 parent 6b125b4 commit 18abaa1

1 file changed

Lines changed: 35 additions & 24 deletions

File tree

docs/index.html

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@
19291929

19301930
@media (min-width: 760px) and (max-width: 980px) and (orientation: portrait) {
19311931
.site {
1932-
min-height: 118svh;
1932+
min-height: 108svh;
19331933
padding: 0;
19341934
}
19351935

@@ -2053,17 +2053,29 @@
20532053
}
20542054

20552055
.visual {
2056-
min-height: 360px;
2056+
min-height: 390px;
20572057
margin-top: 0;
20582058
align-items: start;
2059+
justify-items: start;
20592060
}
20602061

20612062
.code-card {
2062-
width: min(100%, 560px);
2063+
width: min(100%, 450px);
20632064
margin-left: 0;
20642065
margin-right: auto;
20652066
}
20662067

2068+
.card-bar {
2069+
height: 50px;
2070+
padding: 0 17px;
2071+
}
2072+
2073+
pre {
2074+
font-size: 12.7px;
2075+
line-height: 1.78;
2076+
padding: 18px 17px 14px 14px;
2077+
}
2078+
20672079
.agent-card {
20682080
width: 154px;
20692081
right: 96px;
@@ -2865,40 +2877,39 @@ <h2 data-i18n="resourcesTitle">Download, source, docs.</h2>
28652877
if (resourcesTop < viewportProbe) zone = "resources";
28662878
else if (featuresTop < viewportProbe) zone = "features";
28672879

2868-
let base;
2869-
let radiusX;
2870-
let radiusY;
2880+
const isPortraitMobile = window.matchMedia("(max-width: 980px) and (orientation: portrait)").matches;
2881+
let centerX = width * 0.5;
2882+
let centerY = height * 0.5;
2883+
let radiusX = Math.min(width * (isPortraitMobile ? 0.36 : 0.32), isPortraitMobile ? 220 : 280);
2884+
let radiusY = Math.min(height * (isPortraitMobile ? 0.28 : 0.24), isPortraitMobile ? 210 : 240);
28712885
let phase = 0;
2872-
let strength = 0.74;
2886+
let strength = 0.76;
28732887

28742888
if (zone === "resources") {
2875-
base = elementViewportCenter(".resource-links", { x: width * 0.62, y: height * 0.58 });
28762889
const p = sectionProgress("#resources");
2877-
radiusX = Math.min(width * 0.2, 86);
2878-
radiusY = Math.min(height * 0.16, 78);
2879-
phase = p * 2.4;
2880-
strength = 0.7;
2890+
centerX = width * (isPortraitMobile ? 0.52 : 0.58);
2891+
centerY = height * (isPortraitMobile ? 0.48 : 0.54);
2892+
phase = p * 4.1 + 1.4;
2893+
strength = 0.72;
28812894
} else if (zone === "features") {
2882-
base = elementViewportCenter(".feature-row", { x: width * 0.52, y: height * 0.58 });
28832895
const p = sectionProgress("#features");
2884-
radiusX = Math.min(width * 0.24, 96);
2885-
radiusY = Math.min(height * 0.18, 90);
2886-
phase = p * 3.2 + 0.7;
2887-
strength = 0.76;
2896+
centerX = width * (isPortraitMobile ? 0.48 : 0.54);
2897+
centerY = height * (isPortraitMobile ? 0.46 : 0.52);
2898+
phase = p * 4.4 + 0.72;
2899+
strength = 0.78;
28882900
} else {
2889-
base = elementViewportCenter(".code-card", { x: width * 0.55, y: height * 0.5 });
28902901
const p = sectionProgress("#top");
2891-
radiusX = Math.min(width * 0.22, 110);
2892-
radiusY = Math.min(height * 0.15, 84);
2893-
phase = p * 2.2;
2894-
strength = 0.78;
2902+
centerX = width * (isPortraitMobile ? 0.52 : 0.56);
2903+
centerY = height * (isPortraitMobile ? 0.44 : 0.5);
2904+
phase = p * 3.8;
2905+
strength = 0.8;
28952906
}
28962907

28972908
return {
28982909
zone,
28992910
strength,
2900-
x: base.x + Math.cos(time * 0.84 + phase) * radiusX + Math.sin(time * 1.64 + phase) * radiusX * 0.28,
2901-
y: base.y + Math.sin(time * 0.92 + phase) * radiusY + Math.cos(time * 1.36 + phase) * radiusY * 0.24
2911+
x: centerX + Math.cos(time * 0.58 + phase) * radiusX + Math.sin(time * 1.14 + phase) * radiusX * 0.34,
2912+
y: centerY + Math.sin(time * 0.64 + phase) * radiusY + Math.cos(time * 1.03 + phase) * radiusY * 0.28
29022913
};
29032914
}
29042915

0 commit comments

Comments
 (0)