Difference between revisions of "Team:SDU-Denmark/Tour11"

Line 19: Line 19:
 
   </div>
 
   </div>
 
</div><!-- /card -->
 
</div><!-- /card -->
 +
 +
<script>
 +
(function() {
 +
 +
  // cache vars
 +
  var cards = document.querySelectorAll(".card.effect__random");
 +
  var timeMin = 1;
 +
  var timeMax = 3;
 +
  var timeouts = [];
 +
 +
  // loop through cards
 +
  for ( var i = 0, len = cards.length; i < len; i++ ) {
 +
    var card = cards[i];
 +
    var cardID = card.getAttribute("data-id");
 +
    var id = "timeoutID" + cardID;
 +
    var time = randomNum( timeMin, timeMax ) * 1000;
 +
    cardsTimeout( id, time, card );
 +
  }
 +
 +
  // timeout listener
 +
  function cardsTimeout( id, time, card ) {
 +
    if (id in timeouts) {
 +
      clearTimeout(timeouts[id]);
 +
    }
 +
    timeouts[id] = setTimeout( function() {
 +
      var c = card.classList;
 +
      var newTime = randomNum( timeMin, timeMax ) * 1000;
 +
      c.contains("flipped") === true ? c.remove("flipped") : c.add("flipped");
 +
      cardsTimeout( id, newTime, card );
 +
    }, time );
 +
  }
 +
 +
  // random number generator given min and max
 +
  function randomNum( min, max ) {
 +
    return Math.random() * (max - min) + min;
 +
  }
 +
 +
})();
 +
</script>
  
 
</html>
 
</html>
  
 
{{:Team:SDU-Denmark/core/footer}}
 
{{:Team:SDU-Denmark/core/footer}}

Revision as of 13:42, 13 July 2015

The team

We are the SDU-Denmark 2015 iGEM Team!
Our team consists of nine members representing four different faculties; the faculty of science, the faculty of health sciences, the faculty of humanities, and the faculty of engineering.
Coming from different backgrounds and with different competencies, we sat out to find a project that could units our different set of skills and make them work synergistically.

front
back