MCPcopy Create free account
hub / github.com/dailydotdev/apps / slide

Function slide

packages/shared/src/components/shell/shellMove.ts:132–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130
131 const travel = `${pageDuration}ms var(--shell-ease-travel)`;
132 const slide = () => {
133 if (move === ShellMove.Switch) {
134 Object.assign(leaving.style, {
135 transition: `opacity ${pageDuration / 2}ms ease-out`,
136 opacity: '0',
137 });
138 ending = window.setTimeout(cleanup, pageDuration / 2);
139 return;
140 }
141 arriving = makeGhost(pageFlowRoot());
142 document.body.appendChild(arriving);
143 leaving.classList.add('shell-ghost-over');
144 Object.assign(leaving.style, {
145 transition: 'none',
146 willChange: 'transform',
147 transform: 'translateX(0px)',
148 });
149 Object.assign(arriving.style, {
150 transition: 'none',
151 willChange: 'transform, filter',
152 transform: `translateX(${underShift})`,
153 filter: underShade,
154 });
155 leaving.getBoundingClientRect();
156 Object.assign(leaving.style, {
157 transition: `transform ${travel}`,
158 transform: 'translateX(100vw)',
159 });
160 Object.assign(arriving.style, {
161 transition: `transform ${travel}, filter ${travel}`,
162 transform: 'translateX(0px)',
163 filter: 'none',
164 });
165 ending = window.setTimeout(cleanup, pageDuration);
166 };
167
168 // The route completes before the page has drawn itself and before a
169 // return has landed its scroll; a few frames under the still copy cover

Callers 1

tickFunction · 0.85

Calls 2

pageFlowRootFunction · 0.90
makeGhostFunction · 0.85

Tested by

no test coverage detected