Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TOC on Desktop & Mobile #1129

Merged
merged 27 commits into from
Nov 29, 2024

Conversation

ItzNotABug
Copy link
Member

What does this PR do?

As per the discussions, TOC should not show on desktops. Also fixes broken on mobile.

Test Plan

Manual.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

Comment on lines +17 to +39
function slideFade(
node: HTMLElement,
{
delay = 0,
duration = 400,
easing = cubicOut
}: { delay?: number; duration?: number; easing?: (t: number) => number } = {}
) {
const initialHeight = node.offsetHeight;

return {
delay,
duration,
easing,
css: (t: number) => {
return `
opacity: ${t};
height: ${t * initialHeight}px;
overflow: hidden;
`;
}
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also do this animation with CSS? I think that would better fit the direction we're moving in. Wdyt @thejessewinton?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we probably can (due to t * initialHeight, but correct me if I am wrong), but I think I've seen a similar use-case somewhere around the repo. Lmk what we decide.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/markdoc/layouts/Policy.svelte Outdated Show resolved Hide resolved
src/routes/assets/+page.svelte Outdated Show resolved Hide resolved
@ernstmul ernstmul merged commit 3cb5d95 into appwrite:main Nov 29, 2024
1 check passed
@ItzNotABug ItzNotABug deleted the fix-toc-showing-on-desktop branch November 29, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants