Difference between revisions of "Team:UCL/Bactoman"

Line 5: Line 5:
  
 
<style type="text/javascript">
 
<style type="text/javascript">
 
+
var counter = 0, // to keep track of current slide
+
function(){
    $items = $('.diy-slideshow figure'), // a collection of all of the slides, caching for performance
+
    numItems = $items.length; // total number of slides
+
var counter = 0,
 
+
$items = document.querySelectorAll('.diy-slideshow figure'),
// this function is what cycles the slides, showing the next or previous slide and hiding all the others
+
numItems = $items.length;
 +
 
var showCurrent = function(){
 
var showCurrent = function(){
    var itemToShow = Math.abs(counter%numItems);// uses remainder (aka modulo) operator to get the actual index of the element to show  
+
var itemToShow = Math.abs(counter%numItems);
 
+
   
  $items.removeClass('show'); // remove .show from whichever element currently has it
+
[].forEach.call( $items, function(el){
  $items.eq(itemToShow).addClass('show');  
+
el.classList.remove('show');
 +
});
 +
 +
$items[itemToShow].classList.add('show');
 
};
 
};
 +
 +
document.querySelector('.next').addEventListener('click', function() {
 +
counter++;
 +
showCurrent();
 +
}, false);
 +
 +
document.querySelector('.prev').addEventListener('click', function() {
 +
counter--;
 +
showCurrent();
 +
}, false);
 +
 +
})();
 +
  
// add click events to prev & next buttons
 
$('.next').on('click', function(){
 
    counter++;
 
    showCurrent();
 
});
 
$('.prev').on('click', function(){
 
    counter--;
 
    showCurrent();
 
});
 
  
if('ontouchstart' in window){
 
  $('.diy-slideshow').swipe({
 
    swipeLeft:function() {
 
      counter++;
 
      showCurrent();
 
    },
 
    swipeRight:function() {
 
      counter--;
 
      showCurrent();
 
    }
 
  });
 
}
 
 
</script>
 
</script>
  

Revision as of 20:24, 31 October 2015

'

Bactoman is a comic aimed to introduce our project to a younger audience. Set in a dystopian future where the mentally ill are excommunicated and abandoned by the society, Nathan Navaro takes the mantle of Bactoman to challenge the broken society. Bactoman utilises synthetic biology to help people with mental disorders!

"Starlight" by ChaoticMind75.
"Snowstorm" by Beaulawrence.
"Misty winter afternoon" by Bert Kaufmann.
"Good Morning!" by Frank Wuestefeld.
"Driving home for Christmas" by Bert Kaufmann.
« »