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

Create MoLang snippets page with MoLang Grapher integration #24

Closed
stirante opened this issue May 20, 2021 · 1 comment
Closed

Create MoLang snippets page with MoLang Grapher integration #24

stirante opened this issue May 20, 2021 · 1 comment
Assignees
Labels
JS/VUE Issues pertaining to JS or VUE
Milestone

Comments

@stirante
Copy link
Member

stirante commented May 20, 2021

Source for functions

Ideally, it should be a component, that takes in a MoLang expression and renders a graph of this expression with expression being syntax highlighted.

@stirante stirante added enhancement JS/VUE Issues pertaining to JS or VUE labels May 20, 2021
@stirante stirante added this to the v1.1 Release milestone May 20, 2021
@stirante
Copy link
Member Author

Adapted almost all easings from this site:

easeInSine: 1 - math.cos((math.clamp(q.anim_time, 0, 1) * 180) / 2)
easeOutSine: math.sin((math.clamp(q.anim_time, 0, 1) * 180) / 2)
easeInOutSine: -(math.cos(180 * math.clamp(q.anim_time, 0, 1)) - 1) / 2
easeInQuad: math.pow(math.clamp(q.anim_time, 0, 1), 2)
easeOutQuad: 1 - math.pow(1 - math.clamp(q.anim_time, 0, 1), 2)
easeInOutQuad: q.anim_time < 0.5 ? 2 * math.pow(math.clamp(q.anim_time, 0, 1), 2) : 1 - math.pow(-2 * math.clamp(q.anim_time, 0, 1) + 2, 2) / 2
easeInCubic: math.pow(math.clamp(q.anim_time, 0, 1), 3)
easeOutCubic: 1 - math.pow(1 - math.clamp(q.anim_time, 0, 1), 3)
easeInOutCubic: q.anim_time < 0.5 ? 4 * math.pow(math.clamp(q.anim_time, 0, 1), 3) : 1 - math.pow(-2 * math.clamp(q.anim_time, 0, 1) + 2, 3) / 2
easeInQuart: math.pow(math.clamp(q.anim_time, 0, 1), 4)
easeOutQuart: 1 - math.pow(1 - math.clamp(q.anim_time, 0, 1), 4)
easeInOutQuart: q.anim_time < 0.5 ? 8 * math.pow(math.clamp(q.anim_time, 0, 1), 4) : 1 - math.pow(-2 * math.clamp(q.anim_time, 0, 1) + 2, 4) / 2
easeInQuint: math.pow(math.clamp(q.anim_time, 0, 1), 5)
easeOutQuint: 1 - math.pow(1 - math.clamp(q.anim_time, 0, 1), 5)
easeInOutQuint: q.anim_time < 0.5 ? 16 * math.pow(math.clamp(q.anim_time, 0, 1), 5) : 1 - math.pow(-2 * math.clamp(q.anim_time, 0, 1) + 2, 5) / 2
easeInExpo: q.anim_time == 0 ? 0 : math.pow(2, 10 * math.clamp(q.anim_time, 0, 1) - 10)
easeOutExpo: q.anim_time == 1 ? 1 : 1 - math.pow(2, -10 * math.clamp(q.anim_time, 0, 1))
easeInOutExpo: q.anim_time == 0 ? 0 : q.anim_time == 1 ? 1 : q.anim_time < 0.5 ? math.pow(2, 20 * math.clamp(q.anim_time, 0, 1) - 10) / 2 : (2 - math.pow(2, -20 * math.clamp(q.anim_time, 0, 1) + 10)) / 2
easeInCirc: 1 - math.sqrt(1 - math.pow(math.clamp(q.anim_time, 0, 1), 2))
easeOutCirc: math.sqrt(1 - math.pow(math.clamp(q.anim_time, 0, 1) - 1, 2))
easeInOutCirc: q.anim_time < 0.5 ? (1 - math.sqrt(1 - math.pow(2 * math.clamp(q.anim_time, 0, 1), 2))) / 2 : (math.sqrt(1 - math.pow(-2 * math.clamp(q.anim_time, 0, 1) + 2, 2)) + 1) / 2
easeInBack: 2.70158 * math.pow(math.clamp(q.anim_time, 0, 1), 3) - 1.70158 * math.pow(math.clamp(q.anim_time, 0, 1), 2)
easeOutBack: 1 + 2.70158 * math.pow(math.clamp(q.anim_time, 0, 1) - 1, 3) + 1.70158 * math.pow(math.clamp(q.anim_time, 0, 1) - 1, 2)
easeInOutBack: q.anim_time < 0.5 ? (math.pow(2 * math.clamp(q.anim_time, 0, 1), 2) * ((2.5949095 + 1) * 2 * math.clamp(q.anim_time, 0, 1) - 2.5949095)) / 2 : (math.pow(2 * math.clamp(q.anim_time, 0, 1) - 2, 2) * ((2.5949095 + 1) * (math.clamp(q.anim_time, 0, 1) * 2 - 2) + 2.5949095) + 2) / 2
easeInElastic: q.anim_time == 0 ? 0 : q.anim_time == 1 ? 1 : -math.pow(2, 10 * math.clamp(q.anim_time, 0, 1) - 10) * math.sin((math.clamp(q.anim_time, 0, 1) * 10 - 10.75) * 120)
easeOutElastic: q.anim_time == 0 ? 0 : q.anim_time == 1 ? 1 : math.pow(2, -10 * math.clamp(q.anim_time, 0, 1)) * math.sin((math.clamp(q.anim_time, 0, 1) * 10 - 0.75) * 120) + 1
easeInOutElastic: q.anim_time == 0 ? 0 : q.anim_time == 1 ? 1 : q.anim_time < 0.5 ? -(math.pow(2, 20 * math.clamp(q.anim_time, 0, 1) - 10) * math.sin((20 * math.clamp(q.anim_time, 0, 1) - 11.125) * 80)) / 2 : (math.pow(2, -20 * math.clamp(q.anim_time, 0, 1) + 10) * math.sin((20 * math.clamp(q.anim_time, 0, 1) - 11.125) * 80)) / 2 + 1

I omitted bounce easings due to being too much of a pain to adapt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS/VUE Issues pertaining to JS or VUE
Projects
None yet
Development

No branches or pull requests

4 participants