Previous approach injected ::view-transition-new animation in vt.ready, creating a timing gap where the NEW layer had no clip-path and was fully visible, making dark→light transitions invisible. Now: - Inject <style> with @keyframes + VT pseudo-element rules BEFORE calling startViewTransition, so styles are ready when pseudo-elements are created. - Force synchronous getComputedStyle() in VT callback to ensure the NEW snapshot captures final background-color, not a mid-transition value.
16 lines
398 B
TypeScript
16 lines
398 B
TypeScript
import { initPostContent } from './post-content';
|
|
import { startThemeTransition } from './theme-transition';
|
|
import './style.css';
|
|
|
|
declare global {
|
|
interface Window {
|
|
__initPostContent: (selector: string) => void;
|
|
__startThemeTransition: (x: number, y: number) => void;
|
|
}
|
|
}
|
|
|
|
window.__initPostContent = initPostContent;
|
|
window.__startThemeTransition = startThemeTransition;
|
|
|
|
export {};
|