GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mojs/spec/mix.coffee at master · softDen/mojs

Expand file tree

/

mix.coffee

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
28 lines (26 loc) · 1.08 KB
/

mix.coffee

Copy path

File metadata and controls

28 lines (26 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mix = mojs.easing.mix
describe 'mix ->', ->
it 'should return new function', ->
res = mix({to: .5, value: 4})
expect(typeof res).toBe 'function'
describe 'returned function ->', ->
it 'should return value on the progress', ->
res = mix({to: .5, value: 4}, {to: .7, value: 3})
expect(res(.4)).toBe 4
expect(res(.6)).toBe 3
it 'should evaluate function if passed', ->
res = mix({to: .5, value: (p)-> return 2*p }, {to: .7, value: 3})
expect(res(.4)).toBe 2*.4
expect(res(.6)).toBe 3
it 'should return 1 if not defined', ->
res = mix({to: .5, value: (p)-> return 2*p })
expect(res(.6)).toBe 1
it 'should parse easing', ->
res = mix({to: .5, value: 'cubic.in' }, {to: .7, value: 'cubic.out' })
expect(res(.3)).toBe mojs.easing.cubic.in .3
it 'should work with one value', ->
res = mix({to: .5, value: 'cubic.in' })
expect(res(.3)).toBe mojs.easing.cubic.in .3
it 'should work with array value', ->
res = mix({to: .5, value: [0.42, 0, 1, 1] })
expect(res(.3)).toBe mojs.easing.ease.in .3
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.