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

Add transition effect when document changes #367

Merged
merged 2 commits into from
May 16, 2023

Conversation

twinkarma
Copy link
Collaborator

Resolves #324

  • Added a 0.5s fadein transition when:
    • Annotation is submitted (and validated)
    • Annotation is rejected
    • Skipping to previous, next and current documents
Screencast.2023-05-12.15.36.52.webm

@github-actions
Copy link

Jest Coverage

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 86.66 85.45 53.33 86.66
File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 86.66 85.45 53.33 86.66
_jrpc 94.04 91.66 83.33 94.04
_ index.js 94.04 91.66 83.33 94.04 29-30,38-40
_utils 83.98 83.72 33.33 83.98
_ annotations.js 97.72 73.91 100 97.72 35-36
_ dict.js 88.88 83.33 100 88.88 3-4
_ index.js 73.6 100 14.28 73.6 9-17,28-29,43-53,64-65,76-82,93-94

this.annotationRendererTransitionEnabled = true
setTimeout(()=>{
this.annotationRendererTransitionEnabled = false
}, 500)
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to just declare an animationend/animationcancel event handler that sets this.annotationRendererTransitionEnabled = false, then we don't need to worry about the setTimeout every time? But if not it's fine as it is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems to be possible in plain javascript but not possible to just add an animationend listener in Vue. Might be worth looking into if we're planning to do more complicated things with the animation but I'd suggest we just leave it as this for now.

@twinkarma twinkarma merged commit 9502dcf into dev May 16, 2023
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.

2 participants