   o
 
 document.addEventListener 'DOMContentLoaded', ->
-  logos = document.getElementsByClassName 'logo'
-  hexaLogo1 = new HexaFlip logos[0], makeObj(text1), logoSettings
-  hexaLogo2 = new HexaFlip logos[1], makeObj(text2), logoSettings
+  logos     = document.getElementsByClassName 'logo'
+  textDemos = (new HexaFlip logos[n], makeObj(demoText[n]), logoSettings for n in [0..1])
   hexaPhoto = new HexaFlip document.getElementById('photo-demo'),
     {photos: ("./demo/images/#{ i }.jpg" for i in [1..18])},
     size: 400

text1 = 'HEXA'.split ''
text2 = 'FLIP'.split ''
logoSettings =
    size: 120,
    margin: 8,
    fontSize: 82,
    perspective: 450

makeObj = (a) ->

  hexaTime = new HexaFlip document.getElementById('time-demo'), null, size: 150, fontSize: 100

  setTimeout ->
    textDemos[n].setValue getSeq demoText[n], true for n in [0..1]
    null
  , 0

  setTimeout ->
    textDemos[n].setValue getSeq demoText[n] for n in [0..1]
    null
  , 1000

  setTimeout ->
      setInterval ->
          textDemos[n].setValue getSeq demoText[n], false, true for n in [0..1]
          null
      , 3000
  , 5000


  setTimeout ->
    now    = new Date
    hour   = now.getHours()
    minute = now.getMinutes().toString()

    if hour > 12
      hour     = (hour - 12).toString()
      meridian = 'pm'
    else
      meridian = 'am'
