Skip to content

Commit 3fd52a5

Browse files
committed
ani fix
1 parent 97996bc commit 3fd52a5

2 files changed

Lines changed: 54 additions & 31 deletions

File tree

src/components/home-next/sections/DeploymentSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const DEPLOYMENT_CARDS: DeploymentCardItem[] = [
3636
},
3737
cta: {
3838
label: 'Deploy Now!',
39-
href: '/docs/install/deploy-manually/integrated-storage-compute-deploy-manually',
39+
href: '/docs-next/dev/install/intro',
4040
},
4141
},
4242
{
@@ -53,7 +53,7 @@ const DEPLOYMENT_CARDS: DeploymentCardItem[] = [
5353
},
5454
cta: {
5555
label: 'Deploy Now!',
56-
href: '/docs/compute-storage-decoupled/overview',
56+
href: '/docs-next/dev/install/intro',
5757
},
5858
},
5959
];

static/animations/what-is-apache-doris-intro.html

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
font-feature-settings: "cv11", "ss01", "tnum";
3838
}
3939

40-
/* ── Stage 自适应缩放 ─────────────────────────── */
40+
/* ── Stage responsive scaling ─────────────────────────── */
4141
.stage-wrap {
4242
position: fixed; left: 0; right: 0; top: 0; bottom: 0;
4343
display: flex; align-items: center; justify-content: center;
@@ -77,7 +77,7 @@
7777
z-index: 0;
7878
}
7979

80-
/* ── Scene 通用 ─────────────────────────── */
80+
/* ── Scene common ─────────────────────────── */
8181
.scene {
8282
position: absolute; inset: 0;
8383
opacity: 0;
@@ -214,6 +214,7 @@
214214
display: flex;
215215
align-items: baseline;
216216
gap: 4px;
217+
white-space: nowrap;
217218
}
218219
.metric-value .unit {
219220
font-size: 28px;
@@ -329,9 +330,7 @@
329330
background: var(--doris-accent-soft);
330331
padding: 4px 10px;
331332
border-radius: 999px;
332-
opacity: 0;
333333
}
334-
.pillar-tag.show { opacity: 1; transition: opacity 0.4s; }
335334

336335
/* ── Scene 4 · Architecture ─────────────────────────── */
337336
.arch {
@@ -750,7 +749,7 @@ <h1 class="hero-mark" id="heroMark">
750749
<div class="hero-tagline" id="heroTagline">
751750
<span class="word">Fast</span><span class="dot"></span><span class="word">Simple</span><span class="dot"></span><span class="word">Unified</span>
752751
</div>
753-
<div class="hero-sub" id="heroSub">An MPP-based high-performance real-time analytical database</div>
752+
<div class="hero-sub" id="heroSub">Lightning Fast Analytics and Search Database</div>
754753
</div>
755754

756755
<!-- ─── Scene 2 · Metrics ─────────────────────────── -->
@@ -961,7 +960,7 @@ <h2 class="title-en">One SQL · Three Search Modes</h2>
961960
<h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h2>
962961
</div>
963962
<div class="closer-foot-text">
964-
<span class="accent">doris.apache.org</span> · Join the open community
963+
<span class="accent">doris.apache.org</span> · Join the open community
965964
</div>
966965
</div>
967966

@@ -995,7 +994,7 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
995994
(function() {
996995
'use strict';
997996

998-
// ── Stage 自适应缩放 ────────────────────────────
997+
// ── Stage responsive scaling ────────────────────────────
999998
const STAGE_W = 1920, STAGE_H = 1080;
1000999
const isEmbedded = new URLSearchParams(window.location.search).get('embed') === '1';
10011000
if (isEmbedded) document.documentElement.classList.add('embed');
@@ -1009,8 +1008,8 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
10091008
window.addEventListener('resize', resize);
10101009
resize();
10111010

1012-
// ── Scene 时间轴 ────────────────────────────
1013-
// 6 scenes / 30s, FADE = 1s in + 1s out = 2s 过渡(每场切换固定 2 秒)
1011+
// ── Scene timeline ────────────────────────────
1012+
// 6 scenes / 30s, FADE = 1s in + 1s out = 2s transition (fixed 2s per scene change)
10141013
const DURATION = 30;
10151014
const SCENES = [
10161015
{ id: 's1', start: 0.0, end: 4.5, num: '01', name: 'INTRO' },
@@ -1032,7 +1031,7 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
10321031
return lerp(v0, v1, ease((t - a) / (b - a)));
10331032
};
10341033

1035-
// ── 元素缓存 ────────────────────────────
1034+
// ── Element cache ────────────────────────────
10361035
const sceneTagEl = document.getElementById('sceneTag');
10371036
const ctrlFill = document.getElementById('ctrlFill');
10381037
const ctrlKnob = document.getElementById('ctrlKnob');
@@ -1104,7 +1103,7 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
11041103
return Math.round(v).toString();
11051104
}
11061105

1107-
// ── 场景渲染 ────────────────────────────
1106+
// ── Scene render ────────────────────────────
11081107
function render(t) {
11091108
SCENES.forEach(s => {
11101109
const o = sceneOpacity(t, s);
@@ -1177,28 +1176,14 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
11771176
pillarEls.forEach((p, i) => {
11781177
const y = interp(local - i * 0.15, [0.3, 1.2], [40, 0], expoOut);
11791178
const o = interp(local - i * 0.15, [0.3, 1.1], [0, 1], expoOut);
1180-
let baseTransform = `translateY(${y}px)`;
1181-
if (p.classList.contains('focus')) baseTransform = `scale(1.04) ` + baseTransform;
1182-
p.style.transform = baseTransform;
1179+
p.style.transform = `translateY(${y}px)`;
11831180
p.style.opacity = o;
11841181

11851182
const items = p.querySelectorAll('.pillar-list li');
11861183
items.forEach((li, j) => {
11871184
if (local - i * 0.15 > 1.0 + j * 0.08) li.classList.add('show');
11881185
});
11891186
});
1190-
1191-
// 焦点切换:scene 3 长 7s,3.2s 后聚焦 AI 列
1192-
if (local >= 3.2) {
1193-
pillarEls[0].classList.add('dim');
1194-
pillarEls[1].classList.add('dim');
1195-
pillarEls[2].classList.add('focus');
1196-
pillarEls[2].querySelector('.pillar-tag').classList.add('show');
1197-
} else {
1198-
pillarEls[0].classList.remove('dim');
1199-
pillarEls[1].classList.remove('dim');
1200-
pillarEls[2].classList.remove('focus');
1201-
}
12021187
}
12031188

12041189
// ─── Scene 4 · Architecture (start = 17.0)
@@ -1257,7 +1242,7 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
12571242
if (lastTick === null) {
12581243
lastTick = now;
12591244
window.__ready = true;
1260-
// 关键修复:首帧渲染 current `time`,而不是 0。否则 __seek 后下一帧会被 reset 回 0
1245+
// Critical fix: render current `time` on the first frame, not 0. Otherwise the next frame after __seek gets reset back to 0.
12611246
render(time);
12621247
requestAnimationFrame(tick);
12631248
return;
@@ -1302,7 +1287,7 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
13021287
setPlayingState(true);
13031288
});
13041289

1305-
// 进度条点击/拖动 seek
1290+
// Progress bar click/drag seek
13061291
let dragging = false;
13071292
function seekFromEvent(e) {
13081293
const rect = ctrlProgress.getBoundingClientRect();
@@ -1330,23 +1315,61 @@ <h2 class="closer-mark"><span>Apache</span> <span class="accent">Doris</span></h
13301315
if (dragging) { dragging = false; ctrlProgress.classList.remove('dragging'); }
13311316
});
13321317

1333-
// 键盘快捷键
1318+
// Keyboard shortcuts
13341319
document.addEventListener('keydown', (e) => {
13351320
if (e.code === 'Space') { e.preventDefault(); setPlayingState(!playing); }
13361321
else if (e.code === 'ArrowLeft') { window.__seek(time - 1); }
13371322
else if (e.code === 'ArrowRight') { window.__seek(time + 1); }
13381323
else if (e.code === 'KeyR') { window.__seek(0); setPlayingState(true); }
13391324
});
13401325

1326+
// ── Auto-fit metric values so they never wrap or clip ────────────
1327+
function fitMetricValues() {
1328+
const BASE_VALUE = 72;
1329+
const BASE_UNIT = 28;
1330+
document.querySelectorAll('#metrics .metric-card').forEach(card => {
1331+
const el = card.querySelector('.metric-value');
1332+
if (!el) return;
1333+
const numEl = el.querySelector('.num[data-target]');
1334+
let savedText = null;
1335+
if (numEl) {
1336+
savedText = numEl.textContent;
1337+
const target = parseFloat(numEl.dataset.target);
1338+
numEl.textContent = formatNum(target, target);
1339+
}
1340+
1341+
el.style.fontSize = BASE_VALUE + 'px';
1342+
const unit = el.querySelector('.unit');
1343+
if (unit) unit.style.fontSize = BASE_UNIT + 'px';
1344+
1345+
const cs = getComputedStyle(card);
1346+
const padL = parseFloat(cs.paddingLeft);
1347+
const padR = parseFloat(cs.paddingRight);
1348+
const available = card.clientWidth - padL - padR;
1349+
1350+
let cur = BASE_VALUE;
1351+
let guard = 24;
1352+
while (el.scrollWidth > available && cur > 32 && guard-- > 0) {
1353+
cur -= 2;
1354+
el.style.fontSize = cur + 'px';
1355+
if (unit) unit.style.fontSize = (cur * BASE_UNIT / BASE_VALUE) + 'px';
1356+
}
1357+
1358+
if (numEl && savedText !== null) numEl.textContent = savedText;
1359+
});
1360+
}
1361+
13411362
// ── Boot ────────────
13421363
if (document.fonts && document.fonts.ready) {
13431364
document.fonts.ready.then(() => {
1365+
fitMetricValues();
13441366
render(0);
13451367
setPlayingState(true);
13461368
requestAnimationFrame(tick);
13471369
});
13481370
} else {
13491371
setTimeout(() => {
1372+
fitMetricValues();
13501373
render(0);
13511374
setPlayingState(true);
13521375
requestAnimationFrame(tick);

0 commit comments

Comments
 (0)