perf(movimento): sem tempo morto, vídeos regravados e 3D sem React Three Fiber
Legenda do mergulho até Projetos cobrir a cena; transição de página sem blur e com fundo escuro; foco no conteúdo ao trocar de página; listas com marcador e dois pesos de título; vídeos da SEV e da SC Plus regravados sem quadros brancos; scrub a 12-15 fps (-30%); vitrine com uma parada de Tab e setas, contador no celular e CSS sob demanda; âncoras num módulo só (fragment-nav); FramePulse com setInterval; CSS morto removido.
This commit is contained in:
1 parent
f8545cd442
commit
6ac87824f3
68 files changed
+5735
-3300
No files matched your search
@@ -388,7 +388,7 @@ describe("HeroField: falhas voltam ao hero simples", () => {
|
||||
});
|
||||
|
||||
describe("HeroField: rolagem e visibilidade", () => {
|
||||
function place(top: number, height = 3000) {
|
||||
function place(top: number, height = 2760) {
|
||||
section().getBoundingClientRect = () =>
|
||||
({ top, height, bottom: top + height }) as DOMRect;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ describe("HeroField: rolagem e visibilidade", () => {
|
||||
jest.advanceTimersByTime(40);
|
||||
});
|
||||
|
||||
// trilho de 1400 px (3000 de hero - 2 telas de 800)
|
||||
// trilho de 1400 px (2760 de hero - 1,7 tela de 800)
|
||||
expect(Number(section().style.getPropertyValue("--hero-p"))).toBeCloseTo(
|
||||
0.5,
|
||||
);
|
||||
@@ -571,3 +571,29 @@ describe("HeroField: navegador sem matchMedia", () => {
|
||||
expect(screen.getByTestId("scene")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe("HeroField: desmontagem em pontos que faltavam", () => {
|
||||
it("path: unmounted after the geometry was prepared, before the Canvas -> the scene is never mounted", async () => {
|
||||
const view = render(<Hero />);
|
||||
mockPrepare.mockImplementationOnce(() => {
|
||||
act(() => view.unmount());
|
||||
});
|
||||
|
||||
await advance(1200);
|
||||
await finishLoading();
|
||||
|
||||
expect(mockPrepare).toHaveBeenCalledTimes(1);
|
||||
expect(mockScenes).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("path: no dive on this screen (the dive query does not match) -> unmounting is quiet and the hero stays plain", async () => {
|
||||
mockMedia([]);
|
||||
const view = render(<Hero />);
|
||||
await finishLoading();
|
||||
const hero = section();
|
||||
|
||||
expect(() => view.unmount()).not.toThrow();
|
||||
|
||||
expect(hero).not.toHaveAttribute("data-dive");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user