Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import xs from 'xstream';
  2. import Cycle from '@cycle/xstream-run';
  3. import {h, makeDOMDriver} from '@cycle/dom';
  4. require('aframe');
  5.  
  6. function main(sources) {
  7. let vdom$ = xs.periodic(16).startWith(0).map(i =>
  8. h('a-scene', [
  9. h('a-sphere', {
  10. attrs: {
  11. position: `0 ${i / 100} -1`,
  12. radius: '1.25',
  13. color: '#EF2D5E'
  14. }
  15. }),
  16. h('a-box', {
  17. attrs: {
  18. position: '-1 0.5 1',
  19. rotation: '0 45 0',
  20. width: '1',
  21. height: '1',
  22. depth: '1',
  23. color: '#4CC3D9'
  24. }
  25. }),
  26. h('a-cylinder', {
  27. attrs: {
  28. position: '1 0.75 1',
  29. radius: '0.5',
  30. height: '1.5',
  31. color: '#FFC65D'
  32. }
  33. }),
  34. h('a-plane', {
  35. attrs: {
  36. rotation: '-90 0 0',
  37. width: '4',
  38. height: '4',
  39. color: '#7BC8A4'
  40. }
  41. }),
  42. h('a-sky', { attrs: {color: '#ECECEC'} })
  43. ])
  44. );
  45.  
  46. return {
  47. DOM: vdom$
  48. };
  49. }
  50.  
  51. Cycle.run(main, {
  52. DOM: makeDOMDriver('#main-container')
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement