pe = new mojs.easing.path 'M0,100 L100,0' pe = new mojs.easing.path '#js-path' circle = document.querySelector '#js-circle'
tm = new mojs.Timeline delay: 1000 duration: 2000 onUpdate:(p)-> y = pe.sample p circle.setAttribute 'cx', p100 circle.setAttribute 'cy', y100
tw = new mojs.Tween
tw.add tm tw.start()
console.log pe.sample .7
path = pe.path console.log(path.getPointAtLength(path.getTotalLength()*.7))
path = document.querySelector '#js-path' i = 25 fun = (i)-> path.getPointAtLength(50+i)
console.time '1' while(i--) fun(i) console.timeEnd '1'
console.log(path.getTotalLength())
path = document.createElementNS h.NS, 'path' circle = document.createElementNS h.NS, 'circle' svg = document.createElementNS h.NS, 'svg' pathId = 'js-path'; path.setAttribute 'id', pathId
svg.appendChild(circle); svg.appendChild(path) document.body.appendChild svg
totalLength = path.getTotalLength() point = path.getPointAtLength(totalLength*.5)
circle.setAttribute 'cx', point.x circle.setAttribute 'cy', point.y
console.log(path) console.log(point) console.log(totalLength)
burst = new mojs.Burst
x: 200, y: 200 isShowEnd: true type: 'line' stroke: 'deeppink' strokeWidth: 2:0 duration: 5000 count: 5 easing: 'M0,0 C0,0 32.1191406,0.314142863 40.1669859,0 C40.1669859,0.165327852 50.9999996,-112.569017 74.0660521,0 C80.8905119,-16.0420643 87.1001393,-19.621745 92.0689049,0 C92.0689049,1.54522552 95.3231688,-14.8615687 100,0'
document.body.addEventListener 'click', (e)-> burst.run(x: e.x, y: e.y, isResetAngles: true, childOptions: angle: {0:90})
angle = 0 setInterval -> point = mp.angToCoords(angle) mp.el.style['box-shadow'] = "#{point.x10}px #{point.y10}px 0 black" angle = (angle+1) % 360 , 10
istanbul ignore next
istanbul ignore next
istanbul ignore next
h = mojs.h