Giter Site home page Giter Site logo

magixjs's Issues

Link to docs on website.

Just wanted to make sure you had links to the documentation on the website!

I noticed it's in the bottom right corner. But I think it should be more apparent so I can learn how to use this tool!

Cool project!

onTap event doesn't work with onLongPress

I have a view that when it's tapped, it does something, but when it's long-pressed, it enables dragging. The tap event isn't working with the drag constraints. Nothing happens when tapped under these conditions:

# Imports
Font 'Roboto', '500,400,300'

# Starting Vars & Functions
lights = false

lightLevel = 0

longPress = false

screen =
	height: App.height
	width: App.height*(17/30)

if App.height*(17/30)-1 > App.width
	screen =
		height: App.width*(30/17)
		width: App.width

globalConvertX = (x) ->
	return x*(screen.height/300)

globalConvertY = (x) ->
		return x*(screen.width/170)

# Create page
App.page = new Page
	backgroundColor: '#0F0F3B'

# Object Background View
background = new View
	width: globalConvertY(120)
	height: globalConvertX(250)
	backgroundColor: white
	borderRadius: globalConvertX(5)
	shadowY: globalConvertY(3)
	shadowBlur: globalConvertX(6)
	shadowColor: 'rgba(0,0,0,0.4)'

background.center()
background.clip = yes

# Slider View
slider = new View
	width: globalConvertY(140)
	height: globalConvertX(33)
	backgroundColor: '#40BFC9'
	borderRadius: globalConvertX(4)
	shadowY: globalConvertY(3)
	shadowBlur: globalConvertX(6)
	shadowColor: 'rgba(0,0,0,0.4)'
	transition:
		duration: 0.2
		curve: 'cubic-out'

slider.centerX()
slider.clip = yes
slider.y = globalConvertY(222)
slider.draggable.enabled = no
slider.draggable.horizontal = no
slider.draggable.vertical = yes
slider.draggable.momentumOptions =
	friction: 15
slider.draggable.overdragScale = 0.1
slider.draggable.constraints =
	y: (App.height - (globalConvertX(250) - globalConvertY(40)))/2
	height: globalConvertX(250) - globalConvertY(40)
	width: App.widths
slider.draggable.bounceOptions =
	friction: 25
	tension: 300
slider.draggable.directionLock = yes
slider.draggable.directionLockThreshold =
   y: 0
	 x: 1000


# Event Listening
background.onTap (event) ->
	if lights == true
		lights = false
		lightLevel = 100
	else
		lights = true
		lightLevel = 0
	slider.animate
		y: globalConvertY((lightLevel*1.77)+45)
		time: 0.2
		curve: 'spring(300, 25)'

slider.onLongPress (event) ->
	slider.draggable.enabled = yes
	slider.animate
		shadowY: globalConvertY(6)
		shadowBlur: globalConvertX(12)
		shadowColor: 'rgba(0,0,0,0.5)'
		time: 0.15
		curve: 'cubic-out'

slider.onLongPressEnd (event) ->
	slider.draggable.enabled = no
	slider.animate
		shadowY: globalConvertY(3)
		shadowBlur: globalConvertX(6)
		shadowColor: 'rgba(0,0,0,0.4)'
		time: 0.15
		curve: 'cubic-out'

slider.onTap (event) ->
	if lights == true
		lights = false
		lightLevel = 100
	else
		lights = true
		lightLevel = 0
	slider.animate
		y: globalConvertY((lightLevel*1.77)+45)
		time: 0.2
		curve: 'spring(300, 25)'

If you remove the drag constraints, it works just fine, but I need the constraints. What's not working?

Tutorials

Love the documentation but 1 or 2 tutorials would make it even better!

Love this project and I'm looking forward to using this!

Keep up the good work ๐Ÿ”ฅ

Why not LiveScript?

LiveScript is a CoffeeScript dialect and it has more functional syntax than CoffeeScript.

responsive does NOT work

Tried this

myText = new Text
text: 'Hello'
fontSize: 64
color: black

Below Phone, myText
fontSize: 32
color: 'red'

dis not work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.