Permalink
Browse files

Make size optional for Utils.randomImage

  • Loading branch information...
koenbok committed May 11, 2016
1 parent 6e06e20 commit decc0c00052fd225352bf3f50e3503d3bc5e8a1d
Showing with 5 additions and 3 deletions.
  1. +5 −3 framer/Utils.coffee
@@ -147,10 +147,12 @@ Utils.randomNumber = (a=0, b=1) ->
# Return a random number between a and b
Utils.mapRange Math.random(), 0, 1, a, b
Utils.randomImage = (layer, offset=50) ->
Utils.randomImage = (size, offset=50) ->
width = Utils.round(layer.width, 0, 100, 100)
height = Utils.round(layer.height, 0, 100, 100)
size ?= {width:800, height:600}
width = Utils.round(size.width, 0, 100, 100)
height = Utils.round(size.height, 0, 100, 100)
# return "https://source.unsplash.com/category/nature/#{width}x#{height}"
return "https://unsplash.it/#{width}/#{height}?image=#{layer.id + offset}"

0 comments on commit decc0c0

Please sign in to comment.