example :: AFrame
example = scene $ do
  c <- colorSelector "color" "#123456"
  h <- numberSelector "height" 1 $ return (0,5)
  r <- numberSelector "rot" 0 $ return (0,360)
--  xyz <- vec3Selector "position" (-1,0.5,1) (-5,5)
  mt <- numberSelector "metalness" 0.0 $ return (0,1)
  op <- numberSelector "opacity"   1.0 $ return (0,1)
  ro <- numberSelector "roughness" 0.5 $ return (0,1)
  sphere $ do
    position (0,1.25,-1)
    radius   1.25
    color    "#EF2D5E"
--    metalness mt
--    opacity	op
--    roughness ro
  box $ do
    attribute "id" ("box" :: Text)
    position (-1,0.5,1) -- xyz 
    rotation (r,45,0)
    width    1
    height   h
    scale   ?(1,1,1)
    color    c
    attribute "shader" ("noise"::Text)
--    component "segments" (1::Int)

  cylinder $ do
    position (1,0.75+sin(now / 1000),1) 
    radius   0.5
    height   1.5
    color    "#FFC65D"
    attribute "shader" ("noise"::Text)
  
  plane $ do
    rotation (-90,0,0)
    width 4
    height 4
    color "#7BC8A4"
    attribute "shader" ("noise"::Text)
    component "segments" (10::Int)

  sky $ color "#ECECEC"
--  entity $ template $ src "#x"

{-
 >>> start
 >>> s example
 >>> u (elementById "animation-1"  . attributeByName "dur) "300"
 >>> g (^. singular (elementById "animation-1"  . attributeByName "dur"))
 >>> u (set (nthOfType "a-box" 1 . attributeByName "position" . triple . _3) (-5))
-}
example :: AFrame
example = scene $ do
  c <- colorSelector "color" "#123456"
  h <- numberSelector "height" 1 $ return (0,5)
  r <- numberSelector "rot" 0 $ return (0,360)
--  xyz <- vec3Selector "position" (-1,0.5,1) (-5,5)
  mt <- numberSelector "metalness" 0.0 $ return (0,1)
  op <- numberSelector "opacity"   1.0 $ return (0,1)
  ro <- numberSelector "roughness" 0.5 $ return (0,1)
  sphere $ do
    position (0,1.25,-1)
    radius   1.25
    color    "#EF2D5E"
--    metalness mt
--    opacity	op
--    roughness ro
  box $ do
    attribute "id" ("box" :: Text)
    position (-1,0.5,1) -- xyz 
    rotation (r,45,0)
    width    1
    height   h
    scale   ?(1,1,1)
    color    c
    attribute "shader" ("noise"::Text)
--    component "segments" (1::Int)

  cylinder $ do
    position (1,0.75+sin(now / 1000),1) 
    radius   0.5
    height   1.5
    color    "#FFC65D"
    attribute "shader" ("noise"::Text)
  
  plane $ do
    rotation (-90,0,0)
    width 4
    height 4
    color "#7BC8A4"
    attribute "shader" ("noise"::Text)
    component "segments" (10::Int)

  sky $ color "#ECECEC"
--  entity $ template $ src "#x"

{-
 >>> start
 >>> s example
 >>> u (elementById "animation-1"  . attributeByName "dur) "300"
 >>> g (^. singular (elementById "animation-1"  . attributeByName "dur"))
 >>> u (set (nthOfType "a-box" 1 . attributeByName "position" . triple . _3) (-5))
-}
example = scene $ do
  c <- colorSelector "color" "#123456"
  h <- numberSelector "height" 1 $ return (0,5)
  r <- numberSelector "rot" 0 $ return (0,360)
--  xyz <- vec3Selector "position" (-1,0.5,1) (-5,5)
  mt <- numberSelector "metalness" 0.0 $ return (0,1)
  op <- numberSelector "opacity"   1.0 $ return (0,1)
  ro <- numberSelector "roughness" 0.5 $ return (0,1)
  sphere $ do
    position (0,1.25,-1)
    radius   1.25
    color    "#EF2D5E"
--    metalness mt
--    opacity	op
--    roughness ro
  box $ do
    attribute "id" ("box" :: Text)
    position (-1,0.5,1) -- xyz 
    rotation (r,45,0)
    width    1
    height   h
    scale   ?(1,1,1)
    color    c
    attribute "shader" ("noise"::Text)
--    component "segments" (1::Int)

  cylinder $ do
    position (1,0.75+sin(now / 1000),1) 
    radius   0.5
    height   1.5
    color    "#FFC65D"
    attribute "shader" ("noise"::Text)
  
  plane $ do
    rotation (-90,0,0)
    width 4
    height 4
    color "#7BC8A4"
    attribute "shader" ("noise"::Text)
    component "segments" (10::Int)

  sky $ color "#ECECEC"
--  entity $ template $ src "#x"

{-
 >>> start
 >>> s example
 >>> u (elementById "animation-1"  . attributeByName "dur) "300"
 >>> g (^. singular (elementById "animation-1"  . attributeByName "dur"))
 >>> u (set (nthOfType "a-box" 1 . attributeByName "position" . triple . _3) (-5))
-}